X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=test%2Fsmoke_tests%2Fcommon%2Fsmoke_utils.h;h=9e1369b551e384619db051f7cfea11fc734d575a;hb=e093285525c7487daa705daf24e422331c46a3df;hp=94f75690085fc570f7c1673740fa7e7e53cae882;hpb=7dc3ecb0ac8498551c6668ffa154155751bcdb59;p=platform%2Fcore%2Fappfw%2Fapp-installers.git diff --git a/test/smoke_tests/common/smoke_utils.h b/test/smoke_tests/common/smoke_utils.h index 94f7569..9e1369b 100644 --- a/test/smoke_tests/common/smoke_utils.h +++ b/test/smoke_tests/common/smoke_utils.h @@ -152,6 +152,31 @@ struct TestParameters { User test_user; }; +class FileInfoCollector { + public: + using FileInfo = std::tuple; + + FileInfoCollector(std::string pkgid, TestParameters params) : + pkgid_(pkgid), params_(params) {} + bool FileInfoToFile(const bf::path& path) const; + bool Init(); + bool IsEqual(const FileInfoCollector& collector, + const std::vector* exception_list = nullptr) const; + bool LoadFromFile(const bf::path& path); + + private: + void AddPath(const bf::path& path); + bool CollectFileInfoRecursive(); + bool GetFileListTraversal(const bf::path& cur); + std::string FileInfoToString(const FileInfo& file_info) const; + + std::string pkgid_; + TestParameters params_; + std::vector root_paths_; + std::vector FileInfos_; +}; + struct PackageAttributes { explicit PackageAttributes(common_installer::PkgQueryInterface pi) : is_global(pi.IsGlobalPackage()), is_readonly(pi.IsReadonlyPackage()), @@ -180,7 +205,8 @@ common_installer::RequestMode ParseRequestMode(int argc, char** argv); bool TouchFile(const boost::filesystem::path& path); -void AddDataFiles(const std::string& pkgid, uid_t uid); +void AddDataFiles(const std::string& pkgid, uid_t uid, + std::vector* result = nullptr); bool AddTestUser(User* test_user); @@ -402,6 +428,9 @@ class StepCrash : public common_installer::Step { CrashStepType type_; }; +bool CompareFileInfo(const std::string& pkgid, const TestParameters& params, + const bf::path& file); + } // namespace smoke_test #endif // TEST_SMOKE_TESTS_COMMON_SMOKE_UTILS_H_