diff --git a/README.md b/README.md index 143d828cf226a1570788bf7dac9ca8281b8c55ae..de0a5116834d1a702aaf3037edb9e4a17471552c 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,8 @@ for more information. ## OpenHarmony host tools To facilitate working with OpenHarmony systems, an image with various host tools -is provided. +is provided. The ACTS test suite for testing for OpenHarmony compatibility can +be included in this image. See [recipes-openharmony/tools/README.rst](recipes-openharmony/tools/README.rst) for more information. diff --git a/conf/distro/include/openharmony.inc b/conf/distro/include/openharmony.inc index 3b3e36f9992f8544772a8fcc0578a060a6be8ed2..6a0546209cbae7da3ee9d7b20599dd73b4da1001 100644 --- a/conf/distro/include/openharmony.inc +++ b/conf/distro/include/openharmony.inc @@ -22,6 +22,9 @@ DISTROOVERRIDES:append = "${OPENHARMONY_OVERRIDES}" PREFERRED_VERSION_openharmony-standard = "${OPENHARMONY_VERSION}" +# Enable "df-acts" override +DISTRO_FEATURES_OVERRIDES += "acts" + # clang_rt.profile library is used in openharmony-standard build PACKAGECONFIG:pn-compiler-rt:append:df-openharmony = " profile" diff --git a/conf/local.conf.sample b/conf/local.conf.sample index 9f9c138c4aca6ee36c6e5cb8ec0b96ed21ef9fd2..4179a3efd1105125aa6bd0d41ae5fc397149b567 100644 --- a/conf/local.conf.sample +++ b/conf/local.conf.sample @@ -39,6 +39,8 @@ MACHINE ??= "qemuarma7" # Default policy config # DISTRO ?= "oniro-openharmony-linux" +# Comment this out if you don't want to build ACTS test suite +DISTRO_FEATURES:append = " acts" # # Extra image configuration defaults diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb index 23b396bbdc4bb07e6d03e0bd2e72c176073852d2..81bac0262aa086f23a8766f65c8255f474701c65 100644 --- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb @@ -1962,6 +1962,26 @@ do_install_ptest:append() { done } +PACKAGES:prepend:df-acts = "${PN}-acts " +do_install:append:df-acts() { + mkdir -p ${D}${libexecdir}/${PN}/acts + for d in config testcases ; do + cp -dR --no-preserve=ownership ${B}/suites/acts/$d ${D}${libexecdir}/${PN}/acts/ + done +} +FILES:${PN}-acts = "${libexecdir}/${PN}/acts" +INSANE_SKIP:${PN}-acts = "file-rdeps" + +PACKAGES =+ "${PN}-hits" +do_install_ptest:append() { + install -D ${WORKDIR}/run-ptest ${D}${libdir}/${BPN}-hits/ptest/run-ptest + mv ${D}${PTEST_PATH}/moduletest/hits ${D}${libdir}/${BPN}-hits/ptest/moduletest + mv ${D}${PTEST_PATH}/moduletest/hit/* ${D}${libdir}/${BPN}-hits/ptest/moduletest +} +FILES:${PN}-hits = "${libdir}/${BPN}-hits/ptest" +RDEPENDS:${PN}-hits += "musl libcxx" +RDEPENDS:${PN}-hits += "${PN}-hicollie ${PN}-libutils ${PN}-hisysevent ${PN}-hiview ${PN}-hitrace ${PN}-hilog ${PN}-faultlogger" + EXCLUDE_FROM_SHLIBS = "1" # To avoid excessive diskspace blowup, we are stripping our executables diff --git a/recipes-openharmony/tools/README.rst b/recipes-openharmony/tools/README.rst index 94f14cb5e2704b2604901dbfef66388c25ad2983..9888d47684f542bb41c4b3ecf457d7c0b456da85 100644 --- a/recipes-openharmony/tools/README.rst +++ b/recipes-openharmony/tools/README.rst @@ -25,6 +25,10 @@ Once that is in place, the `bitbake` command is simply:: DISTRO=oniro-openharmony-linux MACHINE=qemuarma7 bitbake openharmony-tools +The default configuration (as defined in +[local.conf.sample](conf/local.conf.sample)), enables building of ACTS and +inclusion in the `openharmony-tools` image. + Installation ************ @@ -46,3 +50,25 @@ In order to use the installed tools, you need to setup your shell environment $ . /opt/openharmony-tools/environment-setup-x86_64-oesdk-linux And with that, you will have access to `hdc` and `xdevice` commands. + + +Running ACTS +============ + +To run ACTS tests, you need to connect to the OpenHarmony target device (or +QEMU) using `hdc` and then run the tests using `xdevice` command. +(remember to setup the environment as show in the section above) + +As an example, running the `ActsContextTest.json` test case against QEMU target +(IP address 192.168.7.2), run + +.. code-block:: + + $ hdc tconn 192.168.7.2:35000 + Connect OK + $ xdevice run acts -l ActsContextTest + [2023-02-20 13:25:22,954] [Main] [INFO] [*************** xDevice Test Framework Starting ***************] + [2023-02-20 13:25:22,975] [Utils] [INFO] [The running command is: hdc_std -s tcp:8710 reset] + [2023-02-20 13:25:23,980] [Console] [INFO] [Input command: run -l ActsContextTest] + ... + diff --git a/recipes-openharmony/tools/openharmony-tools.bb b/recipes-openharmony/tools/openharmony-tools.bb index 4660f81ab2f45fcf088a748b3f36f76b01760e30..ea2c55587db805e6c9b72287add1ebc244bfa598 100644 --- a/recipes-openharmony/tools/openharmony-tools.bb +++ b/recipes-openharmony/tools/openharmony-tools.bb @@ -8,7 +8,6 @@ LICENSE = "Apache-2.0" require sanity-check.inc TOOLCHAIN_HOST_TASK = "nativesdk-hdc nativesdk-xdevice" - TOOLCHAIN_TARGET_TASK = "" TOOLCHAIN_OUTPUTNAME = "${PN}-${OPENHARMONY_VERSION}-${TUNE_PKGARCH}-${SDK_VERSION}" @@ -62,6 +61,16 @@ EOF fi } +TOOLCHAIN_TARGET_TASK:append:df-acts = " openharmony-standard-acts" +create_sdk_files:append:df-acts () { + pwd + for f in ${SDK_OUTPUT}/${SDKTARGETSYSROOT}${libexecdir}/openharmony-standard/acts/* ; do + f=$(basename $f) + ln -sft ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/python* \ + ../../../../${MULTIMACH_TARGET_SYS}${libexecdir}/openharmony-standard/acts/$f + done +} + TOOLCHAIN_NEED_CONFIGSITE_CACHE = "" INHIBIT_DEFAULT_DEPS = "1"