Add smoke tests for unified-installer
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 24 Mar 2020 05:40:52 +0000 (14:40 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 30 Mar 2020 05:20:25 +0000 (14:20 +0900)
Change-Id: I6bb29973e19480c7e91f20d11e3b4b9edf1d0d87
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
45 files changed:
CMakeLists.txt
packaging/unified-backend.spec
packaging/unified-installer-tests.manifest [new file with mode: 0644]
packaging/unified-installer.manifest [new file with mode: 0644]
src/CMakeLists.txt
src/unit_tests/CMakeLists.txt [new file with mode: 0644]
src/unit_tests/smoke_test.cc [new file with mode: 0644]
src/unit_tests/smoke_test_helper.cc [new file with mode: 0644]
src/unit_tests/smoke_utils.cc [new file with mode: 0644]
src/unit_tests/smoke_utils.h [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk_2.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallAndUpdate_Wgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_DoubleTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_DoubleWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_RollbackTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_RollbackWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_SingleTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_TripleHybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_TripleTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Install_TripleWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Recovery_InstallTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Recovery_InstallWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Recovery_UpdateTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Recovery_UpdateWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Recovery_UpdateWgt_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_DoubleTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_DoubleTpk_2.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_DoubleWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_DoubleWgt_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_RollbackTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_RollbackTpk_2.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_RollbackWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_RollbackWgt_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_SingleTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_SingleTpk_2.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_TripleHybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_TripleHybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_TripleTpk.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_TripleTpk_2.tpk [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_TripleWgt.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/Update_TripleWgt_2.wgt [new file with mode: 0644]

index e7090d1495646174678f91f67c142d359faf2740..613d04f89273a3b7ba744d200adf23c9e8a8a681 100644 (file)
@@ -27,6 +27,8 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_LINKER_FLAGS}")
 # Targets
 SET(TARGET_UNIFIED_BACKEND "unified-backend")
 SET(TARGET_LIBNAME_UNIFIED "unified-installer")
+SET(TARGET_SMOKE_TEST "smoke-test")
+SET(TARGET_SMOKE_TEST_HELPER "smoke-test-helper")
 
 ADD_DEFINITIONS("-DPROJECT_TAG=\"UNIFIED_BACKEND\"")
 
@@ -36,13 +38,16 @@ INCLUDE(ApplyPkgConfig)
 
 # Find all needed packages once
 PKG_CHECK_MODULES(APP_INSTALLERS_DEPS REQUIRED app-installers)
+PKG_CHECK_MODULES(GUM_DEPS REQUIRED libgum)
 PKG_CHECK_MODULES(MANIFEST_PARSER_DEPS REQUIRED manifest-parser)
 PKG_CHECK_MODULES(MINIZIP_DEPS REQUIRED minizip)
 PKG_CHECK_MODULES(PKGMGR_INSTALLER_DEPS REQUIRED pkgmgr-installer)
 PKG_CHECK_MODULES(PKGMGR_TYPES_DEPS REQUIRED pkgmgr-types)
 PKG_CHECK_MODULES(TPK_INSTALLER_DEPS REQUIRED tpk-installer)
+PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
 PKG_CHECK_MODULES(WGT_INSTALLER_DEPS REQUIRED wgt-installer)
 
 FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options)
+FIND_PACKAGE(GTest REQUIRED)
 
 ADD_SUBDIRECTORY(src)
index 7e56c1b7a8867a9dfcb3ba95a887f024f1b2bb5d..371eb02826e7f46d2f8efbe748e264b42596986e 100644 (file)
@@ -8,16 +8,22 @@ Source0:       %{name}-%{version}.tar.gz
 
 Source1000:    %{name}.manifest
 Source1001:    unified-installer.manifest
+Source1002:    unified-installer-tests.manifest
 
+BuildRequires: app-installers-tests
 BuildRequires: boost-devel
 BuildRequires: cmake
-BuildRequires: app-installers-tests
+BuildRequires: gtest-devel
+BuildRequires: tpk-installer-tests
+BuildRequires: wgt-installer-tests
 BuildRequires: pkgconfig(app-installers)
+BuildRequires: pkgconfig(libgum)
 BuildRequires: pkgconfig(manifest-parser)
 BuildRequires: pkgconfig(minizip)
 BuildRequires: pkgconfig(pkgmgr-installer)
 BuildRequires: pkgconfig(pkgmgr-types)
 BuildRequires: pkgconfig(tpk-installer)
+BuildRequires: pkgconfig(vconf)
 BuildRequires: pkgconfig(wgt-installer)
 
 %description
@@ -38,11 +44,19 @@ Requires: unified-installer = %{version}
 %description -n unified-installer-devel
 This package contains header files of unified-installer library
 
+%package -n unified-installer-tests
+Summary:  Unit tests for unified-installer
+Requires: unified-installer = %{version}
+
+%description -n unified-installer-tests
+Unit tests for unified-installer
+
 %prep
 %setup -q
 
 cp %{SOURCE1000} .
 cp %{SOURCE1001} .
+cp %{SOURCE1002} .
 
 %build
 %cmake .
@@ -68,3 +82,8 @@ ln -s %{_bindir}/%{name} %{buildroot}%{_sysconfdir}/package-manager/backend/unif
 %files -n unified-installer-devel
 %{_includedir}/app-installers/unified/*.h
 %{_libdir}/pkgconfig/unified-installer.pc
+
+%files -n unified-installer-tests
+%manifest unified-installer-tests.manifest
+%{_bindir}/unified-installer-ut/*
+%{_datadir}/unified-installer-ut/*
diff --git a/packaging/unified-installer-tests.manifest b/packaging/unified-installer-tests.manifest
new file mode 100644 (file)
index 0000000..5239841
--- /dev/null
@@ -0,0 +1,9 @@
+<manifest>
+        <request>
+                <domain name="_" />
+        </request>
+        <assign>
+                <filesystem path="/usr/bin/unified-installer-ut/smoke-test" exec_label="System" />
+                <filesystem path="/usr/bin/unified-installer-ut/smoke-test-helper" exec_label="System" />
+        </assign>
+</manifest>
diff --git a/packaging/unified-installer.manifest b/packaging/unified-installer.manifest
new file mode 100644 (file)
index 0000000..c00c25b
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+        <request>
+                <domain name="_" />
+        </request>
+</manifest>
index a91f32fe7ee0a304f25b8e78ffe6143c2f846dec..52efa6fae04857051303841fea371778c64cb907 100644 (file)
@@ -1 +1,2 @@
 ADD_SUBDIRECTORY(unified)
+ADD_SUBDIRECTORY(unit_tests)
diff --git a/src/unit_tests/CMakeLists.txt b/src/unit_tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3536cdc
--- /dev/null
@@ -0,0 +1,35 @@
+SET(DESTINATION_DIR unified-installer-ut)
+SET(TARGET_SMOKE_UTILS smoke-utils)
+SET(TARGET_TPK_SMOKE_UTILS tpk-smoke-utils)
+SET(TARGET_WGT_SMOKE_UTILS wgt-smoke-utils)
+
+# Executables
+ADD_EXECUTABLE(${TARGET_SMOKE_TEST}
+  smoke_test.cc
+  smoke_utils.h
+  smoke_utils.cc
+)
+
+ADD_EXECUTABLE(${TARGET_SMOKE_TEST_HELPER}
+  smoke_test_helper.cc
+)
+
+TARGET_INCLUDE_DIRECTORIES(${TARGET_SMOKE_TEST} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
+TARGET_INCLUDE_DIRECTORIES(${TARGET_SMOKE_TEST_HELPER} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
+
+INSTALL(DIRECTORY test_samples/ DESTINATION ${SHAREDIR}/${DESTINATION_DIR}/test_samples)
+
+APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST} PUBLIC
+  Boost
+  GTEST
+  GUM_DEPS
+)
+
+# FindGTest module do not sets all needed libraries in GTEST_LIBRARIES and
+# GTest main libraries is still missing, so additional linking of
+# GTEST_MAIN_LIBRARIES is needed.
+TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST} PRIVATE ${TARGET_LIBNAME_UNIFIED} ${GTEST_MAIN_LIBRARIES} ${TARGET_SMOKE_UTILS} ${TARGET_TPK_SMOKE_UTILS} ${TARGET_WGT_SMOKE_UTILS})
+TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST_HELPER} PRIVATE ${TARGET_LIBNAME_UNIFIED} ${TARGET_TPK_SMOKE_UTILS} ${TARGET_WGT_SMOKE_UTILS})
+
+INSTALL(TARGETS ${TARGET_SMOKE_TEST} DESTINATION ${BINDIR}/${DESTINATION_DIR})
+INSTALL(TARGETS ${TARGET_SMOKE_TEST_HELPER} DESTINATION ${BINDIR}/${DESTINATION_DIR})
diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc
new file mode 100644 (file)
index 0000000..07553d9
--- /dev/null
@@ -0,0 +1,477 @@
+// Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <common/utils/subprocess.h>
+
+#include <gtest/gtest.h>
+#include <gtest/gtest-death-test.h>
+
+#include "unit_tests/smoke_utils.h"
+
+namespace ci = common_installer;
+
+namespace smoke_test {
+
+class SmokeEnvironment : public testing::Environment {
+ public:
+  explicit SmokeEnvironment(ci::RequestMode mode) : request_mode_(mode) { }
+
+  void SetUp() override {
+    if (request_mode_ == ci::RequestMode::USER) {
+      ASSERT_TRUE(AddTestUser(&test_user));
+    }
+    backups_ = SetupBackupDirectories(test_user.uid);
+    for (auto& path : backups_)
+      ASSERT_TRUE(BackupPath(path));
+  }
+  void TearDown() override {
+    ASSERT_TRUE(request_mode_ == ci::RequestMode::GLOBAL ||
+                (request_mode_ == ci::RequestMode::USER &&
+                kGlobalUserUid != test_user.uid));
+    BackendInterface::SmokeInstallerFactoryPtr factory(
+        new UnifiedSmokeInstallerFactory());
+    UnifiedBackendInterface backend(
+        std::move(factory), std::to_string(test_user.uid));
+    UninstallAllSmokeApps(request_mode_, test_user.uid, &backend);
+    for (auto& path : backups_)
+      ASSERT_TRUE(RestorePath(path));
+    if (request_mode_ == ci::RequestMode::USER) {
+      ASSERT_TRUE(DeleteTestUser());
+    }
+  }
+  User test_user;
+
+ private:
+  ci::RequestMode request_mode_;
+  std::vector<bf::path> backups_;
+};
+
+}  // namespace smoke_test
+
+
+namespace {
+
+const char kSmokeTestHelperPath[] =
+    "/usr/bin/unified-installer-ut/smoke-test-helper";
+
+smoke_test::SmokeEnvironment *env = nullptr;
+void signalHandler(int signum) {
+  env->TearDown();
+  exit(signum);
+}
+
+}  // namespace
+
+namespace smoke_test {
+
+const bf::path kUnifiedSmokePackagesDirectory =
+    "/usr/share/unified-installer-ut/test_samples/smoke/";
+
+class SmokeTest : public testing::Test {
+ public:
+  SmokeTest()
+    : backend(BackendInterface::SmokeInstallerFactoryPtr(
+              new UnifiedSmokeInstallerFactory()),
+              std::to_string(env->test_user.uid)),
+      params({PackageType::TPK, false}) {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  UnifiedBackendInterface backend;
+  TestParameters params;
+};
+
+TEST_F(SmokeTest, Install_Single) {
+  bf::path path =
+      kUnifiedSmokePackagesDirectory / "Install_SingleTpk.tpk";
+  std::string pkgid = "smokeuni01";
+  std::string appid = "smokeuni01.InstallSingleTpk";
+  std::string exec = "smokeunified";
+
+  std::vector<bf::path> paths = { path };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
+}
+
+TEST_F(SmokeTest, Install_Double) {
+  bf::path path1 =
+      kUnifiedSmokePackagesDirectory / "Install_DoubleTpk.tpk";
+  std::string pkgid1 = "smokeuni02";
+  std::string appid1 = "smokeuni02.InstallDoubleTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2 =
+      kUnifiedSmokePackagesDirectory / "Install_DoubleWgt.wgt";
+  std::string pkgid2 = "smokeuni03";
+  std::string appid2 = "smokeuni03.InstallDoubleWgt";
+  std::string exec2 = "smokeuni03.InstallDoubleWgt";
+
+  std::vector<bf::path> paths = { path1, path2 };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+}
+
+TEST_F(SmokeTest, Install_Triple) {
+  bf::path path1 =
+      kUnifiedSmokePackagesDirectory / "Install_TripleTpk.tpk";
+  std::string pkgid1 = "smokeuni04";
+  std::string appid1 = "smokeuni04.InstallTripleTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2 =
+      kUnifiedSmokePackagesDirectory / "Install_TripleWgt.wgt";
+  std::string pkgid2 = "smokeuni05";
+  std::string appid2 = "smokeuni05.InstallTripleWgt";
+  std::string exec2 = "smokeuni05.InstallTripleWgt";
+  bf::path path3 =
+      kUnifiedSmokePackagesDirectory / "Install_TripleHybrid.wgt";
+  std::string pkgid3 = "smokeuni06";
+  std::string appid3 = "smokeuni06.InstallTripleHybrid";
+  std::string exec3 = "smokeuni06.InstallTripleHybrid";
+
+  std::vector<bf::path> paths = { path1, path2, path3 };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  params.pkg_type = PackageType::HYBRID;
+  ASSERT_TRUE(ValidatePackage(pkgid3, {appid3, exec3}, params));
+}
+
+TEST_F(SmokeTest, Update_Single) {
+  bf::path path_old =
+      kUnifiedSmokePackagesDirectory / "Update_SingleTpk.tpk";
+  bf::path path_new =
+      kUnifiedSmokePackagesDirectory / "Update_SingleTpk_2.tpk";
+  std::string pkgid = "smokeuni07";
+  std::string appid = "smokeuni07.UpdateSingleTpk";
+  std::string exec = "smokeunified";
+
+  std::vector<bf::path> paths = { path_old };
+//  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  paths = { path_new };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid, "res/VERSION", "2", params));
+}
+
+TEST_F(SmokeTest, Update_Double) {
+  bf::path path1_old =
+      kUnifiedSmokePackagesDirectory / "Update_DoubleTpk.tpk";
+  bf::path path1_new =
+      kUnifiedSmokePackagesDirectory / "Update_DoubleTpk_2.tpk";
+  std::string pkgid1 = "smokeuni08";
+  std::string appid1 = "smokeuni08.UpdateDoubleTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2_old =
+      kUnifiedSmokePackagesDirectory / "Update_DoubleWgt.wgt";
+  bf::path path2_new =
+      kUnifiedSmokePackagesDirectory / "Update_DoubleWgt_2.wgt";
+  std::string pkgid2 = "smokeuni09";
+  std::string appid2 = "smokeuni09.UpdateDoubleWgt";
+  std::string exec2 = "smokeuni09.UpdateDoubleWgt";
+
+  std::vector<bf::path> paths = { path1_old, path2_old };
+//  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  paths = { path1_new, path2_new };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid1, "res/VERSION", "2", params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid2, "res/wgt/VERSION", "2", params));
+}
+
+TEST_F(SmokeTest, Update_Triple) {
+  bf::path path1_old =
+      kUnifiedSmokePackagesDirectory / "Update_TripleTpk.tpk";
+  bf::path path1_new =
+      kUnifiedSmokePackagesDirectory / "Update_TripleTpk_2.tpk";
+  std::string pkgid1 = "smokeuni10";
+  std::string appid1 = "smokeuni10.UpdateTripleTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2_old =
+      kUnifiedSmokePackagesDirectory / "Update_TripleWgt.wgt";
+  bf::path path2_new =
+      kUnifiedSmokePackagesDirectory / "Update_TripleWgt_2.wgt";
+  std::string pkgid2 = "smokeuni11";
+  std::string appid2 = "smokeuni11.UpdateTripleWgt";
+  std::string exec2 = "smokeuni11.UpdateTripleWgt";
+  bf::path path3_old =
+      kUnifiedSmokePackagesDirectory / "Update_TripleHybrid.wgt";
+  bf::path path3_new =
+      kUnifiedSmokePackagesDirectory / "Update_TripleHybrid_2.wgt";
+  std::string pkgid3 = "smokeuni12";
+  std::string appid3 = "smokeuni12.UpdateTripleHybrid";
+  std::string exec3 = "smokeuni12.UpdateTripleHybrid";
+
+  std::vector<bf::path> paths = { path1_old, path2_old, path3_old };
+//  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  paths = { path1_new, path2_new, path3_new };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  params.pkg_type = PackageType::HYBRID;
+  ASSERT_TRUE(ValidatePackage(pkgid3, {appid3, exec3}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid1, "res/VERSION", "2", params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid2, "res/wgt/VERSION", "2", params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid3, "res/wgt/VERSION", "2", params));
+}
+
+TEST_F(SmokeTest, InstallAndUpdate) {
+  bf::path path1_old =
+      kUnifiedSmokePackagesDirectory / "InstallAndUpdate_Tpk.tpk";
+  bf::path path1_new =
+      kUnifiedSmokePackagesDirectory / "InstallAndUpdate_Tpk_2.tpk";
+  std::string pkgid1 = "smokeuni13";
+  std::string appid1 = "smokeuni13.InstallAndUpdateModeTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2 =
+      kUnifiedSmokePackagesDirectory / "InstallAndUpdate_Wgt.wgt";
+  std::string pkgid2 = "smokeuni14";
+  std::string appid2 = "smokeuni14.InstallAndUpdateWgt";
+  std::string exec2 = "smokeuni14.InstallAndUpdateWgt";
+
+  // install tpk version 1
+  std::vector<bf::path> paths = { path1_old };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  // update tpk version 2, install wgt version 1
+  paths = { path1_new, path2 };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid1, "res/VERSION", "2", params));
+}
+
+class RollbackSmokeTest : public testing::Test {
+ public:
+  RollbackSmokeTest()
+    : backend(BackendInterface::SmokeInstallerFactoryPtr(
+              new UnifiedSmokeInstallerFactory()),
+              std::to_string(env->test_user.uid),
+              RequestResult::FAIL),
+      params({PackageType::TPK, false}) {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  UnifiedBackendInterface backend;
+  TestParameters params;
+};
+
+TEST_F(RollbackSmokeTest, Install_Rollback) {
+  bf::path path1 =
+      kUnifiedSmokePackagesDirectory / "Install_RollbackTpk.tpk";
+  std::string pkgid1 = "smokeuni15";
+  std::string appid1 = "smokeuni15.InstallRollbackTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2 =
+      kUnifiedSmokePackagesDirectory / "Install_RollbackWgt.wgt";
+  std::string pkgid2 = "smokeuni16";
+  std::string appid2 = "smokeuni16.InstallRollbackWgt";
+  std::string exec2 = "smokeuni16.InstallRollbackWgt";
+
+  std::vector<bf::path> paths = { path1, path2 };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::ERROR);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid1, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid2, params));
+};
+
+TEST_F(RollbackSmokeTest, Update_Rollback) {
+  bf::path path1_old =
+      kUnifiedSmokePackagesDirectory / "Update_RollbackTpk.tpk";
+  bf::path path1_new =
+      kUnifiedSmokePackagesDirectory / "Update_RollbackTpk_2.tpk";
+  std::string pkgid1 = "smokeuni17";
+  std::string appid1 = "smokeuni17.UpdateRollbackTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2_old =
+      kUnifiedSmokePackagesDirectory / "Update_RollbackWgt.wgt";
+  bf::path path2_new =
+      kUnifiedSmokePackagesDirectory / "Update_RollbackWgt_2.wgt";
+  std::string pkgid2 = "smokeuni18";
+  std::string appid2 = "smokeuni18.UpdateRollbackWgt";
+  std::string exec2 = "smokeuni18.UpdateRollbackWgt";
+
+  std::vector<bf::path> paths = { path1_old, path2_old };
+  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
+  paths = { path1_new, path2_new };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::ERROR);
+
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid1, "res/VERSION", "1", params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid2, "res/wgt/VERSION", "1", params));
+};
+
+TEST_F(RollbackSmokeTest, InstallAndUpdate_Rollback) {
+  bf::path path1 =
+      kUnifiedSmokePackagesDirectory / "InstallAndUpdate_RollbackTpk.tpk";
+  std::string pkgid1 = "smokeuni19";
+  std::string appid1 = "smokeuni19.InstallAndUpdateRollbackTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2_old =
+      kUnifiedSmokePackagesDirectory / "InstallAndUpdate_RollbackWgt.wgt";
+  bf::path path2_new =
+      kUnifiedSmokePackagesDirectory / "InstallAndUpdate_RollbackWgt_2.wgt";
+  std::string pkgid2 = "smokeuni20";
+  std::string appid2 = "smokeuni20.InstallAndUpdateRollbackWgt";
+  std::string exec2 = "smokeuni20.InstallAndUpdateRollbackWgt";
+
+  std::vector<bf::path> paths = { path2_old };
+  ASSERT_EQ(backend.InstallSuccess(paths), ci::AppInstaller::Result::OK);
+  // pkgid1: install, pkgid2: update
+  paths = { path1, path2_new };
+  ASSERT_EQ(backend.Install(paths), ci::AppInstaller::Result::ERROR);
+
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid1, params));
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid2, "res/wgt/VERSION", "1", params));
+};
+
+TEST_F(SmokeTest, Recovery_Install) {
+  bf::path path1 =
+      kUnifiedSmokePackagesDirectory / "Recovery_InstallTpk.tpk";
+  std::string pkgid1 = "smokeuni21";
+  std::string appid1 = "smokeuni21.Recovery_InstallTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2 =
+      kUnifiedSmokePackagesDirectory / "Recovery_InstallWgt.wgt";
+  std::string pkgid2 = "smokeuni22";
+  std::string appid2 = "smokeuni22.Recovery_InstallWgt";
+  std::string exec2 = "smokeuni22.Recovery_InstallWgt";
+
+  std::vector<std::string> paths = { path1.string(), path2.string() };
+  ci::Subprocess backend_crash(kSmokeTestHelperPath);
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> argv = { "-u", test_uid_str, "-i" };
+  argv.insert(argv.end(), paths.begin(), paths.end());
+  backend_crash.Run(argv);
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  bf::path recovery_file =
+      FindRecoveryFile("/tpk-recovery", params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+      GetRecoverFileInfo(recovery_file);
+  ASSERT_TRUE(recovery_info);
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid1, params));
+  ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+
+  recovery_file =
+      FindRecoveryFile("/wgt-recovery", params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  recovery_info.reset();
+  recovery_info = GetRecoverFileInfo(recovery_file);
+  ASSERT_TRUE(recovery_info);
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid2, params));
+  ASSERT_FALSE(bf::exists(recovery_info->unpacked_dir()));
+};
+
+TEST_F(SmokeTest, Recovery_Update) {
+  bf::path path1_old =
+      kUnifiedSmokePackagesDirectory / "Recovery_UpdateTpk.tpk";
+  bf::path path1_new =
+      kUnifiedSmokePackagesDirectory / "Recovery_UpdateTpk.tpk";
+  std::string pkgid1 = "smokeuni23";
+  std::string appid1 = "smokeuni23.Recovery_UpdateTpk";
+  std::string exec1 = "smokeunified";
+  bf::path path2_old =
+      kUnifiedSmokePackagesDirectory / "Recovery_UpdateWgt.wgt";
+  bf::path path2_new =
+      kUnifiedSmokePackagesDirectory / "Recovery_UpdateWgt.wgt";
+  std::string pkgid2 = "smokeuni24";
+  std::string appid2 = "smokeuni24.Recovery_UpdateWgt";
+  std::string exec2 = "smokeuni24.Recovery_UpdateWgt";
+
+  std::vector<bf::path> paths_old = { path1_old, path2_old };
+  ASSERT_EQ(backend.Install(paths_old), ci::AppInstaller::Result::OK);
+
+  std::vector<std::string> paths = { path1_new.string(), path2_new.string() };
+  ci::Subprocess backend_crash(kSmokeTestHelperPath);
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> argv = { "-u", test_uid_str, "-i" };
+  argv.insert(argv.end(), paths.begin(), paths.end());
+  backend_crash.Run(argv);
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  bf::path recovery_file =
+      FindRecoveryFile("/tpk-recovery", params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  std::unique_ptr<ci::recovery::RecoveryFile> recovery_info =
+      GetRecoverFileInfo(recovery_file);
+  ASSERT_TRUE(recovery_info);
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::TPK;
+  ASSERT_TRUE(ValidatePackage(pkgid1, {appid1, exec1}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid1, "res/VERSION", "1", params));
+
+  recovery_file =
+      FindRecoveryFile("/wgt-recovery", params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  recovery_info.reset();
+  recovery_info = GetRecoverFileInfo(recovery_file);
+  ASSERT_TRUE(recovery_info);
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  params.pkg_type = PackageType::WGT;
+  ASSERT_TRUE(ValidatePackage(pkgid2, {appid2, exec2}, params));
+  ASSERT_TRUE(
+      ValidateFileContentInPackage(pkgid2, "res/wgt/VERSION", "1", params));
+};
+
+}  // namespace smoke_test
+
+int main(int argc, char** argv) {
+  try {
+    ci::RequestMode request_mode = smoke_test::ParseRequestMode(argc, argv);
+    if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) {
+      std::cout << "Skip tests for preload request" << std::endl;
+      ::testing::GTEST_FLAG(filter) = "SmokeTest.*";
+    }
+    testing::InitGoogleTest(&argc, argv);
+    ::env = static_cast<smoke_test::SmokeEnvironment*>(
+        testing::AddGlobalTestEnvironment(
+          new smoke_test::SmokeEnvironment(request_mode)));
+    signal(SIGINT, ::signalHandler);
+    signal(SIGSEGV, ::signalHandler);
+    return RUN_ALL_TESTS();
+  } catch (...) {
+    std::cout << "Exception occurred during testing" << std::endl;
+    return -1;
+  }
+}
diff --git a/src/unit_tests/smoke_test_helper.cc b/src/unit_tests/smoke_test_helper.cc
new file mode 100644 (file)
index 0000000..78ace41
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <common/installer_factory.h>
+#include <common/installer_runner.h>
+#include <common/pkgmgr_interface.h>
+#include <tpk/tpk_app_query_interface.h>
+#include <unit_tests/common/smoke_utils.h>
+#include <unit_tests/tpk_smoke_utils.h>
+#include <unit_tests/wgt_smoke_utils.h>
+#include <wgt/utils/wgt_app_query_interface.h>
+
+#include <algorithm>
+#include <memory>
+#include <string>
+
+namespace ci = common_installer;
+
+namespace {
+
+bool EndsWith(const std::string str, const std::string& to_match) {
+  if (to_match.size() > str.size())
+    return false;
+  return std::equal(to_match.rbegin(), to_match.rend(), str.rbegin());
+}
+
+#if __cplusplus < 201300L
+template<typename T, typename... Args>
+std::unique_ptr<T> make_unique(Args&&... args) {
+  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+#endif
+
+}  // namespace
+
+class CrashInstallerFactory : public ci::InstallerFactory {
+ public:
+  std::unique_ptr<ci::AppInstaller> CreateInstaller(ci::PkgMgrPtr pkgmgr,
+      int idx) override {
+    std::string type =
+        EndsWith(pkgmgr->GetRequestInfo(idx), "tpk") ? "tpk" : "wgt";
+    int n_pkgs = pkgmgr->GetRequestInfoCount();
+    std::unique_ptr<ci::AppInstaller> installer;
+    if (type == "tpk") {
+      tpk::TpkAppQueryInterface* tpk_aqi = new tpk::TpkAppQueryInterface();
+      pkgmgr->AddAppQueryInterface(idx, tpk_aqi);
+      installer.reset(
+          idx + 1 == n_pkgs ?
+              new smoke_test::CrashTpkInstaller(pkgmgr, -1, {},
+                  smoke_test::CrashStepType::PROCESS) :
+              new tpk::TpkInstaller(pkgmgr));
+
+    } else {
+      wgt::WgtAppQueryInterface* wgt_aqi = new wgt::WgtAppQueryInterface();
+      pkgmgr->AddAppQueryInterface(idx, wgt_aqi);
+      installer.reset(
+          idx + 1 == n_pkgs ?
+              new smoke_test::CrashWgtInstaller(pkgmgr, -1, {},
+                  smoke_test::CrashStepType::PROCESS) :
+              new wgt::WgtInstaller(pkgmgr));
+    }
+    installer->SetIndex(idx);
+    return installer;
+  }
+};
+
+int main(int argc, char** argv) {
+  ci::PkgmgrInstaller pkgmgr_installer;
+  auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer);
+
+#if __cplusplus >= 201300L
+  using std;
+#endif
+  ci::InstallerRunner runner(make_unique<CrashInstallerFactory>(), pkgmgr);
+  ci::AppInstaller::Result result = runner.Run();
+
+  return (result == ci::AppInstaller::Result::OK) ? 0 : 1;
+}
diff --git a/src/unit_tests/smoke_utils.cc b/src/unit_tests/smoke_utils.cc
new file mode 100644 (file)
index 0000000..4ef89ab
--- /dev/null
@@ -0,0 +1,151 @@
+// Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "unit_tests/smoke_utils.h"
+
+#include <unit_tests/common/smoke_utils.h>
+#include <unit_tests/tpk_smoke_utils.h>
+#include <unit_tests/wgt_smoke_utils.h>
+#include <unzip.h>
+
+#include <map>
+#include <string>
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace {
+
+std::map<const char*, const char*> kTypeMap = {
+  {"res/wgt/config.xml", "wgt"},
+  {"config.xml", "wgt"},
+  {"tizen-manifest.xml", "tpk"},
+};
+
+std::string GetPkgTypeFromPkgid(const std::string& pkgid, uid_t uid) {
+  ci::PkgQueryInterface query(pkgid, uid);
+  return query.Type();
+}
+
+std::string GetPkgTypeFromPath(const std::string& path) {
+  std::string type;
+  unzFile uf = unzOpen(path.c_str());
+  if (!uf) {
+    LOG(ERROR) << "Failed to open zip file: " << path;
+    return type;
+  }
+  for (auto it : kTypeMap) {
+    if (unzLocateFile(uf, it.first, 0) == UNZ_OK) {
+      LOG(DEBUG) << "Found: " << it.first;
+      type = it.second;
+      break;
+    }
+  }
+  if (type.empty())
+    LOG(ERROR) << "Cannot get pkg type";
+  unzClose(uf);
+  return type;
+}
+
+std::string GetPkgTypeFromRecoveryFile(const std::string& path) {
+  bf::path recovery_file = path;
+  if (recovery_file.filename().string().find("tpk") == 0)
+    return "tpk";
+  else if (recovery_file.filename().string().find("wgt") == 0)
+    return "wgt";
+  return {};
+}
+
+std::string GetPkgType(const std::string& pkginfo, uid_t uid) {
+  std::string type = GetPkgTypeFromPkgid(pkginfo, uid);
+  if (type.empty())
+    type = GetPkgTypeFromPath(pkginfo);
+  // recovery file
+  if (type.empty())
+    type = GetPkgTypeFromRecoveryFile(pkginfo);
+  return type;
+}
+
+}  // namespace
+
+namespace smoke_test {
+
+UnifiedSmokeInstallerFactory::AppInstallerPtr
+UnifiedSmokeInstallerFactory::CreateInstaller(
+    int idx, ci::PkgMgrPtr pkgmgr) const {
+  std::string type = GetPkgType(pkgmgr->GetRequestInfo(idx), pkgmgr->GetUid());
+  if (type.empty())
+    return {};
+
+  std::unique_ptr<ci::AppInstaller> installer;
+  if (type == "tpk") {
+    tpk::TpkAppQueryInterface* tpk_aqi = new tpk::TpkAppQueryInterface();
+    pkgmgr->AddAppQueryInterface(idx, tpk_aqi);
+    installer.reset(new tpk::TpkInstaller(pkgmgr));
+  } else {
+    wgt::WgtAppQueryInterface* wgt_aqi = new wgt::WgtAppQueryInterface();
+    pkgmgr->AddAppQueryInterface(idx, wgt_aqi);
+    if (wgt_aqi->IsHybridApplication(pkgmgr->GetRequestInfo(idx),
+            pkgmgr->GetUid())) {
+      LOG(INFO) << "Hybrid package detected";
+      installer.reset(new hybrid::HybridInstaller(pkgmgr));
+    } else {
+      installer.reset(new wgt::WgtInstaller(pkgmgr));
+    }
+  }
+
+  installer->SetIndex(idx);
+
+  return installer;
+}
+
+UnifiedSmokeInstallerFactory::AppInstallerPtr
+UnifiedSmokeInstallerFactory::CreateFailExpectedInstaller(
+    int idx, ci::PkgMgrPtr pkgmgr, int fail_at) const {
+  std::string type = GetPkgType(pkgmgr->GetRequestInfo(idx), pkgmgr->GetUid());
+  if (type.empty())
+    return {};
+
+  std::unique_ptr<ci::AppInstaller> installer;
+  if (type == "tpk") {
+    tpk::TpkAppQueryInterface* tpk_aqi = new tpk::TpkAppQueryInterface();
+    pkgmgr->AddAppQueryInterface(idx, tpk_aqi);
+    installer.reset(new smoke_test::FailExpectedTpkInstaller(pkgmgr, fail_at));
+  } else {
+    wgt::WgtAppQueryInterface* wgt_aqi = new wgt::WgtAppQueryInterface();
+    pkgmgr->AddAppQueryInterface(idx, wgt_aqi);
+    if (wgt_aqi->IsHybridApplication(pkgmgr->GetRequestInfo(idx),
+            pkgmgr->GetUid())) {
+      LOG(INFO) << "Hybrid package detected";
+      installer.reset(
+          new smoke_test::FailExpectedHybridInstaller(pkgmgr, fail_at));
+    } else {
+      installer.reset(
+          new smoke_test::FailExpectedWgtInstaller(pkgmgr, fail_at));
+    }
+  }
+
+  installer->SetIndex(idx);
+
+  return installer;
+}
+
+UnifiedBackendInterface::AppQueryInterfacePtr
+UnifiedBackendInterface::CreateQueryInterface() const {
+  // this is not used
+  return {};
+}
+
+UnifiedBackendInterface::AppInstallerPtr
+UnifiedBackendInterface::CreateInstaller(ci::PkgMgrPtr pkgmgr) const {
+  return factory_->CreateInstaller(0, pkgmgr);
+}
+
+UnifiedBackendInterface::AppInstallerPtr
+UnifiedBackendInterface::CreateFailExpectedInstaller(
+    ci::PkgMgrPtr pkgmgr, int fail_at) const {
+  return factory_->CreateFailExpectedInstaller(0, pkgmgr, fail_at);;
+}
+
+}  // smoke_test
diff --git a/src/unit_tests/smoke_utils.h b/src/unit_tests/smoke_utils.h
new file mode 100644 (file)
index 0000000..df7cbfa
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef UNIT_TESTS_SMOKE_UTILS_H_
+#define UNIT_TESTS_SMOKE_UTILS_H_
+
+#include <common/app_installer.h>
+#include <common/pkgmgr_interface.h>
+#include <unit_tests/common/smoke_utils.h>
+#include <unit_tests/tpk_smoke_utils.h>
+
+namespace smoke_test {
+
+class UnifiedSmokeInstallerFactory : public SmokeInstallerFactory {
+ public:
+  AppInstallerPtr CreateInstaller(
+      int idx, common_installer::PkgMgrPtr pkgmgr) const override;
+  AppInstallerPtr CreateFailExpectedInstaller(
+      int idx, common_installer::PkgMgrPtr pkgmgr, int fail_at) const override;
+};
+
+class UnifiedBackendInterface : public BackendInterface {
+ public:
+  using BackendInterface::BackendInterface;
+
+  AppQueryInterfacePtr CreateQueryInterface() const override;
+  AppInstallerPtr CreateInstaller(
+      common_installer::PkgMgrPtr pkgmgr) const override;
+  AppInstallerPtr CreateFailExpectedInstaller(
+      common_installer::PkgMgrPtr pkgmgr, int fail_at) const override;
+};
+
+}  // namespace smoke_test
+
+#endif  // UNIT_TESTS_SMOKE_UTILS_H_
diff --git a/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackTpk.tpk b/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackTpk.tpk
new file mode 100644 (file)
index 0000000..ed9986f
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt.wgt b/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt.wgt
new file mode 100644 (file)
index 0000000..7b7eec8
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt_2.wgt b/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt_2.wgt
new file mode 100644 (file)
index 0000000..5ce4a31
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallAndUpdate_RollbackWgt_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk.tpk b/src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk.tpk
new file mode 100644 (file)
index 0000000..a1962e7
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk_2.tpk b/src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk_2.tpk
new file mode 100644 (file)
index 0000000..b89491f
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallAndUpdate_Tpk_2.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/InstallAndUpdate_Wgt.wgt b/src/unit_tests/test_samples/smoke/InstallAndUpdate_Wgt.wgt
new file mode 100644 (file)
index 0000000..9693927
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallAndUpdate_Wgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Install_DoubleTpk.tpk b/src/unit_tests/test_samples/smoke/Install_DoubleTpk.tpk
new file mode 100644 (file)
index 0000000..dd2cacf
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_DoubleTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Install_DoubleWgt.wgt b/src/unit_tests/test_samples/smoke/Install_DoubleWgt.wgt
new file mode 100644 (file)
index 0000000..012ad4b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_DoubleWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Install_RollbackTpk.tpk b/src/unit_tests/test_samples/smoke/Install_RollbackTpk.tpk
new file mode 100644 (file)
index 0000000..4ccaf24
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_RollbackTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Install_RollbackWgt.wgt b/src/unit_tests/test_samples/smoke/Install_RollbackWgt.wgt
new file mode 100644 (file)
index 0000000..4a13903
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_RollbackWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Install_SingleTpk.tpk b/src/unit_tests/test_samples/smoke/Install_SingleTpk.tpk
new file mode 100644 (file)
index 0000000..6ff90ec
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_SingleTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Install_TripleHybrid.wgt b/src/unit_tests/test_samples/smoke/Install_TripleHybrid.wgt
new file mode 100644 (file)
index 0000000..6da86a3
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_TripleHybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Install_TripleTpk.tpk b/src/unit_tests/test_samples/smoke/Install_TripleTpk.tpk
new file mode 100644 (file)
index 0000000..7fda828
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_TripleTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Install_TripleWgt.wgt b/src/unit_tests/test_samples/smoke/Install_TripleWgt.wgt
new file mode 100644 (file)
index 0000000..bd63e79
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Install_TripleWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Recovery_InstallTpk.tpk b/src/unit_tests/test_samples/smoke/Recovery_InstallTpk.tpk
new file mode 100644 (file)
index 0000000..abfbdf9
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Recovery_InstallTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Recovery_InstallWgt.wgt b/src/unit_tests/test_samples/smoke/Recovery_InstallWgt.wgt
new file mode 100644 (file)
index 0000000..7c44cd2
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Recovery_InstallWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Recovery_UpdateTpk.tpk b/src/unit_tests/test_samples/smoke/Recovery_UpdateTpk.tpk
new file mode 100644 (file)
index 0000000..da74583
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Recovery_UpdateTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Recovery_UpdateWgt.wgt b/src/unit_tests/test_samples/smoke/Recovery_UpdateWgt.wgt
new file mode 100644 (file)
index 0000000..849cca7
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Recovery_UpdateWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Recovery_UpdateWgt_2.wgt b/src/unit_tests/test_samples/smoke/Recovery_UpdateWgt_2.wgt
new file mode 100644 (file)
index 0000000..b5882c6
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Recovery_UpdateWgt_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_DoubleTpk.tpk b/src/unit_tests/test_samples/smoke/Update_DoubleTpk.tpk
new file mode 100644 (file)
index 0000000..dbee219
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_DoubleTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_DoubleTpk_2.tpk b/src/unit_tests/test_samples/smoke/Update_DoubleTpk_2.tpk
new file mode 100644 (file)
index 0000000..5dd7d91
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_DoubleTpk_2.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_DoubleWgt.wgt b/src/unit_tests/test_samples/smoke/Update_DoubleWgt.wgt
new file mode 100644 (file)
index 0000000..ba5a98d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_DoubleWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_DoubleWgt_2.wgt b/src/unit_tests/test_samples/smoke/Update_DoubleWgt_2.wgt
new file mode 100644 (file)
index 0000000..58d4039
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_DoubleWgt_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_RollbackTpk.tpk b/src/unit_tests/test_samples/smoke/Update_RollbackTpk.tpk
new file mode 100644 (file)
index 0000000..2d9065d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_RollbackTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_RollbackTpk_2.tpk b/src/unit_tests/test_samples/smoke/Update_RollbackTpk_2.tpk
new file mode 100644 (file)
index 0000000..96dc4fd
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_RollbackTpk_2.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_RollbackWgt.wgt b/src/unit_tests/test_samples/smoke/Update_RollbackWgt.wgt
new file mode 100644 (file)
index 0000000..6d670e1
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_RollbackWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_RollbackWgt_2.wgt b/src/unit_tests/test_samples/smoke/Update_RollbackWgt_2.wgt
new file mode 100644 (file)
index 0000000..71e23b0
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_RollbackWgt_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_SingleTpk.tpk b/src/unit_tests/test_samples/smoke/Update_SingleTpk.tpk
new file mode 100644 (file)
index 0000000..ab44827
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_SingleTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_SingleTpk_2.tpk b/src/unit_tests/test_samples/smoke/Update_SingleTpk_2.tpk
new file mode 100644 (file)
index 0000000..e414f11
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_SingleTpk_2.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_TripleHybrid.wgt b/src/unit_tests/test_samples/smoke/Update_TripleHybrid.wgt
new file mode 100644 (file)
index 0000000..7ae8eed
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_TripleHybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_TripleHybrid_2.wgt b/src/unit_tests/test_samples/smoke/Update_TripleHybrid_2.wgt
new file mode 100644 (file)
index 0000000..10c2ee5
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_TripleHybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_TripleTpk.tpk b/src/unit_tests/test_samples/smoke/Update_TripleTpk.tpk
new file mode 100644 (file)
index 0000000..9362636
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_TripleTpk.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_TripleTpk_2.tpk b/src/unit_tests/test_samples/smoke/Update_TripleTpk_2.tpk
new file mode 100644 (file)
index 0000000..7dac47d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_TripleTpk_2.tpk differ
diff --git a/src/unit_tests/test_samples/smoke/Update_TripleWgt.wgt b/src/unit_tests/test_samples/smoke/Update_TripleWgt.wgt
new file mode 100644 (file)
index 0000000..85bcbe8
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_TripleWgt.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/Update_TripleWgt_2.wgt b/src/unit_tests/test_samples/smoke/Update_TripleWgt_2.wgt
new file mode 100644 (file)
index 0000000..1b23d6e
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/Update_TripleWgt_2.wgt differ