Add baselibs option case
authory0169.zhang <y0169.zhang@samsung.com>
Fri, 15 Sep 2017 05:46:07 +0000 (13:46 +0800)
committery0169.zhang <y0169.zhang@samsung.com>
Fri, 15 Sep 2017 05:46:27 +0000 (13:46 +0800)
Add not export source option case

Add use own .gbs.conf case

Change-Id: Ibbb84e1401204f3a3396a6dba5073cfc88e461d4

cases/build/test_build_base_libs.case [new file with mode: 0644]
cases/build/test_build_not_export.case [new file with mode: 0644]
cases/build/test_build_own_gbs_conf.case [new file with mode: 0644]
fixtures/conf/own.cfg [new file with mode: 0644]
fixtures/conf/tizen30.cfg [new file with mode: 0644]
fixtures/specs/gdb.spec [new file with mode: 0644]
fixtures/specs/mic-bootstrap-1.0-2.1.src.rpm [new file with mode: 0644]

diff --git a/cases/build/test_build_base_libs.case b/cases/build/test_build_base_libs.case
new file mode 100644 (file)
index 0000000..9af2e2c
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>test build base libs</summary>
+  <tracking>
+    <ticket>91</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="tools/create_proj" />
+    <copy src="tools/assert" />
+    <copy src="specs/mic-bootstrap-1.0-2.1.src.rpm" />
+    <copy src="conf/tizen30.cfg" />
+  </fixtures>
+  <steps><![CDATA[
+. assert
+
+sudo /bin/rm -rf ~/GBS-ROOT/local/BUILD-ROOTS/scratch.i586.0
+sudo /bin/rm -rf $GBS_LOCAL_REPOS
+
+gbs import mic-bootstrap-1.0-2.1.src.rpm
+
+gbs -c tizen30.cfg build -A i586 --baselibs |tee log
+
+test -n "`find ~/GBS-ROOT/local/repos -name "mic-bootstrap*i686*.rpm"`"
+test -n "`find ~/GBS-ROOT/local/repos -name "mic-bootstrap*armv7l*.rpm"`"
+test -n "`find ~/GBS-ROOT/local/repos -name "mic-bootstrap*aarch64*.rpm"`"
+
+]]></steps>
+</testcase>
diff --git a/cases/build/test_build_not_export.case b/cases/build/test_build_not_export.case
new file mode 100644 (file)
index 0000000..54f23ed
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>test build not export</summary>
+  <tracking>
+    <ticket>91</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="tools/create_proj" />
+    <copy src="tools/assert" />
+    <copy src="specs/gdb.spec" />
+    <copy src="conf/base.cfg" />
+  </fixtures>
+  <steps><![CDATA[
+. assert
+
+sudo /bin/rm -rf ~/GBS-ROOT/local/BUILD-ROOTS/scratch.i586.0
+sudo /bin/rm -rf $GBS_LOCAL_REPOS
+
+./create_proj gdb.spec
+gbs -c base.cfg build -A i586 --not-export-source |tee log
+
+grep "skip export gdb for accel" log
+test -n "`find ~/GBS-ROOT/local/repos -name "gdb*.rpm"`"
+
+]]></steps>
+</testcase>
diff --git a/cases/build/test_build_own_gbs_conf.case b/cases/build/test_build_own_gbs_conf.case
new file mode 100644 (file)
index 0000000..6369d82
--- /dev/null
@@ -0,0 +1,36 @@
+<testcase>
+  <summary>test build use package own gbs.conf</summary>
+  <tracking>
+    <ticket>91</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="tools/create_proj" />
+    <copy src="tools/assert" />
+    <copy src="specs/fake.spec" />
+    <copy src="conf/own.cfg" />
+    <copy src="conf/base.cfg" />
+  </fixtures>
+  <steps><![CDATA[
+. assert
+
+sudo /bin/rm -rf ~/GBS-ROOT/local/BUILD-ROOTS/scratch.i586.0
+sudo /bin/rm -rf $GBS_LOCAL_REPOS
+
+./create_proj fake.spec
+mkdir -p fake/own
+cp fake/packaging/fake.spec fake/own/
+cp own.cfg fake/.gbs.conf
+cd fake/
+git add .
+git commit -m "Add .gbs.conf"
+cd -
+
+gbs -c base.cfg build -A i586 --debug|tee log
+
+grep "use.*own gbs.conf" log
+grep "finished building fake" log
+
+test -n "`find ~/GBS-ROOT/local/repos -name "fake*.rpm"`"
+
+]]></steps>
+</testcase>
diff --git a/fixtures/conf/own.cfg b/fixtures/conf/own.cfg
new file mode 100644 (file)
index 0000000..a809c5e
--- /dev/null
@@ -0,0 +1,2 @@
+[general]
+packaging_dir = own
diff --git a/fixtures/conf/tizen30.cfg b/fixtures/conf/tizen30.cfg
new file mode 100644 (file)
index 0000000..2a257bb
--- /dev/null
@@ -0,0 +1,9 @@
+[general]
+profile = profile.tizen_mobile
+fallback_to_native = true
+[profile.tizen_mobile]
+repos = repo.1, repo.2
+[repo.1]
+url = http://10.113.136.109/tizen/3.0-base/latest/repos/emulator32/packages/
+[repo.2]
+url = http://download.tizen.org/snapshots/tizen/3.0-mobile/latest/repos/emulator32-wayland/packages/
diff --git a/fixtures/specs/gdb.spec b/fixtures/specs/gdb.spec
new file mode 100644 (file)
index 0000000..126fe6b
--- /dev/null
@@ -0,0 +1,20 @@
+Name:       gdb
+Summary:    A fake tizen package for gbs test
+Version:    1.0
+Release:    1
+Group:      Development/Tools
+License:    GPLv2
+Source0:    %{name}-%{version}.tbz2
+
+%description
+A fake tizen package for gbs test
+* download and install gbs
+* use this package to test gbs build, remotebuild, export, import and so on
+%prep
+%setup -q
+
+%install
+mkdir -p %{buildroot}/%{_docdir}
+
+%files
+%doc README
diff --git a/fixtures/specs/mic-bootstrap-1.0-2.1.src.rpm b/fixtures/specs/mic-bootstrap-1.0-2.1.src.rpm
new file mode 100644 (file)
index 0000000..ceea117
Binary files /dev/null and b/fixtures/specs/mic-bootstrap-1.0-2.1.src.rpm differ