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")) {
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());
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;