Split rpm packaging into library part and backend part 76/203976/19
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 18 Apr 2019 08:44:39 +0000 (17:44 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 17 Feb 2020 06:47:45 +0000 (15:47 +0900)
Change-Id: Icab87d25d042bfdd678395699eeb0df4bf766efa
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
packaging/tpk-backend-tests.manifest [deleted file]
packaging/tpk-backend.spec
packaging/tpk-installer-tests.manifest [new file with mode: 0644]
packaging/tpk-installer.manifest [new file with mode: 0644]
src/unit_tests/CMakeLists.txt
src/unit_tests/manifest_test.cc
src/unit_tests/smoke_test.cc
src/unit_tests/smoke_utils.cc
src/unit_tests/smoke_utils.h

diff --git a/packaging/tpk-backend-tests.manifest b/packaging/tpk-backend-tests.manifest
deleted file mode 100644 (file)
index 1004437..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<manifest>
-        <request>
-                <domain name="_" />
-        </request>
-        <assign>
-                <filesystem path="/usr/bin/tpk-backend-ut/smoke-test" exec_label="System" />
-                <filesystem path="/usr/bin/tpk-backend-ut/extensive-smoke-test" exec_label="System" />
-                <filesystem path="/usr/bin/tpk-backend-ut/smoke-test-helper" exec_label="System" />
-                <filesystem path="/usr/bin/tpk-backend-ut/recovery-test" exec_label="System" />
-        </assign>
-</manifest>
index 2f478987d5b749aff1708ef888400428837fa253..0e2f4dae168677cc33f6335c10d6918ad8a16f35 100644 (file)
@@ -6,8 +6,10 @@ Group:          Application Framework/Package Management
 License:        Apache-2.0
 Source0:        %{name}-%{version}.tar.gz
 Source1000:     tpk-backend.manifest
-Source1001:     tpk-backend-tests.manifest
+Source1001:     tpk-installer.manifest
+Source1002:     tpk-installer-tests.manifest
 
+Requires:       tpk-installer = %{version}
 BuildRequires:  boost-devel
 BuildRequires:  cmake
 BuildRequires:  gtest-devel
@@ -25,26 +27,36 @@ BuildRequires:  pkgconfig(libgum)
 %description
 Backend for tizen package files
 
+%package -n tpk-installer
+Summary:    Tpk-installer library
+Group:      Application Framework/Package Management
+
+%description -n tpk-installer
+This package contains tpk-installer library
+
+#%package -n tpk-installer-devel
 %package devel
-Summary:    Tpk-backend development files
+Summary:    Tpk-installer development files
 Group:      Application Framework/Package Management
-Requires:   %{name} = %{version}
+Requires:   tpk-installer = %{version}
 
+#%description -n tpk-installer-devel
 %description devel
 This package contains header files of tpk-installer library
 
-%package tests
-Summary: Unit tests for tpk-backend
-Requires: %{name} = %{version}
+%package -n tpk-installer-tests
+Summary: Unit tests for tpk-installer
+Requires: tpk-installer = %{version}
 
-%description tests
-Unit tests for al modules of app-installers
+%description -n tpk-installer-tests
+Unit tests for tpk-installer
 
 %prep
 %setup -q
 
 cp %{SOURCE1000} .
 cp %{SOURCE1001} .
+cp %{SOURCE1002} .
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
@@ -60,29 +72,33 @@ mkdir -p %{buildroot}/etc/package-manager/backend
 ln -s %{_bindir}/tpk-backend %{buildroot}%{_sysconfdir}/package-manager/backend/tpk
 ln -s %{_bindir}/tpk-backend %{buildroot}%{_sysconfdir}/package-manager/backend/rpm
 
-%post tests
-/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner,cap_mac_override=eip %{_bindir}/tpk-backend-ut/smoke-test
-/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner,cap_mac_override=eip %{_bindir}/tpk-backend-ut/smoke-test-helper
-/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner,cap_mac_override=eip %{_bindir}/tpk-backend-ut/recovery-test
+%post -n tpk-installer-tests
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner,cap_mac_override=eip %{_bindir}/tpk-installer-ut/smoke-test
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner,cap_mac_override=eip %{_bindir}/tpk-installer-ut/smoke-test-helper
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner,cap_mac_override=eip %{_bindir}/tpk-installer-ut/recovery-test
 
 %files
 %{_sysconfdir}/package-manager/backend/tpk
 %{_sysconfdir}/package-manager/backend/rpm
-%{_sysconfdir}/package-manager/backendlib/libtpk.so
 %license LICENSE
 %manifest tpk-backend.manifest
 %{_bindir}/tpk-backend
+
+%files -n tpk-installer
+%manifest tpk-installer.manifest
+%{_sysconfdir}/package-manager/backendlib/libtpk.so
 %{_libdir}/libtpk-installer.so*
 
+#%files -n tpk-installer-devel
 %files devel
 %{_includedir}/app-installers/tpk/*.h
 %{_includedir}/app-installers/tpk/*/*/*.h
 %{_libdir}/pkgconfig/tpk-installer.pc
 
-%files tests
-%manifest tpk-backend-tests.manifest
-%{_bindir}/tpk-backend-ut/*
-%{_datadir}/tpk-backend-ut/*
+%files -n tpk-installer-tests
+%manifest tpk-installer-tests.manifest
+%{_bindir}/tpk-installer-ut/*
+%{_datadir}/tpk-installer-ut/*
 
 %changelog
 * Thu Dec 18 2015 Pawel Sikorski <p.sikorski@samsung.com> 0.1-1
diff --git a/packaging/tpk-installer-tests.manifest b/packaging/tpk-installer-tests.manifest
new file mode 100644 (file)
index 0000000..aa268fb
--- /dev/null
@@ -0,0 +1,11 @@
+<manifest>
+        <request>
+                <domain name="_" />
+        </request>
+        <assign>
+                <filesystem path="/usr/bin/tpk-installer-ut/smoke-test" exec_label="System" />
+                <filesystem path="/usr/bin/tpk-installer-ut/extensive-smoke-test" exec_label="System" />
+                <filesystem path="/usr/bin/tpk-installer-ut/smoke-test-helper" exec_label="System" />
+                <filesystem path="/usr/bin/tpk-installer-ut/recovery-test" exec_label="System" />
+        </assign>
+</manifest>
diff --git a/packaging/tpk-installer.manifest b/packaging/tpk-installer.manifest
new file mode 100644 (file)
index 0000000..c00c25b
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+        <request>
+                <domain name="_" />
+        </request>
+</manifest>
index 85cadaec26390dde640b4f0ad4973f86de7dce91..759fe06246f9018560b69f95d96fef4dfbdfaa45 100644 (file)
@@ -1,4 +1,4 @@
-SET(DESTINATION_DIR tpk-backend-ut)
+SET(DESTINATION_DIR tpk-installer-ut)
 SET(TARGET_SMOKE_UTILS smoke-utils)
 
 # Executables
index b44dfb643b8584544b765518d9cfa1e549cc3571..dcbd231a4fed020dce5ee81d0e98afc4aefb4b6e 100644 (file)
@@ -12,7 +12,7 @@ namespace ci = common_installer;
 namespace {
 
 const char kManifestTestcaseData[] =
-    "/usr/share/tpk-backend-ut/test_samples/manifest/";
+    "/usr/share/tpk-installer-ut/test_samples/manifest/";
 
 }  // namespace
 
index 2be0129e094d2d3d041a1734df299a2362bfed38..95a044b41803f76a2cfa52ee2c852b31311a6171 100644 (file)
@@ -254,7 +254,7 @@ TEST_F(SmokeTest, DisablePkg) {
 TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
   bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-i", path.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(backend_crash.Wait(), 0);
@@ -272,7 +272,7 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
   bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(backend_crash.Wait(), 0);
@@ -561,7 +561,7 @@ TEST_F(SmokeTest, RecoveryMode_ForDelta) {
   bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Install(path_old));
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(backend_crash.Wait(), 0);
@@ -600,7 +600,7 @@ TEST_F(RollbackSmokeTest, UpdateMode) {
 TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
   bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-w", path.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(0, backend_crash.Wait());
@@ -620,7 +620,7 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
       kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(path_old));
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-w", path_new.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(0, backend_crash.Wait());
@@ -750,7 +750,7 @@ TEST_F(SmokeTest, InstallExtended_Tpk) {
 TEST_F(SmokeTest, RecoveryMode_CrashAfterUnzip) {
   bf::path path = kSmokePackagesDirectory / "RecoveryMode_CrashAfterUnzip.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-i", path.string(), "-u", test_uid_str.c_str(),
       "-step_name", "Unzip");
@@ -799,7 +799,7 @@ TEST_F(SmokeTest, RecoveryMode_SharedDataUpdate) {
       kSmokePackagesDirectory / "RecoveryMode_SharedData_2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(backend_crash.Wait(), 0);
@@ -823,7 +823,7 @@ TEST_F(SmokeTest, RecoveryMode_NonSharedDataUpdate) {
       kSmokePackagesDirectory / "RecoveryMode_NonSharedData_2.tpk";
   RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
   ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
-  ci::Subprocess backend_crash("/usr/bin/tpk-backend-ut/smoke-test-helper");
+  ci::Subprocess backend_crash("/usr/bin/tpk-installer-ut/smoke-test-helper");
   std::string test_uid_str = std::to_string(params.test_user.uid);
   backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
   ASSERT_NE(backend_crash.Wait(), 0);
index 7b952e1d41eae4437bc30c1e9b20351ac65e3bbb..256f1d783334ca35b113e5e0fb3aa2cdddb86048 100644 (file)
@@ -17,7 +17,7 @@ namespace st = smoke_test;
 namespace smoke_test {
 
 const bf::path kSmokePackagesDirectory =
-    "/usr/share/tpk-backend-ut/test_samples/smoke/";
+    "/usr/share/tpk-installer-ut/test_samples/smoke/";
 
 bool ValidatePackage(const std::string& pkgid,
     const std::pair<std::string, std::string>& app,
index 5d9b85473dbe748262c8cf14c19441d54ad52e87..db772285b623b63b1c1ec2ba7073445886993882 100644 (file)
@@ -57,7 +57,7 @@ class TpkSmokeTestHelperRunner : public SmokeTestHelperRunner {
  private:
   common_installer::Subprocess CreateSubprocess() const {
     return common_installer::Subprocess(
-        "/usr/bin/tpk-backend-ut/smoke-test-helper");
+        "/usr/bin/tpk-installer-ut/smoke-test-helper");
   }
 };