From 374fdf81f016d0c6ea717c87aceffc57c12955d3 Mon Sep 17 00:00:00 2001 From: jongmyeong ko Date: Fri, 17 Mar 2017 03:36:49 -0700 Subject: [PATCH] Revert "[SmokeTest] Skip tests for preload request" This reverts commit ca83749c7b1f7e26f90e86f2145155a75033913a. Change-Id: I7de10af58e13c46a7dc48916b3ade5dac316b029 --- src/unit_tests/smoke_test.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 25d87d8..0fb52ff 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -848,8 +848,7 @@ class SmokeTest : public testing::Test { class PreloadSmokeTest : public testing::Test { void SetUp() override { - ASSERT_EQ(ci::RequestMode::GLOBAL, kRequestMode); - ASSERT_EQ(0, getuid()) << "Test cannot be run by normal user"; + ASSERT_TRUE(kRequestMode == ci::RequestMode::GLOBAL); } }; @@ -1387,7 +1386,8 @@ TEST_F(SmokeTest, MigrateLegacyExternalImageMode) { ValidateExternalPackage(pkgid, {appid}); } -TEST_F(PreloadSmokeTest, InstallationMode_Preload) {; +TEST_F(PreloadSmokeTest, InstallationMode_Preload) { + ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path path = kSmokePackagesDirectory / "InstallationMode_Preload.wgt"; std::string pkgid = "smokewgt37"; std::string appid = "smokewgt37.InstallationModePreload"; @@ -1397,6 +1397,7 @@ TEST_F(PreloadSmokeTest, InstallationMode_Preload) {; } TEST_F(PreloadSmokeTest, UpdateMode_Preload) { + ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Preload.wgt"; bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.wgt"; std::string pkgid = "smokewgt38"; @@ -1414,6 +1415,7 @@ TEST_F(PreloadSmokeTest, UpdateMode_Preload) { } TEST_F(PreloadSmokeTest, DeinstallationMode_Preload) { + ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user"; bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.wgt"; std::string pkgid = "smokewgt39"; std::string appid = "smokewgt39.DeinstallationModePreload"; @@ -1498,13 +1500,9 @@ TEST_F(SmokeTest, SharedRes30HybridDelta) { } // namespace common_installer int main(int argc, char** argv) { - ParseRequestMode(argc, argv); - if (getuid() != 0 || kRequestMode != ci::RequestMode::GLOBAL) { - std::cout << "Skip tests for preload request" << std::endl; - ::testing::GTEST_FLAG(filter) = "SmokeTest.*"; - } testing::InitGoogleTest(&argc, argv); testing::Environment *env = testing::AddGlobalTestEnvironment( new common_installer::SmokeEnvironment()); + ParseRequestMode(argc, argv); return RUN_ALL_TESTS(); } -- 2.7.4