"I'm a product
Of my environment
So don't blame me, I just work here"
- Offspring, "Americana"
Tests mimic application installation by altering sqlite DB manually.
This however, leaves pkginfo-server daemons' internal cache in bad state,
not maching the DB, effectively making changes not visible to its clients.
This patch is an obscene attempt to fix this terrible issue by killig
that daemon after completing the DB modiffications.
With this change, unit tests should all pass again (6 were failing before).
Proper solution to the problem would probably require installing regular
small applications in place of mimicking their installation, which
would be a much, much bigger and time-costly refactoring.
Also, added more debug information.
Change-Id: I826bde1e56001d87ddbaeee5efe4f03ade32db42
pkgmgrinfo_pkginfo_h handle = NULL;
ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &handle);
if (ret != PMINFO_R_OK) {
- LOGE("failed to get pkginfo handle! pkgid <%s>", pkgid);
+ LOGE("failed to get pkginfo handle! pkgid <%s>, <%d>", pkgid, ret);
return -1;
}
ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
if (ret != 0)
printf_red("failed to set pkg info. ret = %d\n", ret);
+ ret = system("systemctl restart pkgmgr-info");
+ if (ret != 0)
+ printf_red("failed to reload pkgmgr-info");
}
void __unset_privacy_test_pkg_info()
if (ret != 0)
printf_red("failed to unset pkg info\n");
+ ret = system("systemctl restart pkgmgr-info");
+ if (ret != 0)
+ printf_red("failed to reload pkgmgr-info");
}
/* error enum to string */