Fix recovery smoke test 57/57157/4 accepted/tizen/mobile/20160129.083335 accepted/tizen/tv/20160129.083410 accepted/tizen/wearable/20160129.083433 submit/tizen/20160127.110348
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 15 Jan 2016 12:32:08 +0000 (13:32 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Wed, 27 Jan 2016 08:21:46 +0000 (09:21 +0100)
Requires:
 - https://review.tizen.org/gerrit/45316

Verify by:
 $ /usr/bin/tpk-backend-ut/smoke_test --gtest_filter=SmokeTest.RecoveryMode_Tpk_Update
 $ /usr/bin/tpk-backend-ut/smoke_test --gtest_filter=SmokeTest.RecoveryMode_Tpk_Installation

Change-Id: I5f6696f668ea4b8149840b36c25d9e2bc15e1063

src/tpk/step/step_convert_xml.cc
src/unit_tests/smoke_test.cc

index 1810cf4740a9b794f1c088ce31082b06fb8294a1..651519bb30a1ff9be57d93af26c10492f9059fcc 100644 (file)
@@ -91,6 +91,11 @@ common_installer::Step::Status StepConvertXml::process() {
   bf::path new_path = bf::path(getUserManifestPath(context_->uid.get()))
       / bf::path(context_->pkgid.get());
   new_path += ".xml";
+  if (!bf::exists(new_path.parent_path())) {
+    bs::error_code error;
+    bf::create_directories(new_path.parent_path(), error);
+  }
+
   if (xmlSaveFile(new_path.string().c_str(), doc) == -1) {
     LOG(ERROR) << "Failed to write xml file";
     return Step::Status::MANIFEST_ERROR;
index e63ab6cfbde6ed30ef9ffa9046ec7c7bad5d9fcd..9e605e68d7e00c06477fe7b6461a1532b098a33f 100644 (file)
@@ -65,6 +65,8 @@ class StepCrash : public ci::Step {
 
 void RemoveAllRecoveryFiles() {
   bf::path root_path = ci::GetRootAppPath();
+  if (!bf::exists(root_path))
+    return;
   for (auto& dir_entry : boost::make_iterator_range(
          bf::directory_iterator(root_path), bf::directory_iterator())) {
     if (bf::is_regular_file(dir_entry)) {
@@ -269,7 +271,7 @@ ci::AppInstaller::Result DeltaInstall(const bf::path& path,
 
 ci::AppInstaller::Result Recover(const bf::path& recovery_file,
                                  RequestResult mode = RequestResult::NORMAL) {
-  const char* argv[] = {"", "-e", recovery_file.c_str()};
+  const char* argv[] = {"", "-b", recovery_file.c_str()};
   std::unique_ptr<ci::AppQueryInterface> query_interface =
       CreateQueryInterface();
   auto pkgmgr =