Add test to check if hybrid app is properly uninstalled 22/182222/1
authorTomasz Swierczek <t.swierczek@samsung.com>
Thu, 21 Jun 2018 08:05:38 +0000 (10:05 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Thu, 21 Jun 2018 08:25:36 +0000 (10:25 +0200)
Change-Id: Iaf26ee386ca09294ef6a38683ef3d8aa3b76f3d6

src/security-manager-tests/test_cases.cpp

index 05c52c4..f44dd9a 100644 (file)
@@ -900,3 +900,35 @@ RUNNER_CHILD_TEST(security_manager_25j_global_path_local_install)
     Api::install(invalidReq, SECURITY_MANAGER_ERROR_NOT_PATH_OWNER);
 }
 
+RUNNER_CHILD_TEST(security_manager_26_hybrid_pkg_uninstall_artifacts_check)
+{
+    TemporaryTestUser testUser("sm_test_26_user_name", GUM_USERTYPE_NORMAL);
+    testUser.create();
+
+    const std::vector<std::string> allowedPrivs = {
+        "http://tizen.org/privilege/wifidirect",
+        "http://tizen.org/privilege/telephony"
+    };
+
+    AppInstallHelper app1("sm_test_26_1", "sm_test_26", testUser.getUid());
+    app1.addPrivileges(allowedPrivs);
+    app1.setHybrid();
+
+    AppInstallHelper app2("sm_test_26_2", "sm_test_26", testUser.getUid());
+    app2.addPrivileges(allowedPrivs);
+    app2.setHybrid();
+
+    {
+        ScopedInstaller appInstall1(app1);
+        ScopedInstaller appInstall2(app2);
+        check_app_permissions(app1.getAppId(), app1.getPkgId(), testUser.getUidString(),
+                              allowedPrivs, {}, app1.getIsHybrid());
+        check_app_permissions(app2.getAppId(), app2.getPkgId(), testUser.getUidString(),
+                              allowedPrivs, {}, app2.getIsHybrid());
+
+    }
+    check_app_permissions(app1.getAppId(), app1.getPkgId(), testUser.getUidString(),
+                          {}, allowedPrivs, app1.getIsHybrid());
+    check_app_permissions(app2.getAppId(), app2.getPkgId(), testUser.getUidString(),
+                          {}, allowedPrivs, app2.getIsHybrid());
+}