diff --git a/services/bundlemgr/include/installd/installd_operator.h b/services/bundlemgr/include/installd/installd_operator.h index e30d0c0467b8f0520858629f3f8fe8d8ba0a2e02..b17b1a7e464b569335ad965fca3031e6a93ee5c5 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 32b351c7360e890551d9207c6c875c8e52ceab94..dfa22e03bcdbeefd231774f4679cdda7302f3201 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 34e3c91424e3073f1a4179e0c26b74239fef035b..39afdf637fc6520c379077fba6f803e748f79132 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 be365b12b3d603f6986300e49b52b4dd78b32eea..d15385e0f7122d29abc36a900bb601a2cffd7527 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 4ff8535b93e8104e6a158782d748f19c95ff1931..13131997e3efb2014d389a7828d8df669d2d4a8e 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 fdaefa0ca3291a9110b9bff31c250e73eeda6aa2..92b7079767e080e10146b73ca8e9a10a6b75a3f2 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 3bfe022c2c71a30318fcc7fe45c49c1b55ef6194..35067604a6af42004edde6bdfb9e637c82b87ff4 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 a035a8897706c856f862da098a5c7453e17f14ac..5690faf695766e2961601c424fe94d2eb41914da 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 901210ae8020b9c861ac9f8b96a3c406463764ff..d552cc687b7f7d35db52c3cbf4d60a2778e25658 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 f04ca030ba3b1fc3f21d01939a66870614c29bfa..521a2d95c0b5af0df8011f1f78b847bd9af88a49 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 7f0ac2fa5ed11b2c6f5788dae22afba7b0efd9c7..60453d99787ba08d6664c5fdc1dd6a8830e1cc01 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 2bbe42b83b350529733a680ded6650c7bad73345..e51787f0f8e9564ccf9d91d4e8b79ece083cf595 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 c77ee372d50ce3bda98ac1a377b8375fad7d13a0..6f5361d86ecd12754bd5cb30a27584257f72fef2 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 765078bf4a0cf1e981c88da985e4b1412db7951c..b52cf17aad494a50502195f372d7e027e1bca1d9 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 7e5e81dff6e13b085df7b60fbce9be21d00a544c..00185b37ef63810cfacdc1639b60dc73ad4d0031 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 48b7b3540f3b66b60ef98eef7c060a9d8ae521f8..551e8dd202e1b5c3c8f7064d9d395800e3062616 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 31a8597c2ae93ee2e460030bff9c02dbb34ac5fa..1c2ec186c16baf11c35fe0e4b3ca2cd31c52e97d 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 94d6acbe910c7e6a434f68fa7dc4b15187e00f20..f090b5d912cb03d5b5671149e21027c8b9f2eb61 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 6de006c4cbe6d95ef1dae41195422b907601315d..76365c37767b4750e89e4a6a8d5128fa7b31a4a4 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" } ] }