class SmokeTest : public testing::Test {
public:
- SmokeTest() : params{PackageType::TPK, false} {
+ SmokeTest() : backend(std::to_string(env->test_user.uid)),
+ params{PackageType::TPK, false} {
params.test_user.uid = env->test_user.uid;
params.test_user.gid = env->test_user.gid;
}
protected:
- UnifiedSmokeTestHelperRunner backend;
+ UnifiedBackendInterface backend;
TestParameters params;
};
};
int wait_time = delay + interval * test_count;
- SmokeTestHelperRunner::Result ret = backend.InstallPkgsWithSubprocessAndKill(
- paths, params.test_user.uid, wait_time);
- if (ret == SmokeTestHelperRunner::Result::SUCCESS) {
+ BackendInterface::SubProcessResult ret =
+ backend.InstallPkgsWithSubprocessAndKill(paths, wait_time);
+ if (ret == BackendInterface::SubProcessResult::SUCCESS) {
std::cout << "install finished before process killed" << std::endl;
return;
}
- ASSERT_EQ(ret, SmokeTestHelperRunner::Result::KILLED);
+ ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
bf::path recovery_file = FindRecoveryFile("/unified-recovery",
params.test_user.uid);
return;
}
ASSERT_EQ(
- backend.RecoveryPkgsWithSubprocess(recovery_list, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.RecoverPkgsWithSubprocess(recovery_list),
+ BackendInterface::SubProcessResult::SUCCESS);
if (recovery_info.GetCleanUp()) {
params.pkg_type = PackageType::TPK;
ASSERT_TRUE(ValidatePackage(pkgids.at(0), app_infos.at(0), params));
params.pkg_type = PackageType::HYBRID;
ASSERT_TRUE(ValidatePackage(pkgids.at(2), app_infos.at(2), params));
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(0), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(0)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(1), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(1)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(2), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(2)),
+ BackendInterface::SubProcessResult::SUCCESS);
} else {
params.pkg_type = PackageType::TPK;
ASSERT_TRUE(CheckPackageNonExistance(pkgids.at(0), params));
};
int wait_time = delay + interval * test_count;
- ASSERT_EQ(backend.InstallPkgsWithSubprocess(paths_old, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ ASSERT_EQ(backend.InstallPkgsWithSubprocess(paths_old),
+ BackendInterface::SubProcessResult::SUCCESS);
- SmokeTestHelperRunner::Result ret = backend.InstallPkgsWithSubprocessAndKill(
- paths_new, params.test_user.uid, wait_time);
- if (ret == SmokeTestHelperRunner::Result::SUCCESS) {
+ BackendInterface::SubProcessResult ret =
+ backend.InstallPkgsWithSubprocessAndKill(paths_new, wait_time);
+ if (ret == BackendInterface::SubProcessResult::SUCCESS) {
std::cout << "update finished before process killed" << std::endl;
return;
}
- ASSERT_EQ(ret, SmokeTestHelperRunner::Result::KILLED);
+ ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
bf::path recovery_file = FindRecoveryFile("/unified-recovery",
params.test_user.uid);
}
ASSERT_EQ(
- backend.RecoveryPkgsWithSubprocess(recovery_list, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.RecoverPkgsWithSubprocess(recovery_list),
+ BackendInterface::SubProcessResult::SUCCESS);
if (recovery_info.GetCleanUp()) {
params.pkg_type = PackageType::TPK;
ASSERT_TRUE(ValidatePackage(pkgids.at(0), app_infos.at(0), params));
pkgids.at(2), "res/wgt/VERSION", "1", params));
}
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(0), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(0)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(1), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(1)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(2), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(2)),
+ BackendInterface::SubProcessResult::SUCCESS);
}
TEST_F(SmokeTest, RecoveryMode_ForDelta) {
};
int wait_time = delay + interval * test_count;
- ASSERT_EQ(backend.InstallPkgsWithSubprocess(paths_old, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ ASSERT_EQ(backend.InstallPkgsWithSubprocess(paths_old),
+ BackendInterface::SubProcessResult::SUCCESS);
- SmokeTestHelperRunner::Result ret = backend.InstallPkgsWithSubprocessAndKill(
- paths_new, params.test_user.uid, wait_time);
- if (ret == SmokeTestHelperRunner::Result::SUCCESS) {
+ BackendInterface::SubProcessResult ret =
+ backend.InstallPkgsWithSubprocessAndKill(paths_new, wait_time);
+ if (ret == BackendInterface::SubProcessResult::SUCCESS) {
std::cout << "delta finished before process killed" << std::endl;
return;
}
- ASSERT_EQ(ret, SmokeTestHelperRunner::Result::KILLED);
+ ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
bf::path recovery_file = FindRecoveryFile("/unified-recovery",
params.test_user.uid);
}
ASSERT_EQ(
- backend.RecoveryPkgsWithSubprocess(recovery_list, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.RecoverPkgsWithSubprocess(recovery_list),
+ BackendInterface::SubProcessResult::SUCCESS);
if (recovery_info.GetCleanUp()) {
params.pkg_type = PackageType::TPK;
ASSERT_TRUE(ValidatePackage(pkgids.at(0), app_infos.at(0), params));
pkgids.at(2), "res/wgt/VERSION", "1", params));
}
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(0), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(0)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(1), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(1)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(2), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(2)),
+ BackendInterface::SubProcessResult::SUCCESS);
}
TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
};
int wait_time = delay + interval * test_count;
- SmokeTestHelperRunner::Result ret =
- backend.MountInstallPkgsWithSubprocessAndKill(
- paths, params.test_user.uid, wait_time);
- if (ret == SmokeTestHelperRunner::Result::SUCCESS) {
+ BackendInterface::SubProcessResult ret =
+ backend.MountInstallPkgsWithSubprocessAndKill(paths, wait_time);
+ if (ret == BackendInterface::SubProcessResult::SUCCESS) {
std::cout << "install finished before process killed" << std::endl;
return;
}
- ASSERT_EQ(ret, SmokeTestHelperRunner::Result::KILLED);
+ ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
bf::path recovery_file = FindRecoveryFile("/unified-recovery",
params.test_user.uid);
return;
}
ASSERT_EQ(
- backend.RecoveryPkgsWithSubprocess(recovery_list, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.RecoverPkgsWithSubprocess(recovery_list),
+ BackendInterface::SubProcessResult::SUCCESS);
if (recovery_info.GetCleanUp()) {
params.pkg_type = PackageType::TPK;
ASSERT_TRUE(ValidatePackage(pkgids.at(0), app_infos.at(0), params));
params.pkg_type = PackageType::HYBRID;
ASSERT_TRUE(ValidatePackage(pkgids.at(2), app_infos.at(2), params));
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(0), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(0)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(1), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(1)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(2), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(2)),
+ BackendInterface::SubProcessResult::SUCCESS);
} else {
params.pkg_type = PackageType::TPK;
ASSERT_TRUE(CheckPackageNonExistance(pkgids.at(0), params));
int wait_time = delay + interval * test_count;
ASSERT_EQ(backend.
- MountInstallPkgsWithSubprocess(paths_old, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ MountInstallPkgsWithSubprocess(paths_old),
+ BackendInterface::SubProcessResult::SUCCESS);
- SmokeTestHelperRunner::Result ret =
- backend.MountInstallPkgsWithSubprocessAndKill(
- paths_new, params.test_user.uid, wait_time);
- if (ret == SmokeTestHelperRunner::Result::SUCCESS) {
+ BackendInterface::SubProcessResult ret =
+ backend.MountInstallPkgsWithSubprocessAndKill(paths_new, wait_time);
+ if (ret == BackendInterface::SubProcessResult::SUCCESS) {
std::cout << "update finished before process killed" << std::endl;
return;
}
- ASSERT_EQ(ret, SmokeTestHelperRunner::Result::KILLED);
+ ASSERT_EQ(ret, BackendInterface::SubProcessResult::KILLED);
bf::path recovery_file = FindRecoveryFile("/unified-recovery",
params.test_user.uid);
}
ASSERT_EQ(
- backend.RecoveryPkgsWithSubprocess(recovery_list, params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.RecoverPkgsWithSubprocess(recovery_list),
+ BackendInterface::SubProcessResult::SUCCESS);
ScopedTzipInterface interface_1(pkgids.at(0), params.test_user.uid);
ScopedTzipInterface interface_2(pkgids.at(1), params.test_user.uid);
}
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(0), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(0)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(1), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(1)),
+ BackendInterface::SubProcessResult::SUCCESS);
ASSERT_EQ(
- backend.UninstallWithSubprocess(pkgids.at(2), params.test_user.uid),
- SmokeTestHelperRunner::Result::SUCCESS);
+ backend.UninstallWithSubprocess(pkgids.at(2)),
+ BackendInterface::SubProcessResult::SUCCESS);
}
} // namespace smoke_test