From 65293e11ecbfdd3ccaca1d9fcdb6e6699f0a7761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=87=AF?= Date: Tue, 8 Oct 2024 15:34:52 +0800 Subject: [PATCH] change driver directory to libs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张凯 --- .../include/installd/installd_operator.h | 3 +- .../bundlemgr/src/driver/driver_installer.cpp | 9 ++- .../src/installd/installd_operator.cpp | 45 ++++++--------- .../bms_bundle_install_driver_test.cpp | 55 +++++++++---------- .../bms_install_daemon_operator_test.cpp | 8 +-- .../driver_test/driver_feature10/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- .../driver_test/driver_feature15/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- .../driver_test/driver_feature16/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- .../driver_test/driver_feature17/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- .../driver_test/driver_feature18/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- .../driver_test/driver_feature6/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- .../high_version_driver_feature13/BUILD.gn | 1 + .../feature/src/main/module.json | 2 +- 19 files changed, 71 insertions(+), 70 deletions(-) diff --git a/services/bundlemgr/include/installd/installd_operator.h b/services/bundlemgr/include/installd/installd_operator.h index e30d0c0467..b17b1a7e46 100644 --- a/services/bundlemgr/include/installd/installd_operator.h +++ b/services/bundlemgr/include/installd/installd_operator.h @@ -270,8 +270,7 @@ public: static bool ExtractDriverSoFiles(const std::string &srcPath, const std::unordered_multimap &dirMap); - static bool CopyDriverSoFiles(const BundleExtractor &extractor, const std::string &originalDir, - const std::string &destinedDir); + static bool CopyDriverSoFiles(const std::string &originalDir, const std::string &destinedDir); #if defined(CODE_ENCRYPTION_ENABLE) static ErrCode ExtractSoFilesToTmpHapPath(const std::string &hapPath, const std::string &cpuAbi, diff --git a/services/bundlemgr/src/driver/driver_installer.cpp b/services/bundlemgr/src/driver/driver_installer.cpp index 32b351c736..dfa22e03bc 100644 --- a/services/bundlemgr/src/driver/driver_installer.cpp +++ b/services/bundlemgr/src/driver/driver_installer.cpp @@ -51,6 +51,9 @@ ErrCode DriverInstaller::CopyDriverSoFile(const InnerBundleInfo &info, const std std::unordered_multimap dirMap; // 1. filter driver so files ErrCode result = ERR_OK; + std::string cpuAbi = ""; + std::string nativeLibraryPath = ""; + info.FetchNativeSoAttrs(info.GetCurrentModulePackage(), cpuAbi, nativeLibraryPath); for (const auto &extAbilityInfo : extensionAbilityInfos) { if (extAbilityInfo.second.type != ExtensionAbilityType::DRIVER) { continue; @@ -69,7 +72,11 @@ ErrCode DriverInstaller::CopyDriverSoFile(const InnerBundleInfo &info, const std return ERR_OK; } // 2. copy driver so file to destined dir - return InstalldClient::GetInstance()->ExtractDriverSoFiles(srcPath, dirMap); + std::string realSoDir; + realSoDir.append(Constants::BUNDLE_CODE_DIR).append(ServiceConstants::PATH_SEPARATOR) + .append(info.GetBundleName()).append(ServiceConstants::PATH_SEPARATOR) + .append(nativeLibraryPath); + return InstalldClient::GetInstance()->ExtractDriverSoFiles(realSoDir, dirMap); } ErrCode DriverInstaller::FilterDriverSoFile(const InnerBundleInfo &info, const Metadata &meta, diff --git a/services/bundlemgr/src/installd/installd_operator.cpp b/services/bundlemgr/src/installd/installd_operator.cpp index 34e3c91424..39afdf637f 100644 --- a/services/bundlemgr/src/installd/installd_operator.cpp +++ b/services/bundlemgr/src/installd/installd_operator.cpp @@ -55,6 +55,7 @@ namespace AppExecFwk { namespace { constexpr const char* PREFIX_RESOURCE_PATH = "/resources/rawfile/"; constexpr const char* PREFIX_TARGET_PATH = "/print_service/"; +constexpr const char* PREFIX_LIBS_PATH = "/libs/"; constexpr const char* HQF_DIR_PREFIX = "patch_"; #if defined(CODE_ENCRYPTION_ENABLE) static const char LIB_CODE_CRYPTO_SO_PATH[] = "system/lib/libcode_crypto_metadata_process_utils.z.so"; @@ -66,6 +67,7 @@ static const char CODE_CRYPTO_FUNCTION_NAME[] = "_ZN4OHOS8Security10CodeCrypto15 static constexpr int32_t INSTALLS_UID = 3060; static constexpr int32_t MODE_BASE = 07777; static constexpr int32_t KEY_ID_STEP = 2; +static constexpr int32_t STR_LIBS_LEN = 4; constexpr const char* PROC_MOUNTS_PATH = "/proc/mounts"; constexpr const char* QUOTA_DEVICE_DATA_PATH = "/data"; constexpr const char* CACHE_DIR = "cache"; @@ -1637,40 +1639,29 @@ bool InstalldOperator::ExtractDriverSoFiles(const std::string &srcPath, LOG_E(BMS_TAG_INSTALLD, "ExtractDriverSoFiles parameters are invalid"); return false; } - BundleExtractor extractor(srcPath); - if (!extractor.Init()) { - LOG_E(BMS_TAG_INSTALLD, "extractor init failed"); - return false; - } - - std::vector entryNames; - if (!extractor.GetZipFileNames(entryNames)) { - LOG_E(BMS_TAG_INSTALLD, "GetZipFileNames failed"); - return false; - } for (auto &[originalDir, destinedDir] : dirMap) { if ((originalDir.compare(".") == 0) || (originalDir.compare("..") == 0)) { LOG_E(BMS_TAG_INSTALLD, "the originalDir %{public}s is not existed in the hap", originalDir.c_str()); return false; } - if (!BundleUtil::StartWith(originalDir, PREFIX_RESOURCE_PATH) || + if ((!BundleUtil::StartWith(originalDir, PREFIX_RESOURCE_PATH) && + !BundleUtil::StartWith(originalDir, PREFIX_LIBS_PATH)) || !BundleUtil::StartWith(destinedDir, PREFIX_TARGET_PATH)) { LOG_E(BMS_TAG_INSTALLD, "the originalDir %{public}s and destined dir %{public}s are invalid", originalDir.c_str(), destinedDir.c_str()); return false; } - std::string innerOriginalDir = originalDir; - if (innerOriginalDir.front() == ServiceConstants::PATH_SEPARATOR[0]) { - innerOriginalDir = innerOriginalDir.substr(1); - } - if (find(entryNames.cbegin(), entryNames.cend(), innerOriginalDir) == entryNames.cend()) { - LOG_E(BMS_TAG_INSTALLD, "the innerOriginalDir %{public}s is not existed in the hap", - innerOriginalDir.c_str()); - return false; + std::string fileName = originalDir; + if (fileName.front() == ServiceConstants::PATH_SEPARATOR[0]) { + fileName = fileName.substr(1); } + int fileNamePos = 0; + fileNamePos = fileName.find(ServiceConstants::PATH_SEPARATOR[0], STR_LIBS_LEN + 1); + fileName.erase(0, fileNamePos); + LOG_D(BMS_TAG_INSTALLD, "ExtractDriverSoFiles fileName is %{public}s", fileName.c_str()); std::string systemServiceDir = ServiceConstants::SYSTEM_SERVICE_DIR; - if (!CopyDriverSoFiles(extractor, innerOriginalDir, systemServiceDir + destinedDir)) { + if (!CopyDriverSoFiles(srcPath + fileName, systemServiceDir + destinedDir)) { LOG_E(BMS_TAG_INSTALLD, "CopyDriverSoFiles failed"); return false; } @@ -1679,8 +1670,7 @@ bool InstalldOperator::ExtractDriverSoFiles(const std::string &srcPath, return true; } -bool InstalldOperator::CopyDriverSoFiles(const BundleExtractor &extractor, const std::string &originalDir, - const std::string &destinedDir) +bool InstalldOperator::CopyDriverSoFiles(const std::string &originalDir, const std::string &destinedDir) { LOG_D(BMS_TAG_INSTALLD, "CopyDriverSoFiles beign"); auto pos = destinedDir.rfind(ServiceConstants::PATH_SEPARATOR); @@ -1696,10 +1686,7 @@ bool InstalldOperator::CopyDriverSoFiles(const BundleExtractor &extractor, const } std::string realDestinedDir = realDesDir + destinedDir.substr(pos); LOG_D(BMS_TAG_INSTALLD, "realDestinedDir is %{public}s", realDestinedDir.c_str()); - if (!extractor.ExtractFile(originalDir, realDestinedDir)) { - LOG_E(BMS_TAG_INSTALLD, "ExtractFile failed"); - return false; - } + MoveFile(originalDir, realDestinedDir); struct stat buf = {}; if (stat(realDesDir.c_str(), &buf) != 0) { @@ -1708,8 +1695,10 @@ bool InstalldOperator::CopyDriverSoFiles(const BundleExtractor &extractor, const return false; } ChangeFileAttr(realDestinedDir, buf.st_uid, buf.st_gid); - mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + mode_t mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IROTH; if (!OHOS::ChangeModeFile(realDestinedDir, mode)) { + LOG_E(BMS_TAG_INSTALLD, "ChangeModeFile %{public}s failed, errno: %{public}d", realDestinedDir.c_str(), + errno); return false; } LOG_D(BMS_TAG_INSTALLD, "CopyDriverSoFiles end"); diff --git a/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_install_driver_test.cpp b/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_install_driver_test.cpp index be365b12b3..d15385e0f7 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_install_driver_test.cpp +++ b/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_install_driver_test.cpp @@ -70,8 +70,7 @@ const std::string BUNDLE_DATA_DIR = "/data/app/el2/100/base/com.example.driverTe const std::string BUNDLE_CODE_DIR = "/data/app/el1/bundle/public/com.example.driverTest"; const std::string PACKAGE_NAME_FIRST = "com.example.driverTest"; const std::string DRIVER_FILE_DIR = "/data/service/el1/public/print_service/cups/datadir/model/"; -const std::string DRIVER_FILE_NAME = "main_pages.json"; -const std::string DRIVER_FILE_NAME1 = "main_test_pages.json"; +const std::string DRIVER_FILE_NAME = "libpng.z.so"; const std::string MODULE_NAME_FEATURE6 = "feature6"; const std::string MODULE_NAME_FEATURE10 = "feature10"; const std::string MODULE_NAME_FEATURE13 = "feature13"; @@ -429,7 +428,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_0800, Function | SmallTest | bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -593,7 +592,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_1600, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -736,7 +735,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_2300, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -860,7 +859,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_2900, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1029,7 +1028,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_3800, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1252,7 +1251,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5000, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1279,7 +1278,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5100, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1317,7 +1316,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5200, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1364,7 +1363,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5300, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1377,7 +1376,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5300, Function | SmallTest | isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; fileExisted = IsFileExisted(filePath); @@ -1406,7 +1405,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5400, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1419,7 +1418,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5400, Function | SmallTest | isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; fileExisted = IsFileExisted(filePath); @@ -1448,7 +1447,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5500, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1461,15 +1460,15 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5500, Function | SmallTest | isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; fileExisted = IsFileExisted(filePath); EXPECT_FALSE(fileExisted); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature13_main_test_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature13_libpng.z.so filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE13 + PATH_UNDERLIND + - DRIVER_FILE_NAME1; + DRIVER_FILE_NAME; fileExisted = IsFileExisted(filePath); EXPECT_TRUE(fileExisted); @@ -1496,7 +1495,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5600, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1509,7 +1508,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5600, Function | SmallTest | isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; fileExisted = IsFileExisted(filePath); @@ -1538,7 +1537,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5700, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1551,7 +1550,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_5700, Function | SmallTest | isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature10_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature10_libpng.z.so filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE10 + PATH_UNDERLIND + DRIVER_FILE_NAME; fileExisted = IsFileExisted(filePath); @@ -1578,7 +1577,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_6000, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature15_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature15_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE15 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1605,7 +1604,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_6100, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature16_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature16_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE16 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1632,7 +1631,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_6200, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature17_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature17_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE17 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1659,7 +1658,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_6300, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature18_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature18_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE18 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1686,7 +1685,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_6400, Function | SmallTest | EXPECT_EQ(result, ERR_OK); bool isDirEmpty = IsDriverDirEmpty(); EXPECT_FALSE(isDirEmpty); - // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/com.example.driverTest_feature6_libpng.z.so std::string filePath = DRIVER_FILE_DIR + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; bool fileExisted = IsFileExisted(filePath); @@ -1702,7 +1701,7 @@ HWTEST_F(BmsDriverInstallerTest, InstallDriverTest_6400, Function | SmallTest | fileExisted = IsFileExisted(filePath); EXPECT_TRUE(fileExisted); - // /data/service/el1/public/print_service/cups/datadir/model/temp_com.example.driverTest_feature6_main_pages.json + // /data/service/el1/public/print_service/cups/datadir/model/temp_com.example.driverTest_feature6_libpng.z.so std::string tempFilePath = DRIVER_FILE_DIR + TEMP_PREFIX + BUNDLE_NAME + PATH_UNDERLIND + MODULE_NAME_FEATURE6 + PATH_UNDERLIND + DRIVER_FILE_NAME; fileExisted = IsFileExisted(tempFilePath); diff --git a/services/bundlemgr/test/unittest/bms_install_daemon_test/bms_install_daemon_operator_test.cpp b/services/bundlemgr/test/unittest/bms_install_daemon_test/bms_install_daemon_operator_test.cpp index 4ff8535b93..13131997e3 100755 --- a/services/bundlemgr/test/unittest/bms_install_daemon_test/bms_install_daemon_operator_test.cpp +++ b/services/bundlemgr/test/unittest/bms_install_daemon_test/bms_install_daemon_operator_test.cpp @@ -1149,21 +1149,21 @@ HWTEST_F(BmsInstallDaemonOperatorTest, InstalldOperatorTest_7500, Function | Sma std::string destinedDir = "invalid"; std::string originalDir = "invalid"; BundleExtractor extractor(""); - bool res = InstalldOperator::CopyDriverSoFiles(extractor, originalDir, destinedDir); + bool res = InstalldOperator::CopyDriverSoFiles(originalDir, destinedDir); EXPECT_EQ(res, false); destinedDir = "invalid/"; - res = InstalldOperator::CopyDriverSoFiles(extractor, originalDir, destinedDir); + res = InstalldOperator::CopyDriverSoFiles(originalDir, destinedDir); EXPECT_EQ(res, false); destinedDir = "invalid/test"; originalDir = "invalid/test"; - res = InstalldOperator::CopyDriverSoFiles(extractor, originalDir, destinedDir); + res = InstalldOperator::CopyDriverSoFiles(originalDir, destinedDir); EXPECT_EQ(res, false); destinedDir = "data/test"; originalDir = "data/test"; - res = InstalldOperator::CopyDriverSoFiles(extractor, originalDir, destinedDir); + res = InstalldOperator::CopyDriverSoFiles(originalDir, destinedDir); EXPECT_EQ(res, false); } diff --git a/test/sceneProject/unittest/driver_test/driver_feature10/BUILD.gn b/test/sceneProject/unittest/driver_test/driver_feature10/BUILD.gn index fdaefa0ca3..92b7079767 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature10/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/driver_feature10/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("driver_feature10_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/driver_feature10/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/driver_feature10/feature/src/main/module.json index 3bfe022c2c..35067604a6 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature10/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/driver_feature10/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "cupsFilter", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } diff --git a/test/sceneProject/unittest/driver_test/driver_feature15/BUILD.gn b/test/sceneProject/unittest/driver_test/driver_feature15/BUILD.gn index a035a88977..5690faf695 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature15/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/driver_feature15/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("driver_feature15_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/driver_feature15/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/driver_feature15/feature/src/main/module.json index 901210ae80..d552cc687b 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature15/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/driver_feature15/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "cupsBackend", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } diff --git a/test/sceneProject/unittest/driver_test/driver_feature16/BUILD.gn b/test/sceneProject/unittest/driver_test/driver_feature16/BUILD.gn index f04ca030ba..521a2d95c0 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature16/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/driver_feature16/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("driver_feature16_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/driver_feature16/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/driver_feature16/feature/src/main/module.json index 7f0ac2fa5e..60453d9978 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature16/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/driver_feature16/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "cupsPpd", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } diff --git a/test/sceneProject/unittest/driver_test/driver_feature17/BUILD.gn b/test/sceneProject/unittest/driver_test/driver_feature17/BUILD.gn index 2bbe42b83b..e51787f0f8 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature17/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/driver_feature17/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("driver_feature17_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/driver_feature17/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/driver_feature17/feature/src/main/module.json index c77ee372d5..6f5361d86e 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature17/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/driver_feature17/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "saneConfig", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } diff --git a/test/sceneProject/unittest/driver_test/driver_feature18/BUILD.gn b/test/sceneProject/unittest/driver_test/driver_feature18/BUILD.gn index 765078bf4a..b52cf17aad 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature18/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/driver_feature18/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("driver_feature18_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/driver_feature18/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/driver_feature18/feature/src/main/module.json index 7e5e81dff6..00185b37ef 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature18/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/driver_feature18/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "saneBackend", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } diff --git a/test/sceneProject/unittest/driver_test/driver_feature6/BUILD.gn b/test/sceneProject/unittest/driver_test/driver_feature6/BUILD.gn index 48b7b3540f..551e8dd202 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature6/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/driver_feature6/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("driver_feature6_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/driver_feature6/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/driver_feature6/feature/src/main/module.json index 31a8597c2a..1c2ec186c1 100644 --- a/test/sceneProject/unittest/driver_test/driver_feature6/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/driver_feature6/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "cupsFilter", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } diff --git a/test/sceneProject/unittest/driver_test/high_version_driver_feature13/BUILD.gn b/test/sceneProject/unittest/driver_test/high_version_driver_feature13/BUILD.gn index 94d6acbe91..f090b5d912 100644 --- a/test/sceneProject/unittest/driver_test/high_version_driver_feature13/BUILD.gn +++ b/test/sceneProject/unittest/driver_test/high_version_driver_feature13/BUILD.gn @@ -24,6 +24,7 @@ ohos_hap("high_version_driver_feature13_hap") { ":hjs_demo_js_assets", ":hjs_demo_resources", ] + shared_libraries = [ "//third_party/libpng:libpng" ] certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.driverTest.p7b" } diff --git a/test/sceneProject/unittest/driver_test/high_version_driver_feature13/feature/src/main/module.json b/test/sceneProject/unittest/driver_test/high_version_driver_feature13/feature/src/main/module.json index 6de006c4cb..76365c3776 100644 --- a/test/sceneProject/unittest/driver_test/high_version_driver_feature13/feature/src/main/module.json +++ b/test/sceneProject/unittest/driver_test/high_version_driver_feature13/feature/src/main/module.json @@ -31,7 +31,7 @@ { "name": "cupsFilter", "value": "/print_service/cups/datadir/model", - "resource": "/resources/rawfile/main_test_pages.json" + "resource": "/libs/arm64/libpng.z.so" } ] } -- Gitee