1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
5 #include <common/pkgmgr_interface.h>
8 #include "wgt/wgt_app_query_interface.h"
9 #include "wgt/wgt_installer.h"
11 namespace ci = common_installer;
15 class StepCrash : public ci::Step {
19 ci::Step::Status process() override {
23 ci::Step::Status clean() override { return ci::Step::Status::OK; }
24 ci::Step::Status undo() override { return ci::Step::Status::OK; }
25 ci::Step::Status precheck() override { return ci::Step::Status::OK; }
32 // this main of test binay in done purely for recovery smoke test.
33 int main(int argc, char** argv) {
35 int backend_argc = argc;
36 if (!strcmp(argv[argc-2], "-idx")) {
37 index = atoi(argv[argc-1]);
38 backend_argc = argc - 2;
39 LOG(DEBUG) << "Step crash after " << index << " step.";
42 ci::PkgmgrInstaller pkgmgr_installer;
43 wgt::WgtAppQueryInterface query_interface;
44 auto pkgmgr = ci::PkgMgrInterface::Create(backend_argc, argv, &pkgmgr_installer,
47 LOG(ERROR) << "Options of pkgmgr installer cannot be parsed";
51 wgt::WgtInstaller installer(pkgmgr);
53 installer.AddStepAtIndex<StepCrash>(index);
55 installer.AddStep<StepCrash>();
57 return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;