TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
+ bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
std::string test_uid_str = std::to_string(params.test_user.uid);
tpk_backend.Kill();
if (tpk_backend.Wait() == 9) {
- std::string pkgid = "smokeapp15";
+ std::string pkgid = "recoverypkg";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Update) {
- std::string pkgid = "smokeapp16";
+ std::string pkgid = "recoverypkg";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ci::PkgQuery::Instance().GetResult(pkgid, params.test_user.uid, true);
- bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_Tpk_Update_2.tpk";
+ bf::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ bf::path path_new = kSmokePackagesDirectory / "RecoveryPkg2.tpk";
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
std::string test_uid_str = std::to_string(params.test_user.uid);
tpk_backend.Kill();
if (tpk_backend.Wait() == 9) {
- std::string appid = "smokeapp16.RecoveryModeTpkUpdate";
- std::string exec = "native";
+ std::string appid = "recoverypkg";
+ std::string exec = "recoverypkg";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "1\n", params));
+ ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1\n", params));
} else {
std::cout << "update finished before process killed" << std::endl;
}
}
TEST_F(SmokeTest, RecoveryMode_ForDelta) {
- std::string pkgid = "smoketpk35";
+ std::string pkgid = "recoverypkg";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ci::PkgQuery::Instance().GetResult(pkgid, params.test_user.uid, true);
- bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.tpk";
- bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+ bf::path path_old = kSmokePackagesDirectory / "RecoveryPkg.tpk";
+ bf::path path_new = kSmokePackagesDirectory / "RecoveryPkg.delta";
ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
std::string test_uid_str = std::to_string(params.test_user.uid);
tpk_backend.Kill();
if (tpk_backend.Wait() == 9) {
- std::string appid = "smoketpk35.RecoveryMode_ForDelta";
- std::string exec = "smoketpk35";
+ std::string appid = "recoverypkg";
+ std::string exec = "recoverypkg";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
ASSERT_FALSE(recovery_file.empty());
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Recover(recovery_file));
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
- ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/MODIFIED", "version 1",
+ ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1\n",
params));
ASSERT_TRUE(bf::exists(root_path / pkgid / "res/DELETED"));
ASSERT_FALSE(bf::exists(root_path / pkgid / "res/ADDED"));
TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
- bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.tpk";
+ bf::path path = kSmokePackagesDirectory / "RecoveryPkg.tpk";
ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
std::string test_uid_str = std::to_string(params.test_user.uid);
tpk_backend.Kill();
if (tpk_backend.Wait() == 9) {
- std::string pkgid = "smoketpk37";
+ std::string pkgid = "recoverypkg";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
}
TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
- std::string pkgid = "smoketpk38";
+ std::string pkgid = "recoverypkg";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
ci::PkgQuery::Instance().GetResult(pkgid, params.test_user.uid, true);
bf::path path_old =
- kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate.tpk";
+ kSmokePackagesDirectory / "RecoveryPkg.tpk";
bf::path path_new =
- kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate2.tpk";
+ kSmokePackagesDirectory / "RecoveryPkg2.tpk";
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(path_old));
ci::Subprocess tpk_backend("/usr/bin/tpk-backend");
std::string test_uid_str = std::to_string(params.test_user.uid);
tpk_backend.Kill();
if (tpk_backend.Wait() == 9) {
- std::string appid = "smoketpk38.RecoveryMode_ForMountUpdate";
- std::string exec = "smoketpk38";
+ std::string appid = "recoverypkg";
+ std::string exec = "recoverypkg";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ScopedTzipInterface interface(pkgid, params.test_user.uid);
ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
- "res/VERSION", "1", params));
+ "res/VERSION", "1\n", params));
} else {
std::cout << "mount update finished before process killed" << std::endl;
}
snprintf(buf[gtest_argv.size()], kBufSize,
"--gtest_repeat=%d", repeat_count);
gtest_argv.push_back(buf[gtest_argv.size()]);
+ snprintf(buf[gtest_argv.size()], kBufSize, "--gtest_break_on_failure");
+ gtest_argv.push_back(buf[gtest_argv.size()]);
}
gtest_argv.push_back(nullptr);
int gtest_argc = gtest_argv.size();