Add "System" exec label to extensive smoke test.
Small fixes for RecoveryMode_ForDelta and MigrateLegacyExternalImageMode.
Change-Id: I5e342a9e397e5c0ce72680037b1dcb667828c1e3
<assign>
<filesystem path="/usr/bin/wgt-backend-ut/smoke-test" exec_label="System" />
<filesystem path="/usr/bin/wgt-backend-ut/smoke-test-helper" exec_label="System" />
+ <filesystem path="/usr/bin/wgt-backend-ut/extensive-smoke-test" exec_label="System" />
</assign>
</manifest>
bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
std::string pkgid = "smokewgt30";
std::string appid = "smokewgt30.RecoveryModeForDelta";
- bf::path recovery_file = FindRecoveryFile();
RemoveAllRecoveryFiles();
+ ASSERT_EQ(Install(path_old, PackageType::WGT), ci::AppInstaller::Result::OK);
+ AddDataFiles(pkgid, kTestUserId);
std::vector<std::string> args =
{"", "-i", path_new.string(), "-u", kTestUserIdStr.c_str()};
CrashAfterEachStep(args, [=](int step) -> bool {
if (step >= 1) {
+ bf::path recovery_file = FindRecoveryFile();
EXTENDED_ASSERT_FALSE(recovery_file.empty());
EXTENDED_ASSERT_EQ(Recover(recovery_file, PackageType::WGT),
ci::AppInstaller::Result::OK);
EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
"res/wgt/VERSION", "1\n"));
+ EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, kTestUserId));
}
return true;
});
std::string pkgid = "smokewgt36";
std::string appid = "smokewgt36.web";
bf::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir;
- ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path,
- PackageType::WGT), ci::AppInstaller::Result::OK);
- ValidateExternalPackage(pkgid, {appid});
+ if (kTestUserIdStr == kDefaultUserIdStr || kTestUserId == kGlobalUserUid) {
+ ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path,
+ PackageType::WGT), ci::AppInstaller::Result::OK);
+ ValidateExternalPackage(pkgid, {appid});
+ } else {
+ ASSERT_EQ(MigrateLegacyExternalImage(pkgid, path, legacy_path,
+ PackageType::WGT), ci::AppInstaller::Result::ERROR);
+ }
}
TEST_F(PreloadSmokeTest, InstallationMode_Preload) {
return ci::AppInstaller::Result::ERROR;
}
const char* argv[] = {"", "--migrate-extimg", pkgid.c_str(),
- "-u", kDefaultUserIdStr.c_str()};
+ "-u", kTestUserIdStr.c_str()};
return CallBackend(SIZEOFARRAY(argv), argv, type, mode);
}