#include <gtest/gtest.h>
#include <gtest/gtest-death-test.h>
+#include <manifest_parser/utils/version_number.h>
+
#include <pkgmgr-info.h>
#include <signal.h>
#include <unistd.h>
return CallBackend(SIZEOFARRAY(argv), argv, type, mode);
}
+ci::AppInstaller::Result ManifestDirectInstall(const std::string& pkgid,
+ PackageType type,
+ RequestResult mode) {
+ const char* argv[] = {"", "-y", pkgid.c_str(), "-u", kTestUserIdStr.c_str()};
+ return CallBackend(SIZEOFARRAY(argv), argv, type, mode);
+}
+
namespace {
boost::filesystem::path GetTrashPath(const boost::filesystem::path& path) {
void UninstallAllSmokeApps(ci::RequestMode request_mode) {
std::cout << "Uninstalling all smoke apps" << std::endl;
+ bf::path apps_rw = ci::GetRootAppPath(false, kTestUserId);
+ UninstallAllAppsInDirectory(apps_rw, false);
if (getuid() == 0 && request_mode == ci::RequestMode::GLOBAL) {
bf::path root_path = kPreloadApps;
UninstallAllAppsInDirectory(root_path, true);
}
- bf::path apps_rw = ci::GetRootAppPath(false, kTestUserId);
- UninstallAllAppsInDirectory(apps_rw, false);
+}
+
+int GetAppInstalledTime(const char *appid, uid_t uid)
+{
+ int ret = 0;
+ int installed_time = 0;
+ pkgmgrinfo_appinfo_h handle = NULL;
+ ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, uid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return -1;
+ }
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return installed_time;
}