Removal of imagetest-qemu in favour of testimage
cover Removal of imagetest-qemu in favour of testimage
This series adds some functionality to testimage that was previously in imagetest-qemu, and finally removes imagetest-qemu since testimage replaces it.
The following changes since commit 9934141d5df9d334f7f7f76e1990234af8a25a63:
qemu: Fix broken patch (2013-09-18 21:56:25 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/testimage2
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/testimage2
Paul Eggleton (5):
classes/testimage: remove odd characters in comments classes/testimage-auto: add class to allow automatically running image
tests
classes/sanity: test for DISPLAY being set with testimage class conf/local.conf.sample: update for new testimage class classes/imagetest-qemu: remove old image testing class
meta/classes/image.bbclass | 3 + meta/classes/imagetest-qemu.bbclass | 238 ------- meta/classes/populate_sdk_base.bbclass | 3 - meta/classes/sanity.bbclass | 6 +- meta/classes/testimage-auto.bbclass | 24 + meta/classes/testimage.bbclass | 6 +- meta/conf/layer.conf | 3 - meta/conf/local.conf.sample | 20 +- scripts/qemuimage-testlib | 760 --------------------- scripts/qemuimage-testlib-pythonhelper | 66 -- scripts/qemuimage-tests/sanity/boot | 29 - scripts/qemuimage-tests/sanity/compiler | 52 -- scripts/qemuimage-tests/sanity/connman | 53 -- scripts/qemuimage-tests/sanity/dmesg | 52 -- scripts/qemuimage-tests/sanity/rpm_query | 52 -- scripts/qemuimage-tests/sanity/scp | 71 -- scripts/qemuimage-tests/sanity/shutdown | 76 --- scripts/qemuimage-tests/sanity/smart_help | 52 -- scripts/qemuimage-tests/sanity/smart_query | 52 -- scripts/qemuimage-tests/sanity/ssh | 39 -- .../scenario/qemuarm/core-image-lsb | 7 - .../scenario/qemuarm/core-image-minimal | 1 - .../scenario/qemuarm/core-image-sato | 11 - .../scenario/qemuarm/core-image-sato-sdk | 12 - .../scenario/qemuarm/meta-toolchain-gmae | 3 - .../scenario/qemumips/core-image-lsb | 7 - .../scenario/qemumips/core-image-minimal | 1 - .../scenario/qemumips/core-image-sato | 11 - .../scenario/qemumips/core-image-sato-sdk | 12 - .../scenario/qemumips/meta-toolchain-gmae | 3 - .../scenario/qemuppc/core-image-lsb | 7 - .../scenario/qemuppc/core-image-minimal | 1 - .../scenario/qemuppc/core-image-sato | 11 - .../scenario/qemuppc/core-image-sato-sdk | 12 - .../scenario/qemuppc/meta-toolchain-gmae | 3 - .../scenario/qemux86-64/core-image-lsb | 7 - .../scenario/qemux86-64/core-image-minimal | 1 - .../scenario/qemux86-64/core-image-sato | 11 - .../scenario/qemux86-64/core-image-sato-sdk | 12 - .../scenario/qemux86-64/meta-toolchain-gmae | 3 - .../scenario/qemux86/core-image-lsb | 7 - .../scenario/qemux86/core-image-minimal | 1 - .../scenario/qemux86/core-image-sato | 11 - .../scenario/qemux86/core-image-sato-sdk | 12 - .../scenario/qemux86/meta-toolchain-gmae | 3 - scripts/qemuimage-tests/systemusage/bash | 53 -- scripts/qemuimage-tests/systemusage/df | 54 -- scripts/qemuimage-tests/systemusage/syslog | 54 -- scripts/qemuimage-tests/toolchain/cvs | 31 - scripts/qemuimage-tests/toolchain/iptables | 31 - scripts/qemuimage-tests/toolchain/sudoku-savant | 31 - scripts/qemuimage-tests/tools/bash.sh | 17 - scripts/qemuimage-tests/tools/compiler_test.sh | 137 ---- scripts/qemuimage-tests/tools/connman_test.sh | 75 -- scripts/qemuimage-tests/tools/df.sh | 25 - scripts/qemuimage-tests/tools/dmesg.sh | 28 - scripts/qemuimage-tests/tools/rpm_test.sh | 45 -- scripts/qemuimage-tests/tools/smart_test.sh | 45 -- scripts/qemuimage-tests/tools/syslog.sh | 17 - 59 files changed, 36 insertions(+), 2434 deletions(-) delete mode 100644 meta/classes/imagetest-qemu.bbclass create mode 100644 meta/classes/testimage-auto.bbclass delete mode 100755 scripts/qemuimage-testlib delete mode 100755 scripts/qemuimage-testlib-pythonhelper delete mode 100755 scripts/qemuimage-tests/sanity/boot delete mode 100755 scripts/qemuimage-tests/sanity/compiler delete mode 100755 scripts/qemuimage-tests/sanity/connman delete mode 100755 scripts/qemuimage-tests/sanity/dmesg delete mode 100755 scripts/qemuimage-tests/sanity/rpm_query delete mode 100755 scripts/qemuimage-tests/sanity/scp delete mode 100755 scripts/qemuimage-tests/sanity/shutdown delete mode 100755 scripts/qemuimage-tests/sanity/smart_help delete mode 100755 scripts/qemuimage-tests/sanity/smart_query delete mode 100755 scripts/qemuimage-tests/sanity/ssh delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/meta-toolchain-gmae delete mode 100755 scripts/qemuimage-tests/systemusage/bash delete mode 100755 scripts/qemuimage-tests/systemusage/df delete mode 100755 scripts/qemuimage-tests/systemusage/syslog delete mode 100755 scripts/qemuimage-tests/toolchain/cvs delete mode 100755 scripts/qemuimage-tests/toolchain/iptables delete mode 100755 scripts/qemuimage-tests/toolchain/sudoku-savant delete mode 100644 scripts/qemuimage-tests/tools/bash.sh delete mode 100644 scripts/qemuimage-tests/tools/compiler_test.sh delete mode 100644 scripts/qemuimage-tests/tools/connman_test.sh delete mode 100644 scripts/qemuimage-tests/tools/df.sh delete mode 100644 scripts/qemuimage-tests/tools/dmesg.sh delete mode 100644 scripts/qemuimage-tests/tools/rpm_test.sh delete mode 100644 scripts/qemuimage-tests/tools/smart_test.sh delete mode 100644 scripts/qemuimage-tests/tools/syslog.sh
Signature · 1 line
1.8.1.2
PATCH 1/5 classes/testimage: remove odd characters in comments
--- meta/classes/testimage.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/testimage.bbclass +3 -3
@@ -7,9 +7,9 @@ # Most of the tests are commands run on target image over ssh. # To use it add testimage to global inherit and call your target image with -c testimage # You can try it out like this: -# - first build a qemu core-image-sato -# - add INHERIT += "testimage" in local.conf -# - then bitbake core-image-sato -c testimage. That will run a standard suite of tests. +# - first build a qemu core-image-sato +# - add INHERIT += "testimage" in local.conf +# - then bitbake core-image-sato -c testimage. That will run a standard suite of tests. # You can set (or append to) TEST_SUITES in local.conf to select the tests # which you want to run for your target.
Signature · 1 line
1.8.1.2
PATCH 2/5 classes/testimage-auto: add class to allow automatically running image tests
In reply to Paul EggletonSetting TEST_IMAGE = "1" alone will now automatically run tests on the image immediately after the image is built instead of having to add INHERIT += "testimage" and run bitbake -c testimage <image> manually (but that will still work). This restores functionality that was present in the older imagetest-qemu class with IMAGETEST.
--- meta/classes/image.bbclass | 3 +++ meta/classes/testimage-auto.bbclass | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 meta/classes/testimage-auto.bbclass
meta/classes/image.bbclass +3 -0
@@ -16,6 +16,9 @@ RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}" INHIBIT_DEFAULT_DEPS = "1" +TESTIMAGECLASS = "${@base_conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}" +inherit ${TESTIMAGECLASS} + # IMAGE_FEATURES may contain any available package group IMAGE_FEATURES ?= "" IMAGE_FEATURES[type] = "list"
meta/classes/testimage-auto.bbclass new file +24 -0
@@ -0,0 +1,24 @@ +# Copyright (C) 2013 Intel Corporation +# +# Released under the MIT license (see COPYING.MIT) + + +# Run tests automatically on an image after the image is constructed +# (as opposed to testimage.bbclass alone where tests must be called +# manually using bitbake -c testimage <image>). +# +# NOTE: to use this class, simply set TEST_IMAGE = "1" - no need to +# inherit it since that will be done in image.bbclass when this variable +# has been set. +# +# See testimage.bbclass for the test implementation. + +inherit testimage + +python do_testimage_auto() { + testimage_main(d) +} +addtask testimage_auto before do_build after do_rootfs +do_testimage_auto[nostamp] = "1" +do_testimage_auto[depends] += "qemu-native:do_populate_sysroot" +do_testimage_auto[depends] += "qemu-helper-native:do_populate_sysroot"
Signature · 1 line
1.8.1.2
PATCH 3/5 classes/sanity: test for DISPLAY being set with testimage class
In reply to Paul EggletonUpdate the sanity test for DISPLAY being set to handle the new testimage class rather than the old imagetest-qemu class.
--- meta/classes/sanity.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/sanity.bbclass +3 -3
@@ -627,11 +627,11 @@ def check_sanity_everybuild(status, d): check_supported_distro(d) - # Check if DISPLAY is set if IMAGETEST is set - if d.getVar( 'IMAGETEST', True ) == 'qemu': + # Check if DISPLAY is set if TEST_IMAGE is set + if d.getVar('TEST_IMAGE', True) == '1' or d.getVar('DEFAULT_TEST_SUITES', True): display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True) if not display: - status.addresult('qemuimagetest needs an X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n') + status.addresult('testimage needs an X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n') omask = os.umask(022) if omask & 0755:
Signature · 1 line
1.8.1.2
PATCH 4/5 conf/local.conf.sample: update for new testimage class
In reply to Paul Eggleton--- meta/conf/local.conf.sample | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
meta/conf/local.conf.sample +3 -17
@@ -151,23 +151,9 @@ USER_CLASSES ?= "buildstats image-mklibs image-prelink" # # The build system can test booting virtual machine images under qemu (an emulator) # after any root filesystems are created and run tests against those images. To -# enable this uncomment this line -#IMAGETEST = "qemu" -# -# This variable controls which tests are run against virtual images if enabled -# above. The following would enable bat, boot the test case under the sanity suite -# and perform toolchain tests -#TEST_SCEN = "sanity bat sanity:boot toolchain" -# -# Because of the QEMU booting slowness issue (see bug #646 and #618), the -# autobuilder may suffer a timeout issue when running sanity tests. We introduce -# the variable TEST_SERIALIZE here to reduce the time taken by the sanity tests. -# It is set to 1 by default, which will boot the image and run cases in the same -# image without rebooting or killing the machine instance. If it is set to 0, the -# image will be copied and tested for each case, which will take longer but be -# more precise. -#TEST_SERIALIZE = "1" - +# enable this uncomment this line. See classes/testimage(-auto).bbclass for +# further details. +#TEST_IMAGE = "1" # # Interactive shell configuration #
Signature · 1 line
1.8.1.2
PATCH 5/5 classes/imagetest-qemu: remove old image testing class
In reply to Paul EggletonThis has now been superseded by testimage.
--- meta/classes/imagetest-qemu.bbclass | 238 ------- meta/classes/populate_sdk_base.bbclass | 3 - meta/conf/layer.conf | 3 - scripts/qemuimage-testlib | 760 --------------------- scripts/qemuimage-testlib-pythonhelper | 66 -- scripts/qemuimage-tests/sanity/boot | 29 - scripts/qemuimage-tests/sanity/compiler | 52 -- scripts/qemuimage-tests/sanity/connman | 53 -- scripts/qemuimage-tests/sanity/dmesg | 52 -- scripts/qemuimage-tests/sanity/rpm_query | 52 -- scripts/qemuimage-tests/sanity/scp | 71 -- scripts/qemuimage-tests/sanity/shutdown | 76 --- scripts/qemuimage-tests/sanity/smart_help | 52 -- scripts/qemuimage-tests/sanity/smart_query | 52 -- scripts/qemuimage-tests/sanity/ssh | 39 -- .../scenario/qemuarm/core-image-lsb | 7 - .../scenario/qemuarm/core-image-minimal | 1 - .../scenario/qemuarm/core-image-sato | 11 - .../scenario/qemuarm/core-image-sato-sdk | 12 - .../scenario/qemuarm/meta-toolchain-gmae | 3 - .../scenario/qemumips/core-image-lsb | 7 - .../scenario/qemumips/core-image-minimal | 1 - .../scenario/qemumips/core-image-sato | 11 - .../scenario/qemumips/core-image-sato-sdk | 12 - .../scenario/qemumips/meta-toolchain-gmae | 3 - .../scenario/qemuppc/core-image-lsb | 7 - .../scenario/qemuppc/core-image-minimal | 1 - .../scenario/qemuppc/core-image-sato | 11 - .../scenario/qemuppc/core-image-sato-sdk | 12 - .../scenario/qemuppc/meta-toolchain-gmae | 3 - .../scenario/qemux86-64/core-image-lsb | 7 - .../scenario/qemux86-64/core-image-minimal | 1 - .../scenario/qemux86-64/core-image-sato | 11 - .../scenario/qemux86-64/core-image-sato-sdk | 12 - .../scenario/qemux86-64/meta-toolchain-gmae | 3 - .../scenario/qemux86/core-image-lsb | 7 - .../scenario/qemux86/core-image-minimal | 1 - .../scenario/qemux86/core-image-sato | 11 - .../scenario/qemux86/core-image-sato-sdk | 12 - .../scenario/qemux86/meta-toolchain-gmae | 3 - scripts/qemuimage-tests/systemusage/bash | 53 -- scripts/qemuimage-tests/systemusage/df | 54 -- scripts/qemuimage-tests/systemusage/syslog | 54 -- scripts/qemuimage-tests/toolchain/cvs | 31 - scripts/qemuimage-tests/toolchain/iptables | 31 - scripts/qemuimage-tests/toolchain/sudoku-savant | 31 - scripts/qemuimage-tests/tools/bash.sh | 17 - scripts/qemuimage-tests/tools/compiler_test.sh | 137 ---- scripts/qemuimage-tests/tools/connman_test.sh | 75 -- scripts/qemuimage-tests/tools/df.sh | 25 - scripts/qemuimage-tests/tools/dmesg.sh | 28 - scripts/qemuimage-tests/tools/rpm_test.sh | 45 -- scripts/qemuimage-tests/tools/smart_test.sh | 45 -- scripts/qemuimage-tests/tools/syslog.sh | 17 - 54 files changed, 2411 deletions(-) delete mode 100644 meta/classes/imagetest-qemu.bbclass delete mode 100755 scripts/qemuimage-testlib delete mode 100755 scripts/qemuimage-testlib-pythonhelper delete mode 100755 scripts/qemuimage-tests/sanity/boot delete mode 100755 scripts/qemuimage-tests/sanity/compiler delete mode 100755 scripts/qemuimage-tests/sanity/connman delete mode 100755 scripts/qemuimage-tests/sanity/dmesg delete mode 100755 scripts/qemuimage-tests/sanity/rpm_query delete mode 100755 scripts/qemuimage-tests/sanity/scp delete mode 100755 scripts/qemuimage-tests/sanity/shutdown delete mode 100755 scripts/qemuimage-tests/sanity/smart_help delete mode 100755 scripts/qemuimage-tests/sanity/smart_query delete mode 100755 scripts/qemuimage-tests/sanity/ssh delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemuarm/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemumips/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemuppc/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemux86-64/meta-toolchain-gmae delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-lsb delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-minimal delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-sato delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk delete mode 100644 scripts/qemuimage-tests/scenario/qemux86/meta-toolchain-gmae delete mode 100755 scripts/qemuimage-tests/systemusage/bash delete mode 100755 scripts/qemuimage-tests/systemusage/df delete mode 100755 scripts/qemuimage-tests/systemusage/syslog delete mode 100755 scripts/qemuimage-tests/toolchain/cvs delete mode 100755 scripts/qemuimage-tests/toolchain/iptables delete mode 100755 scripts/qemuimage-tests/toolchain/sudoku-savant delete mode 100644 scripts/qemuimage-tests/tools/bash.sh delete mode 100644 scripts/qemuimage-tests/tools/compiler_test.sh delete mode 100644 scripts/qemuimage-tests/tools/connman_test.sh delete mode 100644 scripts/qemuimage-tests/tools/df.sh delete mode 100644 scripts/qemuimage-tests/tools/dmesg.sh delete mode 100644 scripts/qemuimage-tests/tools/rpm_test.sh delete mode 100644 scripts/qemuimage-tests/tools/smart_test.sh delete mode 100644 scripts/qemuimage-tests/tools/syslog.sh
meta/classes/imagetest-qemu.bbclass deleted +0 -238
@@ -1,238 +0,0 @@ -# Test related variables -# By default, TEST_DIR is created under WORKDIR -TEST_DIR ?= "${WORKDIR}/qemuimagetest" -TEST_LOG ?= "${LOG_DIR}/qemuimagetests" -TEST_RESULT ?= "${TEST_DIR}/result" -TEST_TMP ?= "${TEST_DIR}/tmp" -TEST_SCEN ?= "sanity" -TEST_STATUS ?= "${TEST_TMP}/status" -TARGET_IPSAVE ?= "${TEST_TMP}/target_ip" -TEST_SERIALIZE ?= "1" - -python do_qemuimagetest() { - qemuimagetest_main(d) -} -addtask qemuimagetest before do_build after do_rootfs -do_qemuimagetest[nostamp] = "1" -do_qemuimagetest[depends] += "qemu-native:do_populate_sysroot" - -python do_qemuimagetest_standalone() { - qemuimagetest_main(d) -} -addtask qemuimagetest_standalone -do_qemuimagetest_standalone[nostamp] = "1" -do_qemuimagetest_standalone[depends] += "qemu-native:do_populate_sysroot" - -def qemuimagetest_main(d): - import sys - import re - import shutil - import subprocess - - """ - Test Controller for automated testing. - """ - - casestr = re.compile(r'(?P<scen>\w+\b):(?P<case>\S+$)') - resultstr = re.compile(r'\s*(?P<case>\w+)\s*(?P<pass>\d+)\s*(?P<fail>\d+)\s*(?P<noresult>\d+)') - machine = d.getVar('MACHINE', True) - pname = d.getVar('PN', True) - allfstypes = d.getVar("IMAGE_FSTYPES", True).split() - testfstypes = [ "ext2", "ext3", "ext4", "jffs2", "btrfs" ] - - """function to save test cases running status""" - def teststatus(test, status, index, length): - test_status = d.getVar('TEST_STATUS', True) - if not os.path.exists(test_status): - raise bb.build.FuncFailed("No test status file existing under TEST_TMP") - - f = open(test_status, "w") - f.write("\t%-15s%-15s%-15s%-15s\n" % ("Case", "Status", "Number", "Total")) - f.write("\t%-15s%-15s%-15s%-15s\n" % (case, status, index, length)) - f.close() - - """funtion to run each case under scenario""" - def runtest(scen, case, fulltestpath, fstype): - resultpath = d.getVar('TEST_RESULT', True) - tmppath = d.getVar('TEST_TMP', True) - - """initialize log file for testcase""" - logpath = d.getVar('TEST_LOG', True) - bb.utils.mkdirhier("%s/%s" % (logpath, scen)) - caselog = os.path.join(logpath, "%s/log_%s.%s" % (scen, case, d.getVar('DATETIME', True))) - subprocess.call("touch %s" % caselog, shell=True) - - """export TEST_TMP, TEST_RESULT, DEPLOY_DIR and QEMUARCH""" - os.environ["PATH"] = d.getVar("PATH", True) - os.environ["TEST_TMP"] = tmppath - os.environ["TEST_RESULT"] = resultpath - os.environ["DEPLOY_DIR"] = d.getVar("DEPLOY_DIR", True) - os.environ["QEMUARCH"] = machine - os.environ["QEMUTARGET"] = pname - os.environ["COREBASE"] = d.getVar("COREBASE", True) - os.environ["TOPDIR"] = d.getVar("TOPDIR", True) - os.environ["OE_TMPDIR"] = d.getVar("TMPDIR", True) - os.environ["TEST_STATUS"] = d.getVar("TEST_STATUS", True) - os.environ["TARGET_IPSAVE"] = d.getVar("TARGET_IPSAVE", True) - os.environ["TEST_SERIALIZE"] = d.getVar("TEST_SERIALIZE", True) - os.environ["SDK_NAME"] = d.getVar("SDK_NAME", True) - os.environ["RUNQEMU_LOGFILE"] = d.expand("${T}/log.runqemutest.%s" % os.getpid()) - os.environ["ROOTFS_EXT"] = fstype - - # Add in all variables from the user's original environment which - # haven't subsequntly been set/changed - origbbenv = d.getVar("BB_ORIGENV", False) or {} - for key in origbbenv: - if key in os.environ: - continue - value = origbbenv.getVar(key, True) - if value is not None: - os.environ[key] = str(value) - - """run Test Case""" - bb.note("Run %s test in scenario %s" % (case, scen)) - subprocess.call("%s" % fulltestpath, shell=True) - - """function to check testcase list and remove inappropriate cases""" - def check_list(list): - final_list = [] - for test in list: - (scen, case, fullpath) = test - - """Skip rpm/smart if package_rpm not set for PACKAGE_CLASSES""" - if case.find("smart") != -1 or case.find("rpm") != -1: - if d.getVar("PACKAGE_CLASSES", True).find("rpm", 0, 11) == -1: - bb.note("skip rpm/smart cases since package_rpm not set in PACKAGE_CLASSES") - continue - else: - final_list.append((scen, case, fullpath)) - else: - final_list.append((scen, case, fullpath)) - - if not final_list: - raise bb.build.FuncFailed("There is no suitable testcase for this target") - - return final_list - - """Generate testcase list in runtime""" - def generate_list(testlist): - list = [] - final_list = [] - if len(testlist) == 0: - raise bb.build.FuncFailed("No testcase defined in TEST_SCEN") - - """check testcase folder and add case list according to TEST_SCEN""" - for item in testlist.split(" "): - n = casestr.match(item) - if n: - item = n.group('scen') - casefile = n.group('case') - for dir in d.getVar("QEMUIMAGETESTS", True).split(): - fulltestcase = os.path.join(dir, item, casefile) - if not os.path.isfile(fulltestcase): - raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase) - list.append((item, casefile, fulltestcase)) - else: - for dir in d.getVar("QEMUIMAGETESTS", True).split(): - scenlist = os.path.join(dir, "scenario", machine, pname) - if not os.path.isfile(scenlist): - raise bb.build.FuncFailed("No scenario list file named %s found" % scenlist) - - f = open(scenlist, "r") - for line in f: - if item != line.split()[0]: - continue - else: - casefile = line.split()[1] - - fulltestcase = os.path.join(dir, item, casefile) - if not os.path.isfile(fulltestcase): - raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase) - list.append((item, casefile, fulltestcase)) - f.close() - final_list = check_list(list) - return final_list - - """Clean tmp folder for testing""" - def clean_tmp(): - tmppath = d.getVar('TEST_TMP', True) - - if os.path.isdir(tmppath): - for f in os.listdir(tmppath): - tmpfile = os.path.join(tmppath, f) - if os.path.isfile(tmpfile): - os.remove(tmpfile) - elif os.path.isdir(tmpfile): - shutil.rmtree(tmpfile, True) - - """Before running testing, clean temp folder first""" - clean_tmp() - - """check testcase folder and create test log folder""" - testpath = d.getVar('TEST_DIR', True) - bb.utils.mkdirhier(testpath) - - logpath = d.getVar('TEST_LOG', True) - bb.utils.mkdirhier(logpath) - - tmppath = d.getVar('TEST_TMP', True) - bb.utils.mkdirhier(tmppath) - - """initialize test status file""" - test_status = d.getVar('TEST_STATUS', True) - if os.path.exists(test_status): - os.remove(test_status) - subprocess.call("touch %s" % test_status, shell=True) - - """initialize result file""" - resultpath = d.getVar('TEST_RESULT', True) - bb.utils.mkdirhier(resultpath) - resultfile = os.path.join(resultpath, "testresult.%s" % d.getVar('DATETIME', True)) - sresultfile = os.path.join(resultpath, "testresult.log") - - machine = d.getVar('MACHINE', True) - - if os.path.exists(sresultfile): - os.remove(sresultfile) - subprocess.call("touch %s" % resultfile, shell=True) - os.symlink(resultfile, sresultfile) - - """generate pre-defined testcase list""" - testlist = d.getVar('TEST_SCEN', True) - fulllist = generate_list(testlist) - - """Begin testing""" - for fstype in allfstypes: - if fstype in testfstypes: - with open(sresultfile, "a") as f: - f.write("\tTest Result for %s %s %s\n" % (machine, pname, fstype)) - f.write("\t%-15s%-15s%-15s%-15s\n" % ("Testcase", "PASS", "FAIL", "NORESULT")) - for index,test in enumerate(fulllist): - (scen, case, fullpath) = test - teststatus(case, "running", index, (len(fulllist) - 1)) - runtest(scen, case, fullpath, fstype) - teststatus(case, "finished", index, (len(fulllist) - 1)) - - """Print Test Result""" - ret = 0 - f = open(sresultfile, "r") - for line in f: - m = resultstr.match(line) - if m: - if m.group('fail') == "1": - ret = 1 - elif m.group('noresult') == "1": - ret = 2 - line = line.strip('\n') - bb.note(line) - else: - line = line.strip('\n') - bb.note(line) - f.close() - - """Clean temp files for testing""" - clean_tmp() - - if ret != 0: - raise bb.build.FuncFailed("Some tests failed. Please check the results file: %s and the log files found in: %s." % (resultfile, d.getVar('TEST_LOG', True))) -
meta/classes/populate_sdk_base.bbclass +0 -3
@@ -1,9 +1,6 @@ inherit meta toolchain-scripts inherit populate_sdk_${IMAGE_PKGTYPE} -IMAGETESTCLASS = "${@oe.utils.ifelse(d.getVar('IMAGETEST'),'imagetest-' + (d.getVar('IMAGETEST') or ""),'')}" -inherit ${IMAGETESTCLASS} - SDK_DIR = "${WORKDIR}/sdk" SDK_OUTPUT = "${SDK_DIR}/image" SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
meta/conf/layer.conf +0 -3
@@ -14,9 +14,6 @@ LAYERVERSION_core = "3" # Set a variable to get to the top of the metadata location COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}' -# Set path to qemu image tests included in this layer -QEMUIMAGETESTS = "${COREBASE}/scripts/qemuimage-tests" - SIGGEN_EXCLUDERECIPES_ABISAFE += " \ sysvinit-inittab \ shadow-securetty \
scripts/qemuimage-testlib deleted +0 -760
760 lines not on this page · raw message
scripts/qemuimage-testlib-pythonhelper deleted +0 -66
66 lines not on this page · raw message
scripts/qemuimage-tests/sanity/boot deleted +0 -29
@@ -1,29 +0,0 @@ -#!/bin/bash -# -# Boot Test Case for Sanity Test -# The case boot up the Qemu target with `runqemu qemuxxx`. -# Then check if qemu and qemu network is up. -# -# Author: Jiajun Xu <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# -. $COREBASE/scripts/qemuimage-testlib - -TIMEOUT=400 - -# Start qemu and check its network -Test_Create_Qemu ${TIMEOUT} - -if [ $? -eq 0 ]; then - Test_Info "Boot Test PASS" - Test_Kill_Qemu - Test_Print_Result "Boot" 0 - exit 0 -else - Test_Info "Boot Test FAIL" - Test_Kill_Qemu - Test_Print_Result "Boot" 1 - exit 1 -fi
scripts/qemuimage-tests/sanity/compiler deleted +0 -52
52 lines not on this page · raw message
scripts/qemuimage-tests/sanity/connman deleted +0 -53
53 lines not on this page · raw message
scripts/qemuimage-tests/sanity/dmesg deleted +0 -52
52 lines not on this page · raw message
scripts/qemuimage-tests/sanity/rpm_query deleted +0 -52
52 lines not on this page · raw message
scripts/qemuimage-tests/sanity/scp deleted +0 -71
71 lines not on this page · raw message
scripts/qemuimage-tests/sanity/shutdown deleted +0 -76
76 lines not on this page · raw message
scripts/qemuimage-tests/sanity/smart_help deleted +0 -52
52 lines not on this page · raw message
scripts/qemuimage-tests/sanity/smart_query deleted +0 -52
52 lines not on this page · raw message
scripts/qemuimage-tests/sanity/ssh deleted +0 -39
@@ -1,39 +0,0 @@ -#!/bin/bash -# SSH Test Case for Sanity Test -# The case boot up the Qemu target with `runqemu qemuxxx`. -# Then check if ssh service in qemu is up. -# -# Author: Jiajun Xu <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -. $COREBASE/scripts/qemuimage-testlib - -TIMEOUT=400 -RET=1 - -# Start qemu and check its network -Test_Create_Qemu ${TIMEOUT} - -# If qemu network is up, check ssh service in qemu -if [ $? -eq 0 ]; then - Test_Info "Begin to Test SSH Service in Qemu" - Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} - RET=$? -else - RET=1 -fi - -if [ ${RET} -eq 0 ]; then - Test_Info "SSH Test PASS" - Test_Kill_Qemu - Test_Print_Result "SSH" 0 - exit 0 -else - Test_Info "SSH Test FAIL" - Test_Kill_Qemu - Test_Print_Result "SSH" 1 - exit 1 -fi
scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb deleted +0 -7
@@ -1,7 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity dmesg -sanity shutdown
scripts/qemuimage-tests/scenario/qemuarm/core-image-minimal deleted +0 -1
@@ -1 +0,0 @@ -sanity boot
scripts/qemuimage-tests/scenario/qemuarm/core-image-sato deleted +0 -11
@@ -1,11 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk deleted +0 -12
@@ -1,12 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity compiler -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemuarm/meta-toolchain-gmae deleted +0 -3
@@ -1,3 +0,0 @@ -toolchain cvs -toolchain iptables -toolchain sudoku-savant
scripts/qemuimage-tests/scenario/qemumips/core-image-lsb deleted +0 -7
@@ -1,7 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity dmesg -sanity shutdown
scripts/qemuimage-tests/scenario/qemumips/core-image-minimal deleted +0 -1
@@ -1 +0,0 @@ -sanity boot
scripts/qemuimage-tests/scenario/qemumips/core-image-sato deleted +0 -11
@@ -1,11 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk deleted +0 -12
@@ -1,12 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity compiler -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemumips/meta-toolchain-gmae deleted +0 -3
@@ -1,3 +0,0 @@ -toolchain cvs -toolchain iptables -toolchain sudoku-savant
scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb deleted +0 -7
@@ -1,7 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity dmesg -sanity shutdown
scripts/qemuimage-tests/scenario/qemuppc/core-image-minimal deleted +0 -1
@@ -1 +0,0 @@ -sanity boot
scripts/qemuimage-tests/scenario/qemuppc/core-image-sato deleted +0 -11
@@ -1,11 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk deleted +0 -12
@@ -1,12 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity compiler -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemuppc/meta-toolchain-gmae deleted +0 -3
@@ -1,3 +0,0 @@ -toolchain cvs -toolchain iptables -toolchain sudoku-savant
scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb deleted +0 -7
@@ -1,7 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity dmesg -sanity shutdown
scripts/qemuimage-tests/scenario/qemux86-64/core-image-minimal deleted +0 -1
@@ -1 +0,0 @@ -sanity boot
scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato deleted +0 -11
@@ -1,11 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk deleted +0 -12
@@ -1,12 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity compiler -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemux86-64/meta-toolchain-gmae deleted +0 -3
@@ -1,3 +0,0 @@ -toolchain cvs -toolchain iptables -toolchain sudoku-savant
scripts/qemuimage-tests/scenario/qemux86/core-image-lsb deleted +0 -7
@@ -1,7 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity dmesg -sanity shutdown
scripts/qemuimage-tests/scenario/qemux86/core-image-minimal deleted +0 -1
@@ -1 +0,0 @@ -sanity boot
scripts/qemuimage-tests/scenario/qemux86/core-image-sato deleted +0 -11
@@ -1,11 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk deleted +0 -12
@@ -1,12 +0,0 @@ -sanity ssh -sanity scp -sanity smart_help -sanity smart_query -sanity rpm_query -sanity compiler -sanity connman -sanity dmesg -sanity shutdown -systemusage bash -systemusage df -systemusage syslog
scripts/qemuimage-tests/scenario/qemux86/meta-toolchain-gmae deleted +0 -3
@@ -1,3 +0,0 @@ -toolchain cvs -toolchain iptables -toolchain sudoku-savant
scripts/qemuimage-tests/systemusage/bash deleted +0 -53
53 lines not on this page · raw message
scripts/qemuimage-tests/systemusage/df deleted +0 -54
54 lines not on this page · raw message
scripts/qemuimage-tests/systemusage/syslog deleted +0 -54
54 lines not on this page · raw message
scripts/qemuimage-tests/toolchain/cvs deleted +0 -31
@@ -1,31 +0,0 @@ -#!/bin/bash -# -# CVS compile Test for toolchain test -# The case extract toolchain tarball into temp folder -# Then compile CVS with the toolchain environment -# -# Author: Jiajun Xu <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# -. $COREBASE/scripts/qemuimage-testlib - -TIMEOUT=120 - -# Extract and test toolchain tarball -Test_Toolchain cvs ${TIMEOUT} - -if [ $? -eq 0 ]; then - Test_Info "CVS Test PASS" - Test_Print_Result "CVS" 0 - exit 0 -elif [ $? -eq 1 ]; then - Test_Info "CVS Test FAIL" - Test_Print_Result "CVS" 1 - exit 1 -else - Test_Info "Skip CVS Test due to some configuration problem" - Test_Print_Result "CVS" 2 - exit 2 -fi
scripts/qemuimage-tests/toolchain/iptables deleted +0 -31
@@ -1,31 +0,0 @@ -#!/bin/bash -# -# iptables compile Test for toolchain test -# The case extract toolchain tarball into temp folder -# Then compile iptables with the toolchain environment -# -# Author: Jiajun Xu <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# -. $COREBASE/scripts/qemuimage-testlib - -TIMEOUT=120 - -# Extract and test toolchain tarball -Test_Toolchain iptables ${TIMEOUT} - -if [ $? -eq 0 ]; then - Test_Info "iptables Test PASS" - Test_Print_Result "iptables" 0 - exit 0 -elif [ $? -eq 1 ]; then - Test_Info "iptables Test FAIL" - Test_Print_Result "iptables" 1 - exit 1 -else - Test_Info "Skip iptables Test due to some configuration problem" - Test_Print_Result "iptables" 2 - exit 2 -fi
scripts/qemuimage-tests/toolchain/sudoku-savant deleted +0 -31
@@ -1,31 +0,0 @@ -#!/bin/bash -# -# sudoku-savant compile Test for toolchain test -# The case extract toolchain tarball into temp folder -# Then compile sudoku-savant with the toolchain environment -# -# Author: Jiajun Xu <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# -. $COREBASE/scripts/qemuimage-testlib - -TIMEOUT=240 - -# Extract and test toolchain tarball -Test_Toolchain sudoku-savant ${TIMEOUT} - -if [ $? -eq 0 ]; then - Test_Info "sudoku-savant Test PASS" - Test_Print_Result "sudoku-savant" 0 - exit 0 -elif [ $? -eq 1 ]; then - Test_Info "sudoku-savant Test FAIL" - Test_Print_Result "sudoku-savant" 1 - exit 1 -else - Test_Info "Skip sudoku-savant Test due to some configuration problem" - Test_Print_Result "sudoku-savant" 2 - exit 2 -fi
scripts/qemuimage-tests/tools/bash.sh deleted +0 -17
@@ -1,17 +0,0 @@ -#!/bin/sh -# bash test script running in qemu -# -# Author: veera <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -which bash -if [ $? -eq 0 ]; then - echo "QEMU: bash is exist in the target by default" - exit 0 -else - echo "QEMU: No bash command in the qemu target" - exit 1 -fi
scripts/qemuimage-tests/tools/compiler_test.sh deleted +0 -137
137 lines not on this page · raw message
scripts/qemuimage-tests/tools/connman_test.sh deleted +0 -75
75 lines not on this page · raw message
scripts/qemuimage-tests/tools/df.sh deleted +0 -25
@@ -1,25 +0,0 @@ -#!/bin/bash -# df test script to check enough disk space for qemu target -# -# Author: veera <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -#taking the size of the each partition -array_list=(`df -P | tr -s " " | cut -d " " -f4`) -#Total size of the array -array_size=`echo ${#array_list[@]}` -loop_val=1 -#while loop to check the size of partitions are less than 5MB -while [ $loop_val -lt $array_size ] -do - #taking each value from the array to check the size - value=`echo ${array_list[$loop_val]}` - if [[ $value -gt 5120 ]];then - loop_val=`expr $loop_val + 1` - else - echo "QEMU: df : disk space is not enough" - exit 1 - fi -done -exit 0
scripts/qemuimage-tests/tools/dmesg.sh deleted +0 -28
@@ -1,28 +0,0 @@ -#!/bin/bash -# Dmesg test script running in QEMU -# -# Author: Jiajun Xu <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -which dmesg -if [ $? -ne 0 ]; then - echo "QEMU: No dmesg command found" - exit 1 -fi - -# For now, ignore mmci-pl18x errors on qemuarm which appeared -# from the 3.8 kernel and are harmless -dmesg | grep -v mmci-pl18x | grep -iq "error" -if [ $? -eq 0 ]; then - echo "QEMU: There is some error log in dmesg:" - echo "QEMU: ##### Error Log ######" - dmesg | grep -i "error" - echo "QEMU: ##### End ######" - exit 1 -else - echo "QEMU: No error log in dmesg" - exit 0 -fi
scripts/qemuimage-tests/tools/rpm_test.sh deleted +0 -45
45 lines not on this page · raw message
scripts/qemuimage-tests/tools/smart_test.sh deleted +0 -45
45 lines not on this page · raw message
scripts/qemuimage-tests/tools/syslog.sh deleted +0 -17
@@ -1,17 +0,0 @@ -#!/bin/bash -# syslog test script running in qemu -# -# Author: veera <[email protected]> -# -# This file is licensed under the GNU General Public License, -# Version 2. -# - -ps aux | grep -w syslogd | grep -v grep -if [ $? -eq 0 ]; then - echo "QEMU: syslogd is running by default" - exit 0 -else - echo "QEMU: syslogd is not running" - exit 1 -fi
Signature · 1 line
1.8.1.2
Re: [PATCH 2/5] classes/testimage-auto: add class to allow automatically running image tests
In reply to Paul EggletonQuoted 1 line · On Friday 20 September 2013 10:27:50 Paul Eggleton wrote:
+do_testimage_auto[nostamp] = "1"
Oops, this is erroneous; I have removed it on the branch.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre