diff --git a/recipes-extended/images/core-image-base-ohos-components-ptest.bb b/recipes-extended/images/openharmony-standard-system-image-tests.bb similarity index 80% rename from recipes-extended/images/core-image-base-ohos-components-ptest.bb rename to recipes-extended/images/openharmony-standard-system-image-tests.bb index 5bea944cde53404824ab1e1738b7f94792cbe15e..b39366d2aa94d8c3ab7229e9b5603e0c6704f709 100644 --- a/recipes-extended/images/core-image-base-ohos-components-ptest.bb +++ b/recipes-extended/images/openharmony-standard-system-image-tests.bb @@ -2,7 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 -require recipes-core/images/core-image-base.bb +SUMMARY = "A console-only image with OpenHarmony first party components and unit tests" + +inherit core-image python do_check_if_testimage_inherited() { if not bb.utils.contains("INHERIT", "testimage", True, False, d): @@ -29,4 +31,5 @@ EXTRA_IMAGE_FEATURES += "debug-tweaks" IMAGE_INSTALL += "sshd ptest-runner" # install OpenHarmony components and ptests -IMAGE_INSTALL += "openharmony-standard-system-components-exes hilog-ptest" +IMAGE_INSTALL += "openharmony-standard-system-components-exes" +IMAGE_INSTALL += "openharmony-standard-system-components-tests" diff --git a/recipes-openharmony/openharmony/openharmony-standard-system-components_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard-system-components_3.0.bb index 19cfffd13e347a0d418bf88d554c308496bac9a2..1484117c9baff09dacb322a2ba8f3bf0cef930c9 100644 --- a/recipes-openharmony/openharmony/openharmony-standard-system-components_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard-system-components_3.0.bb @@ -72,7 +72,7 @@ SRC_URI += "file://run-ptest" inherit python3native gn ptest -PTEST_PATH = "${libdir}/hilog/ptest" +PTEST_PATH = "${datadir}/ptest" B = "${S}/out/ohos-arm-release" COMPATIBLE_MACHINE = "qemuarm" @@ -476,6 +476,32 @@ OPENHARMONY_LIBS=" \ /system/lib/module/telephony/libsim.z.so \ " +# Openharmony service abilities are started by calling sa_main with a config xml +# file as an argument. +SERVICE_ABILITY_CONFIGS = " \ + /system/profile/pulseaudio.xml \ + /system/profile/telephony.xml \ + /system/profile/multimodalinputservice.xml \ + /system/profile/huks_service.xml \ + /system/profile/distributedsched.xml \ + /system/profile/accountmgr.xml \ + /system/profile/foundation.xml \ + /system/profile/distributeddata.xml \ + /system/profile/media_service.xml \ + /system/profile/audio_policy.xml \ + /system/profile/dps_service.xml \ + /system/profile/camera_service.xml \ + /system/profile/inputmethod_service.xml \ + /system/profile/softbus_server.xml \ + /system/profile/time_service.xml \ + " + +OPENHARMONY_CONFIGS = " \ + ${SERVICE_ABILITY_CONFIGS} \ + /system/etc/hilog_domains.conf \ + /system/etc/communication/softbus/softbus_trans_permission.json \ + " + # OpenHarmony build system generates all possible targets, but only `packages` # target is build with ninja in the end NINJA_ARGS = "packages" @@ -520,13 +546,18 @@ do_install () { done install -D -m 644 ${THISDIR}/${PN}-${PV}/ohos-config.sh "${D}/etc/profile.d/ohos-config.sh" + + for cfg in ${OPENHARMONY_CONFIGS} + do + install -D -m 755 "${OHOS_PACKAGE_OUT_DIR}/${cfg}" "${D}/${cfg}" + done } -PACKAGES =+ "${PN}-libs ${PN}-exes ${PN}-configs hilog-ptest" +PACKAGES =+ "${PN}-libs ${PN}-exes ${PN}-configs ${PN}-tests" RDEPENDS:${PN}-libs += "libcxx musl libcrypto libssl libatomic" RDEPENDS:${PN}-exes += "libcxx libcrypto ${PN}-libs ${PN}-configs" -RDEPENDS:hilog-ptest += "${PN}-libs libcxx musl" +RDEPENDS:${PN}-tests += "libcxx musl libcrypto libssl ${PN}-libs ${PN}-configs" # ptest class adds ${PN}-ptest package which depends on ${PN} package which in # case of this umbrella-recipe is not provided @@ -540,8 +571,9 @@ FILES_SOLIBSDEV = "" FILES:${PN}-libs = "${OPENHARMONY_LIBS}" FILES:${PN}-exes = "${OPENHARMONY_EXES}" FILES:${PN}-configs = "/etc/profile.d/ohos-config.sh" +FILES:${PN}-configs += "${OPENHARMONY_CONFIGS}" -FILES:hilog-ptest =+ "${PTEST_PATH}" +FILES:${PN}-tests = "${PTEST_PATH}" generate_build_config_json_file() { @@ -561,8 +593,10 @@ EOF } do_install_ptest () { - install -d ${D}${PTEST_PATH} - install ${B}/tests/moduletest/hiviewdfx/hilog/HiLogNDKTest ${D}${PTEST_PATH} + for f in $(cd "${B}/tests" && find . -type f) + do + install -D -m 755 "${B}/tests/$f" "${D}${PTEST_PATH}/$f" + done } generate_platforms_build_file() {