Skip to contentSkip to conversation

meta-multimedia-image-ptest: Add images to enable BBCLASSEXTEND parallel execution

PATCH New Khem Raj 1 participant 2 messages Feb 23, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 meta-multimedia-image-ptest: Add images to enable BBCLASSEXTEND parallel execution

In line with other layers like meta-oe, meta-python add capability to run recipe ptests

---
 .../ptest-packagelists-meta-multimedia.inc    | 17 ++++++++
 .../images/meta-multimedia-image-ptest-all.bb | 25 ++++++++++++
 .../meta-multimedia-image-ptest-fast.bb       |  5 +++
 .../images/meta-multimedia-image-ptest.bb     | 40 +++++++++++++++++++
 .../libopenmpt/libopenmpt_0.7.3.bb            |  1 +
 5 files changed, 88 insertions(+)
 create mode 100644 meta-multimedia/conf/include/ptest-packagelists-meta-multimedia.inc
 create mode 100644 meta-multimedia/recipes-multimedia/images/meta-multimedia-image-ptest-all.bb
 create mode 100644 meta-multimedia/recipes-multimedia/images/meta-multimedia-image-ptest-fast.bb
 create mode 100644 meta-multimedia/recipes-multimedia/images/meta-multimedia-image-ptest.bb
meta-multimedia/conf/include/ptest-packagelists-meta-multimedia.inc new file +17 -0
new file mode 100644
index 0000000000..e21ad5766b
@@ -0,0 +1,17 @@
+#
+# Lists of the ptest in meta-multimedia, sorted into two sets by the time they take
+# Please keep these sorted in alphabetical order
+#
+# A first pass at getting all meta-multimedia recipes which inherit ptest
+# meta_multimedia_ptest_recipes=$(bitbake-layers show-recipes --recipes-only --layer meta-multimedia --inherits ptest --bare | sed -e '1,/=== Matching recipes: ===/d')
+# ptests which take less than ~30s each
+
+PTESTS_FAST_META_MULTIMEDIA = "\
+"
+
+PTESTS_SLOW_META_MULTIMEDIA = "\
+"
+
+PTESTS_PROBLEMS_META_MULTIMEDIA = "\
+    libopenmpt \
+"
meta-multimedia/recipes-multimedia/images/meta-multimedia-image-ptest-all.bb new file +25 -0
new file mode 100644
index 0000000000..8accba1bff
@@ -0,0 +1,25 @@
+DESCRIPTION = "Recipe to trigger execution of all meta-multimedia ptest images."
+HOMEPAGE = "https://www.openembedded.org/"
+
+LICENSE = "MIT"
+
+inherit features_check nopackages
+REQUIRED_DISTRO_FEATURES = "ptest"
+
+require conf/include/ptest-packagelists-meta-multimedia.inc
+
+# Include the full set of ptests
+PTESTS_META_MULTIMEDIA = "${PTESTS_FAST_META_MULTIMEDIA} ${PTESTS_SLOW_META_MULTIMEDIA} ${PTESTS_PROBLEMS_META_MULTIMEDIA}"
+
+do_testimage[noexec] = "1"
+do_testimage[depends] = "${@' '.join(['meta-multimedia-image-ptest-'+x+':do_testimage' for x in d.getVar('PTESTS_META_MULTIMEDIA').split()])}"
+
+do_build[depends] = "${@' '.join(['meta-multimedia-image-ptest-'+x+':do_build' for x in d.getVar('PTESTS_META_MULTIMEDIA').split()])}"
+
+# normally image.bbclass would do this
+EXCLUDE_FROM_WORLD = "1"
+
+python () {
+    if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d):
+        bb.build.addtask("do_testimage", "", "", d)
+}
meta-multimedia/recipes-multimedia/images/meta-multimedia-image-ptest-fast.bb new file +5 -0
new file mode 100644
index 0000000000..e6e0c4c9bc
@@ -0,0 +1,5 @@
+require meta-multimedia-image-ptest-all.bb
+
+DESCRIPTION = "Recipe to trigger execution of all fast meta-multimedia ptest images."
+
+PTESTS_META_OE = "${PTESTS_FAST_META_MULTIMEDIA}"
meta-multimedia/recipes-multimedia/images/meta-multimedia-image-ptest.bb new file +40 -0
new file mode 100644
index 0000000000..887396d4cc
@@ -0,0 +1,40 @@
+inherit features_check
+REQUIRED_DISTRO_FEATURES = "ptest"
+
+require recipes-core/images/core-image-minimal.bb
+require conf/include/ptest-packagelists-meta-multimedia.inc
+
+SUMMARY = "meta-multimedia ptest test image"
+
+DESCRIPTION += "Also including the ${MCNAME} ptest package."
+HOMEPAGE = "https://www.openembedded.org/"
+
+PTESTS_META_MULTIMEDIA = "${PTESTS_SLOW_META_MULTIMEDIA} ${PTESTS_FAST_META_MULTIMEDIA} ${PTESTS_PROBLEMS_META_MULTIMEDIA}"
+
+IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
+
+BBCLASSEXTEND = "${@' '.join(['mcextend:'+x for x in d.getVar('PTESTS_META_MULTIMEDIA').split()])}"
+
+# The image can be sufficiently large (~1.8GB) that we need to be careful that it fits in a live
+# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
+# box) and explicitly add up to 1500MB.
+IMAGE_OVERHEAD_FACTOR = "1.0"
+IMAGE_ROOTFS_EXTRA_SPACE = "324288"
+# If a particular ptest needs more space, it can be customized:
+#IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-<pn> = "1024288"
+
+# ptests need more memory than standard to avoid the OOM killer
+QB_MEM = "-m 1024"
+# If a particular ptest needs more memroy, it can be customized:
+#QB_MEM:virtclass-mcextend-<pn> = "-m 4096"
+
+TEST_SUITES = "ping ssh parselogs ptest"
+
+# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
+PTEST_EXPECT_FAILURE = "1"
+
+python () {
+    if not d.getVar("MCNAME"):
+        raise bb.parse.SkipRecipe("No class extension set")
+}
+
meta-multimedia/recipes-multimedia/libopenmpt/libopenmpt_0.7.3.bb +1 -0
index 92f33da899..8bb49b2f12 100644
@@ -74,6 +74,7 @@ FILES:${PN}-openmpt123-doc = "${mandir}/man1/openmpt123*"
 DEBIAN_NOAUTONAME:${PN} = "1"
 
 RDEPENDS:${PN}:libc-glibc = " \
+    glibc-gconv \
     glibc-gconv-cp1252 \
     glibc-gconv-ibm437 \
     glibc-gconv-iso8859-1 \
Signature · 1 line
2.43.2
author
#1 lore raw

PATCH 2/2 meta-networking-image-ptest: Add images to enable BBCLASSEXTEND parallel execution

In line with other layers like meta-oe, meta-python add capability to run recipe ptests

---
 .../ptest-packagelists-meta-networking.inc    | 36 +++++++++++++++++
 .../images/meta-networking-image-ptest-all.bb | 25 ++++++++++++
 .../meta-networking-image-ptest-fast.bb       |  5 +++
 .../images/meta-networking-image-ptest.bb     | 40 +++++++++++++++++++
 4 files changed, 106 insertions(+)
 create mode 100644 meta-networking/conf/include/ptest-packagelists-meta-networking.inc
 create mode 100644 meta-networking/recipes-core/images/meta-networking-image-ptest-all.bb
 create mode 100644 meta-networking/recipes-core/images/meta-networking-image-ptest-fast.bb
 create mode 100644 meta-networking/recipes-core/images/meta-networking-image-ptest.bb
meta-networking/conf/include/ptest-packagelists-meta-networking.inc new file +36 -0
new file mode 100644
index 0000000000..6b41bfcf1a
@@ -0,0 +1,36 @@
+#
+# Lists of the ptest in meta-networking, sorted into two sets by the time they take
+# Please keep these sorted in alphabetical order
+#
+# A first pass at getting all meta-networking recipes which inherit ptest
+# meta_networking_ptest_recipes=$(bitbake-layers show-recipes --recipes-only --layer meta-networking --inherits ptest --bare | sed -e '1,/=== Matching recipes: ===/d')
+# ptests which take less than ~30s each
+
+PTESTS_FAST_META_NETWORKING = "\
+    geoip \
+    libcoap \
+    libldb \
+    libnftnl \
+    libtalloc \
+    libtdb \
+    lldpd \
+    mbedtls \
+    tcpdump \
+"
+
+PTESTS_SLOW_META_NETWORKING = "\
+    firewalld \
+    net-snmp \
+"
+
+PTESTS_PROBLEMS_META_NETWORKING = "\
+    freediameter \
+    geoip-perl \
+    libtevent \
+    lksctp-tools \
+    nftables \
+    openhpi \
+    openl2tp \
+    python3-scapy \
+    squid \
+"
meta-networking/recipes-core/images/meta-networking-image-ptest-all.bb new file +25 -0
new file mode 100644
index 0000000000..6d96d4a876
@@ -0,0 +1,25 @@
+DESCRIPTION = "Recipe to trigger execution of all meta-networking ptest images."
+HOMEPAGE = "https://www.openembedded.org/"
+
+LICENSE = "MIT"
+
+inherit features_check nopackages
+REQUIRED_DISTRO_FEATURES = "ptest"
+
+require conf/include/ptest-packagelists-meta-networking.inc
+
+# Include the full set of ptests
+PTESTS_META_NETWORKING = "${PTESTS_FAST_META_NETWORKING} ${PTESTS_SLOW_META_NETWORKING} ${PTESTS_PROBLEMS_META_NETWORKING}"
+
+do_testimage[noexec] = "1"
+do_testimage[depends] = "${@' '.join(['meta-networking-image-ptest-'+x+':do_testimage' for x in d.getVar('PTESTS_META_NETWORKING').split()])}"
+
+do_build[depends] = "${@' '.join(['meta-networking-image-ptest-'+x+':do_build' for x in d.getVar('PTESTS_META_NETWORKING').split()])}"
+
+# normally image.bbclass would do this
+EXCLUDE_FROM_WORLD = "1"
+
+python () {
+    if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d):
+        bb.build.addtask("do_testimage", "", "", d)
+}
meta-networking/recipes-core/images/meta-networking-image-ptest-fast.bb new file +5 -0
new file mode 100644
index 0000000000..7790dd71e0
@@ -0,0 +1,5 @@
+require meta-networking-image-ptest-all.bb
+
+DESCRIPTION = "Recipe to trigger execution of all fast meta-networking ptest images."
+
+PTESTS_META_OE = "${PTESTS_FAST_META_NETWORKING}"
meta-networking/recipes-core/images/meta-networking-image-ptest.bb new file +40 -0
new file mode 100644
index 0000000000..f458b761f2
@@ -0,0 +1,40 @@
+inherit features_check
+REQUIRED_DISTRO_FEATURES = "ptest"
+
+require recipes-core/images/core-image-minimal.bb
+require conf/include/ptest-packagelists-meta-networking.inc
+
+SUMMARY = "meta-networking ptest test image"
+
+DESCRIPTION += "Also including the ${MCNAME} ptest package."
+HOMEPAGE = "https://www.openembedded.org/"
+
+PTESTS_META_NETWORKING = "${PTESTS_SLOW_META_NETWORKING} ${PTESTS_FAST_META_NETWORKING} ${PTESTS_PROBLEMS_META_NETWORKING}"
+
+IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
+
+BBCLASSEXTEND = "${@' '.join(['mcextend:'+x for x in d.getVar('PTESTS_META_NETWORKING').split()])}"
+
+# The image can be sufficiently large (~1.8GB) that we need to be careful that it fits in a live
+# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
+# box) and explicitly add up to 1500MB.
+IMAGE_OVERHEAD_FACTOR = "1.0"
+IMAGE_ROOTFS_EXTRA_SPACE = "324288"
+# If a particular ptest needs more space, it can be customized:
+#IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-<pn> = "1024288"
+
+# ptests need more memory than standard to avoid the OOM killer
+QB_MEM = "-m 1024"
+# If a particular ptest needs more memroy, it can be customized:
+#QB_MEM:virtclass-mcextend-<pn> = "-m 4096"
+
+TEST_SUITES = "ping ssh parselogs ptest"
+
+# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
+PTEST_EXPECT_FAILURE = "1"
+
+python () {
+    if not d.getVar("MCNAME"):
+        raise bb.parse.SkipRecipe("No class extension set")
+}
+
Signature · 1 line
2.43.2