Add functions to create pkg parser/cert db 66/256566/3
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 7 Apr 2021 07:20:42 +0000 (16:20 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 28 May 2021 06:32:58 +0000 (06:32 +0000)
Database files will not be created automatically.

Change-Id: Ib3c0c1fd477210d8892964041b7e4328942e6cbc
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
test/smoke_tests/common/smoke_utils.cc
test/smoke_tests/common/smoke_utils.h

index db141c5..21dac7f 100644 (file)
@@ -21,6 +21,8 @@
 #include <common/utils/pkgmgr_query.h>
 #include <common/tzip_interface.h>
 
+#include "pkgmgr_parser_db.h"
+
 #include <list>
 #include <memory>
 #include <string>
@@ -1389,6 +1391,11 @@ bool BackupPath(const bf::path& path) {
   return true;
 }
 
+void CreateDatabase() {
+  pkgmgr_parser_create_and_initialize_db(kGlobalUserUid);
+  pkgmgr_parser_create_and_initialize_db(getuid());
+}
+
 bool RestorePathCopyAndRemove(const bf::path& path) {
   bf::path backup_path = path.string() + ".bck";
   if (!bf::exists(backup_path))
index 628e013..6983566 100644 (file)
@@ -352,6 +352,8 @@ bool BackupPathCopyAndRemove(const boost::filesystem::path& path);
 
 bool BackupPath(const boost::filesystem::path& path);
 
+void CreateDatabase();
+
 bool RestorePathCopyAndRemove(const boost::filesystem::path& path);
 
 bool RestorePath(const boost::filesystem::path& path);