summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2023-04-02 15:29:36 -0700
committerKhem Raj <raj.khem@gmail.com>2023-04-02 17:43:22 -0700
commitec3760af48a141a5c6896e6ec8b986af909de95b (patch)
tree6955a66325be37305c9441c0751d6e6d97436ed8
parentd094f80089428438b9681a52108aa9b63cbd2884 (diff)
downloadmeta-openembedded-ec3760af48a141a5c6896e6ec8b986af909de95b.tar.gz
meta-oe-ptest*-image: enable BBCLASSEXTEND parallel execution
Similar to "core-image-ptest: Switch to BBCLASSEXTEND parallel execution" Refactor meta-oe-ptest-image.bb for an image per ptest in the form of meta-oe-ptest-image-XXX using class extensions. * Add meta-oe-ptest-all-image.bb depends on ALL meta-oe-ptest-image-XXX in meta-oe * Add meta-oe-ptest-fast-image.bb depends on meta-oe ptests which take less than ~30s This allows parallel execution of the tests. The downside to this approach is the parsing time of an image generating this number of class extensions is slow but making it easier to execute and collect test data should outweigh that. A useful advantage is that the dependencies of each ptest package are checked/tested individually. Add to local.conf: IMAGE_CLASSES += "testimage" All the meta-oe-ptest-image-XXX can be built with: $ bitbake meta-oe-ptest-all-image Subsequently, all the ptest images can be run with: $ bitbake -c testimage meta-oe-ptest-all-image You will likely want to limit the number of parallel image tests: BB_NUMBER_THREADS = "4" based on the number of TAP devices you have defined or the number of simultaneous QEMU sessions your server can support. Results can be summarized with: $ resulttool report tmp/log/oeqa/testresult.json Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-core/images/meta-oe-ptest-all-image.bb25
-rw-r--r--meta-oe/recipes-core/images/meta-oe-ptest-fast-image.bb6
-rw-r--r--meta-oe/recipes-core/images/meta-oe-ptest-image.bb38
3 files changed, 68 insertions, 1 deletions
diff --git a/meta-oe/recipes-core/images/meta-oe-ptest-all-image.bb b/meta-oe/recipes-core/images/meta-oe-ptest-all-image.bb
new file mode 100644
index 0000000000..0ea03dd2e3
--- /dev/null
+++ b/meta-oe/recipes-core/images/meta-oe-ptest-all-image.bb
@@ -0,0 +1,25 @@
1DESCRIPTION = "Recipe to trigger execution of all meta-oe ptest images."
2HOMEPAGE = "https://www.openembedded.org/"
3
4LICENSE = "MIT"
5
6inherit features_check nopackages
7REQUIRED_DISTRO_FEATURES = "ptest"
8
9require conf/include/ptest-packagelists-meta-oe.inc
10
11# Include the full set of ptests
12PTESTS_META_OE = "${PTESTS_FAST_META_OE} ${PTESTS_SLOW_META_OE}"
13
14do_testimage[noexec] = "1"
15do_testimage[depends] = "${@' '.join(['meta-oe-ptest-image-'+x+':do_testimage' for x in d.getVar('PTESTS_META_OE').split()])}"
16
17do_build[depends] = "${@' '.join(['meta-oe-ptest-image-'+x+':do_build' for x in d.getVar('PTESTS_META_OE').split()])}"
18
19# normally image.bbclass would do this
20EXCLUDE_FROM_WORLD = "1"
21
22python () {
23 if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d):
24 bb.build.addtask("do_testimage", "", "", d)
25}
diff --git a/meta-oe/recipes-core/images/meta-oe-ptest-fast-image.bb b/meta-oe/recipes-core/images/meta-oe-ptest-fast-image.bb
new file mode 100644
index 0000000000..f56e841ff1
--- /dev/null
+++ b/meta-oe/recipes-core/images/meta-oe-ptest-fast-image.bb
@@ -0,0 +1,6 @@
1require meta-oe-ptest-all-image.bb
2
3DESCRIPTION = "Recipe to trigger execution of all fast meta-oe ptest images."
4
5PTESTS_META_OE = "${PTESTS_FAST_META_OE}"
6
diff --git a/meta-oe/recipes-core/images/meta-oe-ptest-image.bb b/meta-oe/recipes-core/images/meta-oe-ptest-image.bb
index 0166b9c41d..951d91f821 100644
--- a/meta-oe/recipes-core/images/meta-oe-ptest-image.bb
+++ b/meta-oe/recipes-core/images/meta-oe-ptest-image.bb
@@ -1,5 +1,41 @@
1inherit features_check
2REQUIRED_DISTRO_FEATURES = "ptest"
3
4require conf/include/ptest-packagelists-meta-oe.inc
5
1require meta-oe-image-base.bb 6require meta-oe-image-base.bb
2 7
3SUMMARY = "meta-oe ptest test image" 8SUMMARY = "meta-oe ptest test image"
4 9
5IMAGE_INSTALL += "packagegroup-meta-oe" 10DESCRIPTION += "Also including the ${MCNAME} ptest package."
11HOMEPAGE = "https://www.openembedded.org/"
12
13PTESTS_META_OE = "${PTESTS_SLOW_META_OE} ${PTESTS_FAST_META_OE}"
14
15IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
16
17BBCLASSEXTEND = "${@' '.join(['mcextend:'+x for x in d.getVar('PTESTS_META_OE').split()])}"
18
19# The image can be sufficiently large (~1.8GB) that we need to be careful that it fits in a live
20# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
21# box) and explicitly add up to 1500MB.
22IMAGE_OVERHEAD_FACTOR = "1.0"
23IMAGE_ROOTFS_EXTRA_SPACE = "324288"
24# If a particular ptest needs more space, it can be customized:
25#IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-<pn> = "1024288"
26
27# ptests need more memory than standard to avoid the OOM killer
28QB_MEM = "-m 1024"
29# If a particular ptest needs more memroy, it can be customized:
30#QB_MEM:virtclass-mcextend-<pn> = "-m 4096"
31
32TEST_SUITES = "ping ssh parselogs ptest"
33
34# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
35PTEST_EXPECT_FAILURE = "1"
36
37python () {
38 if not d.getVar("MCNAME"):
39 raise bb.parse.SkipRecipe("No class extension set")
40}
41