Add more smoke test for hybrid/wgt package in wgt 88/88988/2
authorBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Wed, 21 Sep 2016 08:35:32 +0000 (10:35 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Tue, 27 Sep 2016 09:22:11 +0000 (02:22 -0700)
Run smoke tests to verify.

If you applied patch
 - https://review.tizen.org/gerrit/#/c/88124/

there are:

[  FAILED  ] SmokeTest.MountInstallationMode_Hybrid
[  FAILED  ] SmokeTest.MountUpdateMode_Hybrid
[  FAILED  ] SmokeTest.UpdateMode_Rollback_Hybrid
[  FAILED  ] SmokeTest.MountUpdateMode_Rollback_Hybrid
[  FAILED  ] SmokeTest.MountInstallationMode_Rollback
[  FAILED  ] SmokeTest.MountUpdateMode_Rollback

This will be fixed separately.

Change-Id: I615266eb01f1abfc2861547aa62791f820d2cf65

13 files changed:
src/unit_tests/smoke_test.cc
src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt [new file with mode: 0644]

index b40b3dd..a8725bc 100644 (file)
@@ -771,6 +771,87 @@ TEST_F(SmokeTest, DeltaMode_Hybrid) {
   ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED", "version 2\n"));
 }
 
+TEST_F(SmokeTest, MountInstallationMode_Hybrid) {
+  bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Hybrid.wgt";
+  std::string pkgid = "smokehyb05";
+  std::string appid1 = "smokehyb05.web";
+  std::string appid2 = "smokehyb05.service";
+  ASSERT_EQ(MountInstall(path, PackageType::HYBRID), ci::AppInstaller::Result::OK);
+  ScopedTzipInterface interface(pkgid);
+  ValidatePackage(pkgid, {appid1, appid2});
+}
+
+TEST_F(SmokeTest, MountUpdateMode_Hybrid) {
+  bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb06";
+  std::string appid1 = "smokehyb06.web";
+  std::string appid2 = "smokehyb06.service";
+  ASSERT_EQ(MountUpdate(path_old, path_new, PackageType::WGT),
+            ci::AppInstaller::Result::OK);
+  ScopedTzipInterface interface(pkgid);
+  ValidatePackage(pkgid, {appid1, appid2});
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n"));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "2\n"));
+}
+
+TEST_F(SmokeTest, InstallationMode_Rollback_Hybrid) {
+  bf::path path = kSmokePackagesDirectory /
+      "InstallationMode_Rollback_Hybrid.wgt";
+  std::string pkgid = "smokehyb07";
+  std::string appid1 = "smokehyb07.web";
+  std::string appid2 = "smokehyb07.service";
+  ASSERT_EQ(Install(path, PackageType::HYBRID, RequestResult::FAIL),
+            ci::AppInstaller::Result::ERROR);
+  CheckPackageNonExistance(pkgid, {appid1, appid2});
+}
+
+TEST_F(SmokeTest, UpdateMode_Rollback_Hybrid) {
+  bf::path path_old = kSmokePackagesDirectory /
+      "UpdateMode_Rollback_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory /
+      "UpdateMode_Rollback_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb08";
+  std::string appid1 = "smokehyb08.web";
+  std::string appid2 = "smokehyb08.service";
+  ASSERT_EQ(Update(path_old, path_new, PackageType::HYBRID,
+      RequestResult::FAIL), ci::AppInstaller::Result::ERROR);
+  ValidatePackage(pkgid, {appid1, appid2});
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n"));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n"));
+}
+
+TEST_F(SmokeTest, MountInstallationMode_Rollback_Hybrid) {
+  bf::path path = kSmokePackagesDirectory /
+      "MountInstallationMode_Rollback_Hybrid.wgt";
+  std::string pkgid = "smokehyb09";
+  std::string appid1 = "smokehyb09.web";
+  std::string appid2 = "smokehyb09.service";
+  ASSERT_EQ(MountInstall(path, PackageType::HYBRID, RequestResult::FAIL),
+      ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid);
+  CheckPackageNonExistance(pkgid, {appid1, appid2});
+}
+
+TEST_F(SmokeTest, MountUpdateMode_Rollback_Hybrid) {
+  bf::path path_old = kSmokePackagesDirectory /
+      "MountUpdateMode_Rollback_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory /
+      "MountUpdateMode_Rollback_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb10";
+  std::string appid1 = "smokehyb10.web";
+  std::string appid2 = "smokehyb10.service";
+  ASSERT_EQ(MountUpdate(path_old, path_new, PackageType::HYBRID,
+      RequestResult::FAIL), ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid);
+  ValidatePackage(pkgid, {appid1, appid2});
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n"));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n"));
+}
+
 TEST_F(SmokeTest, MountInstallationMode) {
   bf::path path = kSmokePackagesDirectory / "MountInstallationMode.wgt";
   std::string pkgid = "smokeapp28";
@@ -793,6 +874,29 @@ TEST_F(SmokeTest, MountUpdateMode) {
   ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n"));
 }
 
+TEST_F(SmokeTest, MountInstallationMode_Rollback) {
+  bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Rollback.wgt";
+  std::string pkgid = "smokeapp33";
+  std::string appid = "smokeapp33.web";
+  ASSERT_EQ(MountInstall(path, PackageType::WGT, RequestResult::FAIL),
+            ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid);
+  CheckPackageNonExistance(pkgid, {appid});
+}
+
+TEST_F(SmokeTest, MountUpdateMode_Rollback) {
+  bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Rollback.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Rollback_2.wgt";
+  std::string pkgid = "smokeapp34";
+  std::string appid = "smokeapp34.web";
+  ASSERT_EQ(MountUpdate(path_old, path_new, PackageType::WGT,
+      RequestResult::FAIL), ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid);
+  ValidatePackage(pkgid, {appid});
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n"));
+}
+
 TEST_F(SmokeTest, UserDefinedPlugins) {
   bf::path path = kSmokePackagesDirectory / "SimpleEchoPrivilege.wgt";
   std::string pkgid = "0CSPVhKmRk";
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..2850a89
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..7c49ea6
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..631eab4
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..5e6d044
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..7af2135
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..def598d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..3615ea0
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt
new file mode 100644 (file)
index 0000000..d6c13d5
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..149494d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..18c190b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..ca92739
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..3243c91
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt differ