From: Ilho Kim Date: Tue, 28 Jul 2020 02:22:19 +0000 (+0900) Subject: Add user request mode test for recovery test X-Git-Tag: submit/tizen/20200810.091347~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F85%2F239585%2F4;p=platform%2Fcore%2Fappfw%2Ftpk-backend.git Add user request mode test for recovery test Recovery test can run user request mode With additional option '--user-request' Change-Id: I0759d9cfc76dc2231e194a7c892c4814d114cf0a Signed-off-by: Ilho Kim --- diff --git a/src/unit_tests/recovery_test.cc b/src/unit_tests/recovery_test.cc index 628929c..6a86152 100644 --- a/src/unit_tests/recovery_test.cc +++ b/src/unit_tests/recovery_test.cc @@ -359,6 +359,9 @@ int main(int argc, char** argv) { ReqType req_type = ReqType::UNKNOWN_REQ; bool repeat = false; BackupType backup_type = BackupType::MOVE; + ci::RequestMode request_mode = smoke_test::ParseRequestMode(argc, argv); + if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) + std::cout << "Run recovery test with user request mode" << std::endl; bpo::options_description options("Allowed options"); bpo::variables_map opt_map; @@ -394,7 +397,8 @@ int main(int argc, char** argv) { ("no-backup", "Do test without backup") ("backup-type", bpo::value(), " set test's " "backup type \'move\', \'copy and remove\'"); - bpo::store(bpo::parse_command_line(argc, argv, options), opt_map); + bpo::store(bpo::command_line_parser(argc, argv). + options(options).allow_unregistered().run(), opt_map); if (opt_map.count("help")) { std::cerr << options << std::endl; return -1; @@ -459,7 +463,7 @@ int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); ::env = static_cast( testing::AddGlobalTestEnvironment( - new smoke_test::SmokeEnvironment(ci::RequestMode::GLOBAL, + new smoke_test::SmokeEnvironment(request_mode, no_backup, backup_type))); signal(SIGINT, ::signalHandler); signal(SIGSEGV, ::signalHandler);