class SmokeTest : public testing::Test {
};
+class PreloadSmokeTest : public testing::Test {
+ void SetUp() override {
+ ASSERT_EQ(kGlobalUserUid, kTestUserId);
+ }
+};
+
// TODO(b.kunikowski): New smoke app pkgid name convention.
// Change all smokeapp pkgids to smoketpk, because now there
// may be some smoke app pkgid identical as in tpk smoke tests, and this may
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n"));
}
-TEST_F(SmokeTest, InstallationMode_Preload) {
+TEST_F(PreloadSmokeTest, InstallationMode_Preload) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
bf::path path = kSmokePackagesDirectory / "InstallationMode_Preload.tpk";
std::string pkgid = "smoketpk29";
ValidatePackage(pkgid, appid, true);
}
-TEST_F(SmokeTest, UpdateMode_Preload) {
+TEST_F(PreloadSmokeTest, UpdateMode_Preload) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Preload.tpk";
bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.tpk";
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "2", true));
}
-TEST_F(SmokeTest, DeinstallationMode_Preload) {
+TEST_F(PreloadSmokeTest, DeinstallationMode_Preload) {
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.tpk";
std::string pkgid = "smoketpk31";
int main(int argc, char** argv) {
ci::RequestMode request_mode = ParseRequestMode(argc, argv);
+ if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) {
+ std::cout << "Skip tests for preload request" << std::endl;
+ ::testing::GTEST_FLAG(filter) = "SmokeTest.*";
+ }
testing::InitGoogleTest(&argc, argv);
testing::AddGlobalTestEnvironment(
new common_installer::SmokeEnvironment(request_mode));