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);
}
};
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";
}
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";
}
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";
} // 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();
}