Supports the "remove_plugin_steps" option in smoke test 14/286414/5
authorilho kim <ilho159.kim@samsung.com>
Thu, 5 Jan 2023 10:58:16 +0000 (19:58 +0900)
committerilho kim <ilho159.kim@samsung.com>
Thu, 5 Jan 2023 12:47:17 +0000 (21:47 +0900)
This option is for prevent the excution of plugin that can affect the test

Change-Id: I759cadb77421e85b9c8beed5c50f3396614358b2
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
test/smoke_tests/smoke_test_helper.cc

index 45dbacc4230badb80ba7c5087990ffde139b6b35..b83d41c31523f77fa79ccf772a4270501a690384 100644 (file)
 
 namespace ci = common_installer;
 
+static int RunCrashWgtInstaller(ci::PkgMgrPtr pkgmgr,
+                                int index,
+                                std::string step_name,
+                                smoke_test::CrashStepType type) {
+  smoke_test::CrashWgtInstaller t(pkgmgr, index, step_name, type);
+
+  if (t.Run() != ci::AppInstaller::Result::OK) {
+    LOG(ERROR) << "CrashWgtInstaller run failure";
+    return 1;
+  }
+  return 0;
+}
+
+static int RunWgtInstallerWithoutParserPlugins(ci::PkgMgrPtr pkgmgr) {
+  smoke_test::WgtInstallerWithoutPasrserPlugins t(pkgmgr);
+
+  if (t.Run() != ci::AppInstaller::Result::OK) {
+    LOG(ERROR) << "WgtInstallerWithoutPasrserPlugins run failure";
+    return 1;
+  }
+  return 0;
+}
+
 // this main of test binay in done purely for recovery smoke test.
 int main(int argc, char** argv) {
   try {
     int index = -1;
     int backend_argc = argc;
     std::string step_name;
+    bool remove_plugins = false;
     smoke_test::CrashStepType type = smoke_test::CrashStepType::PROCESS;
 
     if (!strcmp(argv[backend_argc - 1], "-type_clean")) {
@@ -37,6 +61,12 @@ int main(int argc, char** argv) {
       LOG(DEBUG) << "Step crash after " << step_name << " step.";
     }
 
+    if (!strcmp(argv[backend_argc-1], "-remove_plugin_steps")) {
+      backend_argc--;
+      remove_plugins = true;
+      LOG(DEBUG) << "Remove parser plugins steps";
+    }
+
     ci::PkgmgrInstaller pkgmgr_installer;
     std::shared_ptr<wgt::WgtAppQueryInterface> query_interface(
         new wgt::WgtAppQueryInterface());
@@ -47,8 +77,10 @@ int main(int argc, char** argv) {
       return EINVAL;
     }
 
-    smoke_test::CrashWgtInstaller installer(pkgmgr, index, step_name, type);
-    return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
+    if (remove_plugins)
+      return RunWgtInstallerWithoutParserPlugins(pkgmgr);
+    else
+      return RunCrashWgtInstaller(pkgmgr, index, step_name, type);
   } catch (...) {
     std::cout << "Exception occurred during testing" << std::endl;
     return 1;