"DeltaMode_Tpk_Rollback.delta";
std::string pkgid = "smoketpk28";
std::string appid = "smoketpk28.DeltaModeTpk_Rollback";
+ std::string exec = "basicdali";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] =
{"", "-i", delta_package.c_str(), "-u", test_uid_str.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"basicdali"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check delta modifications
TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
bf::path path = kSmokePackagesDirectory / "RecoveryMode_Tpk_Installation.tpk";
std::string pkgid = "smokeapp15";
- std::string appid = "smokeapp15.RecoveryModeTpkInstallation";
RemoveAllRecoveryFiles("/tpk-recovery", params.test_user.uid);
std::string test_uid_str = std::to_string(params.test_user.uid);
if (step >= 1) {
std::string pkgid = "smokeapp16";
std::string appid = "smokeapp16.RecoveryModeTpkUpdate";
+ std::string exec = "native";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(
ValidateFileContentInPackage(pkgid, "VERSION", "1\n", params));
std::string number = std::to_string(50 + NUMBER - 1); \
std::string pkgid = std::string("smokeapp") + number; \
std::string appid = pkgid + ".TEP"; \
+ std::string exec = "native"; \
TEST_F(SmokeTest, TEP_Tpk_TepInstallTepUpdateRollback) {
const char* argv[] = {"", "-i", path.c_str(), "-u", test_uid_str.c_str(),
"-e", tep1.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"tep/tep1.tep", "tep1\n", params));
return true;
const char* argv[] = {"", "-i", path.c_str(), "-u", test_uid_str.c_str(),
"-e", tep1.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] = {"", "-i", path.c_str(), "-u", test_uid_str.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"tep/tep1.tep", "tep1\n", params));
return true;
"-e", tep2.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"tep/tep1.tep", "tep1\n", params));
return true;
"-e", tep1.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
const char* argv[] = {"", "-i", path.c_str(), "-u", test_uid_str.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"tep/tep1.tep", "tep1\n", params));
return true;
TEST_F(SmokeTest, InstallationMode_Rollback) {
bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk34";
- std::string appid = "smoketpk34.InstallationMode_Rollback";
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] = {"", "-i", path.c_str(), "-u", test_uid_str.c_str()};
if (step >= 1) {
std::string pkgid = "smoketpk35";
std::string appid = "smoketpk35.RecoveryMode_ForDelta";
+ std::string exec = "smoketpk35";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
EXTENDED_ASSERT_FALSE(recovery_file.empty());
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk35"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(
ValidateFileContentInPackage(pkgid, "res/MODIFIED", "version 1",
bf::path new_path = kSmokePackagesDirectory / "UpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk36";
std::string appid = "smoketpk36.UpdateMode_Rollback";
+ std::string exec = "smoketpk36";
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Install(old_path));
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] =
{"", "-i", new_path.c_str(), "-u", test_uid_str.c_str()};
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk36"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"res/VERSION", "1", params));
return true;
if (step >= 1) {
std::string pkgid = "smoketpk38";
std::string appid = "smoketpk38.RecoveryMode_ForMountUpdate";
+ std::string exec = "smoketpk38";
// Filesystem may be mounted after crash
ScopedTzipInterface poweroff_unmount_interface(pkgid,
EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
ci::AppInstaller::Result::OK);
ScopedTzipInterface interface(pkgid, params.test_user.uid);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk38"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"res/VERSION", "1", params));
bf::path path =
kSmokePackagesDirectory / "MountInstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk39";
- std::string appid = "smoketpk39.MountInstallationMode_Rollback";
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] = {"", "-w", path.c_str(), "-u", test_uid_str.c_str()};
bf::path new_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk40";
std::string appid = "smoketpk40.MountUpdateMode_Rollback";
+ std::string exec = "smoketpk40";
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.MountInstall(old_path));
std::string test_uid_str = std::to_string(params.test_user.uid);
const char* argv[] =
backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk40"}, params));
+ EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"res/VERSION", "1", params));
return true;
bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Tpk.delta";
std::string pkgid = "smokeapp18";
std::string appid = "smokeapp18.DeltaModeTpk";
+ std::string exec = "native";
ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check delta modifications
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
"DeltaMode_Tpk_Rollback.delta";
std::string pkgid = "smoketpk28";
std::string appid = "smoketpk28.DeltaModeTpk_Rollback";
+ std::string exec = "basicdali";
ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::ERROR);
- ASSERT_TRUE(ValidatePackage(pkgid, {"basicdali"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check delta modifications
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
bf::path rds_directory = kSmokePackagesDirectory / "delta_dir";
std::string pkgid = "smokeapp25";
std::string appid = "smokeapp25.ReinstallModeTpk";
+ std::string exec = "native";
bf::path sdk_expected_directory = kSdkDirectory / "tmp" / pkgid;
ASSERT_TRUE(ci::CopyDir(rds_directory, sdk_expected_directory));
ASSERT_EQ(backend.RDSUpdate(path, pkgid), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
// Check rds modifications
bf::path root_path = ci::GetRootAppPath(false,
bf::path path = kSmokePackagesDirectory / "InstallationMode_Tpk.tpk";
std::string pkgid = "smokeapp12";
std::string appid = "smokeapp12.InstallationModeTpk";
+ std::string exec = "native";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
}
TEST_F(SmokeTest, UpdateMode_Tpk) {
bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Tpk_2.tpk";
std::string pkgid = "smokeapp13";
std::string appid = "smokeapp13.UpdateModeTpk";
+ std::string exec = "native";
ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "2\n", params));
}
TEST_F(SmokeTest, DeinstallationMode_Tpk) {
bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Tpk.tpk";
std::string pkgid = "smokeapp14";
- std::string appid = "smokeapp14.DeinstallationModeTpk";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK);
ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
bf::path path = kSmokePackagesDirectory / "DisablePkg.tpk";
std::string pkgid = "smokeapp23";
std::string appid = "smokeapp23.DisablePkg";
+ std::string exec = "=disablepkg";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.DisablePackage(pkgid), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ci::QueryIsDisabledPackage(pkgid, params.test_user.uid));
- ASSERT_TRUE(ValidatePackage(pkgid, {"=disablepkg"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
}
TEST_F(SmokeTest, RecoveryMode_Tpk_Installation) {
ASSERT_NE(backend_crash.Wait(), 0);
std::string pkgid = "smokeapp15";
- std::string appid = "smokeapp15.RecoveryModeTpkInstallation";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::string pkgid = "smokeapp16";
std::string appid = "smokeapp16.RecoveryModeTpkUpdate";
+ std::string exec = "native";
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, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "1\n", params));
}
bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Tpk.tpk";
std::string pkgid = "smokeapp26";
std::string appid = "smokeapp26.MountInstallationModeTpk";
+ std::string exec = "native";
ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
}
TEST_F(SmokeTest, MountUpdateMode_Tpk) {
bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Tpk_2.tpk";
std::string pkgid = "smokeapp27";
std::string appid = "smokeapp27.MountUpdateModeTpk";
+ std::string exec = "native";
ASSERT_EQ(backend.MountInstallSuccess(path_old),
ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::OK);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "2\n",
params));
bf::path path = kSmokePackagesDirectory / "InstallExternal_Tpk_2.tpk";
std::string pkgid = "smokeapp28";
std::string appid = "smokeapp28.InstallExternalTpk";
+ std::string exec = "smokeapp28";
bf::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir;
std::string test_uid_str = std::to_string(params.test_user.uid);
if (test_uid_str == kDefaultUserIdStr ||
params.test_user.uid == kGlobalUserUid) {
ASSERT_EQ(backend.MigrateLegacyExternalImage(pkgid, path, legacy_path),
ci::AppInstaller::Result::OK);
- ValidateExternalPackage(pkgid, {"smokeapp28"}, params);
+ ValidateExternalPackage(pkgid, {appid, exec}, params);
} else {
ASSERT_EQ(backend.MigrateLegacyExternalImage(pkgid, path, legacy_path),
ci::AppInstaller::Result::ERROR);
bf::path path = kSmokePackagesDirectory / "InstallExternal_Tpk.tpk";
std::string pkgid = "smokeapp29";
std::string appid = "smokeapp29.InstallExternalTpk";
+ std::string exec = "smokeapp29";
ASSERT_EQ(backend.InstallWithStorage(path, StorageType::EXTERNAL),
ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidateExternalPackage(pkgid, {"smokeapp29"}, params));
+ ASSERT_TRUE(ValidateExternalPackage(pkgid, {appid, exec}, params));
}
#define TEP_TEST_STARTING_BLOCK(NUMBER) \
std::string number = std::to_string(50 + NUMBER - 1); \
std::string pkgid = std::string("smokeapp") + number; \
std::string appid = pkgid + ".TEP"; \
+ std::string exec = "native"; \
TEST_F(SmokeTest, TEP_Tpk_TepInstall) {
TEP_TEST_STARTING_BLOCK(1)
ASSERT_EQ(backend.InstallWithTEP(path, tep1), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
TEP_TEST_STARTING_BLOCK(2)
ASSERT_EQ(backend.InstallWithTEP(path, tep1), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.InstallWithTEP(path, tep2), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep2.tep", "tep2\n",
params));
}
TEP_TEST_STARTING_BLOCK(3)
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.InstallWithTEP(path, tep2), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep2.tep", "tep2\n",
params));
}
TEP_TEST_STARTING_BLOCK(4)
ASSERT_EQ(backend.InstallWithTEP(path, tep1), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.InstallWithTEP(path, tep2),
ci::AppInstaller::Result::ERROR);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.InstallWithTEP(path, tep2),
ci::AppInstaller::Result::ERROR);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
ASSERT_EQ(backend.InstallSuccessWithTEP(path, tep1),
ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
ASSERT_EQ(backend.MountInstallWithTEP(path, tep1),
ci::AppInstaller::Result::OK);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
ASSERT_EQ(backend.MountInstallWithTEP(path, tep2),
ci::AppInstaller::Result::OK);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep2.tep", "tep2\n",
params));
}
ASSERT_EQ(backend.MountInstallWithTEP(path, tep2),
ci::AppInstaller::Result::OK);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep2.tep", "tep2\n",
params));
}
ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
ASSERT_EQ(backend.MountInstallWithTEP(path, tep2),
ci::AppInstaller::Result::ERROR);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
ASSERT_EQ(backend.MountInstallWithTEP(path, tep2),
ci::AppInstaller::Result::ERROR);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
bf::path root_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
bf::path tep_file = root_path / pkgid / "tep" / "tep2.tep";
ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::ERROR);
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "tep/tep1.tep", "tep1\n",
params));
}
bf::path path = kSmokePackagesDirectory / "InstallationMode_Preload.tpk";
std::string pkgid = "smoketpk29";
std::string appid = "smoketpk29.InstallationModePreload";
+ std::string exec = "native";
ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
}
TEST_F(PreloadSmokeTest, UpdateMode_Preload) {
bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.tpk";
std::string pkgid = "smoketpk30";
std::string appid = "smoketpk30.UpdateModePreload";
+ std::string exec = "native";
ASSERT_EQ(backend.InstallPreload(path_old), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.InstallPreload(path_new), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"native"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "2", params));
}
ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.tpk";
std::string pkgid = "smoketpk31";
- std::string appid = "smoketpk31.DeinstallationModePreload";
ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.UninstallPreload(pkgid), ci::AppInstaller::Result::OK);
CheckPackageNonExistance(pkgid, params);
TEST_F(RollbackSmokeTest, InstallationMode_Rollback) {
bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk34";
- std::string appid = "smoketpk34.InstallationMode_Rollback";
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.Install(path));
ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
}
std::string pkgid = "smoketpk35";
std::string appid = "smoketpk35.RecoveryMode_ForDelta";
+ std::string exec = "smoketpk35";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Recover(recovery_file));
- ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk35"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/MODIFIED", "version 1",
params));
bf::path new_path = kSmokePackagesDirectory / "UpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk36";
std::string appid = "smoketpk36.UpdateMode_Rollback";
+ std::string exec = "smoketpk36";
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.InstallSuccess(old_path));
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.Install(new_path));
- ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk36"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1",
params));
ASSERT_NE(0, backend_crash.Wait());
std::string pkgid = "smoketpk37";
- std::string appid = "smoketpk37.RecoveryMode_ForMountInstall";
bf::path recovery_file = FindRecoveryFile("/tpk-recovery",
params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
std::string pkgid = "smoketpk38";
std::string appid = "smoketpk38.RecoveryMode_ForMountUpdate";
+ std::string exec = "smoketpk38";
// Filesystem may be mounted after crash
ScopedTzipInterface poweroff_unmount_interface(pkgid, params.test_user.uid);
ASSERT_FALSE(recovery_file.empty());
ASSERT_EQ(ci::AppInstaller::Result::OK, backend.Recover(recovery_file));
ScopedTzipInterface interface(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk38"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1", params));
}
bf::path path =
kSmokePackagesDirectory / "MountInstallationMode_Rollback.tpk";
std::string pkgid = "smoketpk39";
- std::string appid = "smoketpk39.MountInstallationMode_Rollback";
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.MountInstall(path));
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
bf::path new_path = kSmokePackagesDirectory / "MountUpdateMode_Rollback2.tpk";
std::string pkgid = "smoketpk40";
std::string appid = "smoketpk40.MountUpdateMode_Rollback";
+ std::string exec = "smoketpk40";
ASSERT_EQ(ci::AppInstaller::Result::OK,
backend.MountInstallSuccess(old_path));
ASSERT_EQ(ci::AppInstaller::Result::ERROR, backend.MountInstall(new_path));
ScopedTzipInterface package_mount(pkgid, params.test_user.uid);
- ASSERT_TRUE(ValidatePackage(pkgid, {"smoketpk40"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/VERSION", "1", params));
}
bf::path src_path = kSmokePackagesDirectory / "ManifestDirectInstallMode";
std::string pkgid = "smoketpk41";
std::string appid = "smoketpk41.ManifestDirectInstallMode";
+ std::string exec = "basicui";
bf::path pkg_path = ci::GetRootAppPath(params.is_readonly,
params.test_user.uid);
ASSERT_FALSE(pkg_query.IsPackageInstalled(
ci::GetRequestMode(params.test_user.uid)));
ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidatePackage(pkgid, {"basicui"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
}
TEST_F(SmokeTest, ManifestDirectUpdateMode) {
bf::path path = kSmokePackagesDirectory / "ManifestDirectUpdateMode.tpk";
std::string pkgid = "smoketpk42";
std::string appid = "smoketpk42.ManifestDirectUpdateMode";
+ std::string exec = "basicui";
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid);
ASSERT_TRUE(GetAppInstalledTime(appid.c_str(),
params.test_user.uid) > install_time)
<< "Package is not updated (app installed time didn't change).";
- ASSERT_TRUE(ValidatePackage(pkgid, {"basicui"}, params));
+ ASSERT_TRUE(ValidatePackage(pkgid, {appid, exec}, params));
}
TEST_F(PreloadSmokeTest, ReadonlyUpdateInstallMode) {
bf::path path = kSmokePackagesDirectory / "ReadonlyUpdateInstallMode.tpk";
std::string pkgid = "smoketpk43";
std::string appid = "smoketpk43.ReadonlyUpdateInstallMode";
+ std::string exec = "basicui";
ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
- ValidatePackage(pkgid, {"basicui"}, params);
+ ValidatePackage(pkgid, {appid, exec}, params);
TestParameters nonreadonly_params(params);
nonreadonly_params.is_readonly = false;
- ValidatePackage(pkgid, {"basicui"}, nonreadonly_params);
+ ValidatePackage(pkgid, {appid, exec}, nonreadonly_params);
}
TEST_F(PreloadSmokeTest, ReadonlyUpdateUninstallMode) {
ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
- ValidatePackage(pkgid, {exec}, params);
+ ValidatePackage(pkgid, {appid, exec}, params);
TestParameters nonreadonly_params(params);
nonreadonly_params.is_readonly = false;
- ValidatePackage(pkgid, {exec}, nonreadonly_params);
+ ValidatePackage(pkgid, {appid, exec}, nonreadonly_params);
ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK);
- ValidatePackage(pkgid, {exec}, params);
+ ValidatePackage(pkgid, {appid, exec}, params);
}
TEST_F(SmokeTest, InstallExtended_Tpk) {
bf::path path = kSmokePackagesDirectory / "InstallExtended_Tpk.tpk";
std::string pkgid = "smoketpk45";
std::string appid = "smoketpk45.InstallExtendedTpk";
+ std::string exec = "smoketpk45.InstallExtendedTpk";
ASSERT_EQ(backend.InstallWithStorage(path, StorageType::EXTENDED),
ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ValidateExtendedPackage(pkgid, {appid}, params));
+ ASSERT_TRUE(ValidateExtendedPackage(pkgid, {appid, exec}, params));
}
} // namespace smoke_test