Fix paths in smoke tests 12/56412/2
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 7 Jan 2016 10:38:00 +0000 (11:38 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Thu, 7 Jan 2016 12:43:09 +0000 (13:43 +0100)
Change-Id: I60006bf059b131fda7c8f82ef436754d9b66f12b

src/unit_tests/smoke_test.cc

index 67ca95a..e63ab6c 100644 (file)
@@ -36,6 +36,9 @@ namespace ci = common_installer;
 
 namespace {
 
+const bf::path kSmokePackagesDirectory =
+    "/usr/share/tpk-backend-ut/test_samples/smoke/";
+
 const char kApplicationDir[] = ".applications";
 const char kApplicationDirBackup[] = ".applications.bck";
 const char KUserAppsDir[] = "apps_rw";
@@ -318,8 +321,8 @@ class SmokeTest : public testing::Test {
 };
 
 TEST_F(SmokeTest, DeltaMode_Tpk) {
-  bf::path path = "/usr/share/app-installers-ut/test_samples/smoke/DeltaMode_Tpk.tpk";  // NOLINT
-  std::string delta_package = "/usr/share/app-installers-ut/test_samples/smoke/DeltaMode_Tpk.delta"; // NOLINT
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Tpk.tpk";
+  bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Tpk.delta";
   std::string pkgid = "smokeapp18";
   std::string appid = "smokeapp18.DeltaModeTpk";
   ASSERT_EQ(DeltaInstall(path, delta_package),
@@ -336,7 +339,7 @@ TEST_F(SmokeTest, DeltaMode_Tpk) {
 }
 
 TEST_F(SmokeTest, InstallationMode_Tpk) {
-  bf::path path = "/usr/share/app-installers-ut/test_samples/smoke/InstallationMode_Tpk.tpk";  // NOLINT
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_Tpk.tpk";
   std::string pkgid = "smokeapp12";
   std::string appid = "smokeapp12.InstallationModeTpk";
   ASSERT_EQ(Install(path), ci::AppInstaller::Result::OK);
@@ -344,8 +347,8 @@ TEST_F(SmokeTest, InstallationMode_Tpk) {
 }
 
 TEST_F(SmokeTest, UpdateMode_Tpk) {
-  bf::path path_old = "/usr/share/app-installers-ut/test_samples/smoke/UpdateMode_Tpk.tpk";  // NOLINT
-  bf::path path_new = "/usr/share/app-installers-ut/test_samples/smoke/UpdateMode_Tpk_2.tpk";  // NOLINT
+  bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Tpk.tpk";
+  bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Tpk_2.tpk";
   std::string pkgid = "smokeapp13";
   std::string appid = "smokeapp13.UpdateModeTpk";
   ASSERT_EQ(Update(path_old, path_new), ci::AppInstaller::Result::OK);
@@ -355,7 +358,7 @@ TEST_F(SmokeTest, UpdateMode_Tpk) {
 }
 
 TEST_F(SmokeTest, DeinstallationMode_Tpk) {
-  bf::path path = "/usr/share/app-installers-ut/test_samples/smoke/DeinstallationMode_Tpk.tpk";  // NOLINT
+  bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Tpk.tpk";
   std::string pkgid = "smokeapp14";
   std::string appid = "smokeapp14.DeinstallationModeTpk";
   ASSERT_EQ(Install(path), ci::AppInstaller::Result::OK);
@@ -364,7 +367,7 @@ TEST_F(SmokeTest, DeinstallationMode_Tpk) {
 }
 
 TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
-  bf::path path = "/usr/share/app-installers-ut/test_samples/smoke/RecoveryMode_Tpk_Installation.tpk";  // NOLINT
+  bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
   ASSERT_DEATH(Install(path, RequestResult::CRASH), ".*");
 
   std::string pkgid = "smokeapp15";
@@ -376,8 +379,8 @@ TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
 }
 
 TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
-  bf::path path_old = "/usr/share/app-installers-ut/test_samples/smoke/RecoveryMode_Tpk_Update.tpk";  // NOLINT
-  bf::path path_new = "/usr/share/app-installers-ut/test_samples/smoke/RecoveryMode_Tpk_Update_2.tpk";  // NOLINT
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
   RemoveAllRecoveryFiles();
   ASSERT_DEATH(Update(path_old, path_new, RequestResult::CRASH), ".*");