qemuimagetest: Use the same image in sanity testing to fix the timeout issue on autobuilder
cover qemuimagetest: Use the same image in sanity testing to fix the timeout issue on autobuilder
Fixes [BUGID #595]
Because of the QEMU booting slowness issue(see bug #646 and #618), autobuilder is suffering a timeout issue when running sanity test. We introduce variable SHARE_IMAGE here to fix the issue. It is by default set to 1. Poky will copy latest built-out image and keep using it in sanity testing. If it is set to 0, latest built-out image will be copied and tested for each case, which will take much time.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: jxu49/master
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/master
Thanks,
Jiajun Xu <[email protected]>
---
Jiajun Xu (1):
qemuimagetest: Use the same image in sanity testing to fix the
timeout issue on autobuilder
meta/classes/imagetest-qemu.bbclass | 22 +++++++++++++++++-- meta/conf/local.conf.sample | 8 +++++++ scripts/qemuimage-testlib | 7 ++++++ scripts/qemuimage-tests/sanity/compiler | 2 +- scripts/qemuimage-tests/sanity/connman | 2 +- scripts/qemuimage-tests/sanity/dmesg | 2 +- scripts/qemuimage-tests/sanity/rpm_query | 2 +- scripts/qemuimage-tests/sanity/scp | 2 +- scripts/qemuimage-tests/sanity/shutdown | 7 +++++- scripts/qemuimage-tests/sanity/ssh | 2 +- scripts/qemuimage-tests/sanity/zypper_help | 2 +- scripts/qemuimage-tests/sanity/zypper_search | 2 +- .../scenario/qemuarm/poky-image-lsb | 2 +- .../scenario/qemuarm/poky-image-sato | 2 +- .../scenario/qemuarm/poky-image-sdk | 2 +- .../scenario/qemumips/poky-image-lsb | 2 +- .../scenario/qemumips/poky-image-sato | 2 +- .../scenario/qemumips/poky-image-sdk | 2 +- .../scenario/qemuppc/poky-image-lsb | 2 +- .../scenario/qemuppc/poky-image-sato | 2 +- .../scenario/qemuppc/poky-image-sdk | 2 +- .../scenario/qemux86-64/poky-image-lsb | 2 +- .../scenario/qemux86-64/poky-image-sato | 2 +- .../scenario/qemux86-64/poky-image-sdk | 2 +- .../scenario/qemux86/poky-image-lsb | 2 +- .../scenario/qemux86/poky-image-sato | 2 +- .../scenario/qemux86/poky-image-sdk | 2 +- 27 files changed, 63 insertions(+), 27 deletions(-)
PATCH 1/1 qemuimagetest: Use the same image in sanity testing to fix the timeout issue on autobuilder
Fixes [BUGID #595]
Because of the QEMU booting slowness issue(see bug #646 and #618), autobuilder may suffer a timeout issue when running sanity test. We introduce variable SHARE_IMAGE here to fix the issue. It is by default set to 1. Poky will copy latest built-out image and keep using it in sanity testing. If it is set to 0, latest built-out image will be copied and tested for each case, which will take much time.
Signed-off-by Jiajun Xu <[email protected]>
--- meta/classes/imagetest-qemu.bbclass | 22 +++++++++++++++++-- meta/conf/local.conf.sample | 8 +++++++ scripts/qemuimage-testlib | 7 ++++++ scripts/qemuimage-tests/sanity/compiler | 2 +- scripts/qemuimage-tests/sanity/connman | 2 +- scripts/qemuimage-tests/sanity/dmesg | 2 +- scripts/qemuimage-tests/sanity/rpm_query | 2 +- scripts/qemuimage-tests/sanity/scp | 2 +- scripts/qemuimage-tests/sanity/shutdown | 7 +++++- scripts/qemuimage-tests/sanity/ssh | 2 +- scripts/qemuimage-tests/sanity/zypper_help | 2 +- scripts/qemuimage-tests/sanity/zypper_search | 2 +- .../scenario/qemuarm/poky-image-lsb | 2 +- .../scenario/qemuarm/poky-image-sato | 2 +- .../scenario/qemuarm/poky-image-sdk | 2 +- .../scenario/qemumips/poky-image-lsb | 2 +- .../scenario/qemumips/poky-image-sato | 2 +- .../scenario/qemumips/poky-image-sdk | 2 +- .../scenario/qemuppc/poky-image-lsb | 2 +- .../scenario/qemuppc/poky-image-sato | 2 +- .../scenario/qemuppc/poky-image-sdk | 2 +- .../scenario/qemux86-64/poky-image-lsb | 2 +- .../scenario/qemux86-64/poky-image-sato | 2 +- .../scenario/qemux86-64/poky-image-sdk | 2 +- .../scenario/qemux86/poky-image-lsb | 2 +- .../scenario/qemux86/poky-image-sato | 2 +- .../scenario/qemux86/poky-image-sdk | 2 +- 27 files changed, 63 insertions(+), 27 deletions(-)
meta/classes/imagetest-qemu.bbclass +19 -3
@@ -5,6 +5,7 @@ TEST_LOG ?= "${LOG_DIR}/qemuimagetests" TEST_RESULT ?= "${TEST_DIR}/result" TEST_TMP ?= "${TEST_DIR}/tmp" TEST_SCEN ?= "sanity" +SHARE_IMAGE ?= "1" python do_qemuimagetest() { qemuimagetest_main(d)
@@ -37,7 +38,7 @@ def qemuimagetest_main(d): """funtion to run each case under scenario""" def runtest(scen, case, fulltestpath): resultpath = bb.data.getVar('TEST_RESULT', d, 1) - testpath = bb.data.getVar('TEST_DIR', d, 1) + tmppath = bb.data.getVar('TEST_TMP', d, 1) """initialize log file for testcase""" logpath = bb.data.getVar('TEST_LOG', d, 1)
@@ -45,10 +46,9 @@ def qemuimagetest_main(d): caselog = os.path.join(logpath, "%s/log_%s.%s" % (scen, case, bb.data.getVar('DATETIME', d, 1))) os.system("touch %s" % caselog) - """export TEST_TMP, TEST_RESULT, DEPLOY_DIR and QEMUARCH""" os.environ["PATH"] = bb.data.getVar("PATH", d, True) - os.environ["TEST_TMP"] = testpath + os.environ["TEST_TMP"] = tmppath os.environ["TEST_RESULT"] = resultpath os.environ["DEPLOY_DIR"] = bb.data.getVar("DEPLOY_DIR", d, True) os.environ["QEMUARCH"] = machine
@@ -56,6 +56,7 @@ def qemuimagetest_main(d): os.environ["DISPLAY"] = bb.data.getVar("DISPLAY", d, True) os.environ["POKYBASE"] = bb.data.getVar("POKYBASE", d, True) os.environ["TOPDIR"] = bb.data.getVar("TOPDIR", d, True) + os.environ["SHARE_IMAGE"] = bb.data.getVar("SHARE_IMAGE", d, True) """run Test Case""" bb.note("Run %s test in scenario %s" % (case, scen))
@@ -97,6 +98,18 @@ def qemuimagetest_main(d): list.append((item, casefile, fulltestcase)) return list + """Clean tmp folder for testing""" + def clean_tmp(): + tmppath = bb.data.getVar('TEST_TMP', d, 1) + + if os.path.isdir(tmppath): + for f in os.listdir(tmppath): + tmpfile = os.path.join(tmppath, f) + os.remove(tmpfile) + + """Before running testing, clean temp folder first""" + clean_tmp() + """check testcase folder and create test log folder""" testpath = bb.data.getVar('TEST_DIR', d, 1) bb.utils.mkdirhier(testpath)
@@ -150,6 +163,9 @@ def qemuimagetest_main(d): bb.note(line) f.close() + """Clean temp files for testing""" + clean_tmp() + if ret != 0: raise bb.build.FuncFailed("Some testcases fail, pls. check test result and test log!!!")
meta/conf/local.conf.sample +8 -0
@@ -156,6 +156,14 @@ ENABLE_BINARY_LOCALE_GENERATION = "1" # list them like following. #TEST_SCEN = "sanity bat sanity:boot" +#Because of the QEMU booting slowness issue(see bug #646 and #618), autobuilder +#may suffer a timeout issue when running sanity test. We introduce variable +#SHARE_IMAGE here to fix the issue. It is by default set to 1. Poky will copy +#latest built-out image and keep using it in sanity testing. If it is set to 0, +#latest built-out image will be copied and tested for each case, which will take +#much time. +#SHARE_IMAGE = "1" + # Set GLIBC_GENERATE_LOCALES to the locales you wish to generate should you not # wish to perform the time-consuming step of generating all LIBC locales. # NOTE: If removing en_US.UTF-8 you will also need to uncomment, and set
scripts/qemuimage-testlib +7 -0
@@ -383,9 +383,16 @@ Test_Create_Qemu() TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3" CP=`which cp` + + # When SHARE_IMAGE is set, we use the existing image under tmp folder if [ -e "$TEST_ROOTFS_IMAGE" ]; then + if [ ${SHARE_IMAGE} -eq 1 ]; then + ROOTFS_IMAGE="$TEST_ROOTFS_IMAGE" + TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-shared-test.ext3" + fi rm -rf $TEST_ROOTFS_IMAGE fi + $CP $ROOTFS_IMAGE $TEST_ROOTFS_IMAGE if [ $? -ne 0 ]; then
scripts/qemuimage-tests/sanity/compiler +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/sanity/connman +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/sanity/dmesg +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/sanity/rpm_query +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/sanity/scp +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 SPID=0 i=0
scripts/qemuimage-tests/sanity/shutdown +6 -1
@@ -13,7 +13,12 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +if [ $SHARE_IMAGE -eq 0 ]; then + TIMEOUT=200 +elif [ $SHARE_IMAGE -eq 1 ]; then + TIMEOUT=500 +fi + RET=1 i=0
scripts/qemuimage-tests/sanity/ssh +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/sanity/zypper_help +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/sanity/zypper_search +1 -1
@@ -11,7 +11,7 @@ . $POKYBASE/scripts/qemuimage-testlib -TIMEOUT=360 +TIMEOUT=200 RET=1 # Start qemu and check its network
scripts/qemuimage-tests/scenario/qemuarm/poky-image-lsb +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemuarm/poky-image-sato +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemuarm/poky-image-sdk +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemumips/poky-image-lsb +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemumips/poky-image-sato +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemumips/poky-image-sdk +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemuppc/poky-image-lsb +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemuppc/poky-image-sato +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemuppc/poky-image-sdk +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemux86-64/poky-image-lsb +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sato +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemux86-64/poky-image-sdk +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemux86/poky-image-lsb +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemux86/poky-image-sato +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
scripts/qemuimage-tests/scenario/qemux86/poky-image-sdk +1 -1
@@ -1,8 +1,8 @@ +sanity shutdown sanity boot sanity ssh sanity scp sanity dmesg -sanity shutdown sanity zypper_help sanity zypper_search sanity rpm_query
Signature · 1 line
1.7.1
Saul Wold
AppliedQuoted 51 lines · Jiajun Xu
Fixes [BUGID #595]
Because of the QEMU booting slowness issue(see bug #646 and #618), autobuilder is suffering a timeout issue when running sanity test. We introduce variable
SHARE_IMAGEhere to fix the issue. It is by default set to 1. Poky will copy latest built-out image and keep using it in sanity testing. If it is set to 0, latest built-out image will be copied and tested for each case, which will take much time.Pull URL:
git://git.pokylinux.org/poky-contrib.git
Branch: jxu49/master
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/masterThanks,
Jiajun Xu<[email protected]>
---Jiajun Xu (1):
qemuimagetest: Use the same image in sanity testing to fix the
timeout issue on autobuildermeta/classes/imagetest-qemu.bbclass | 22 +++++++++++++++++-- meta/conf/local.conf.sample | 8 +++++++ scripts/qemuimage-testlib | 7 ++++++ scripts/qemuimage-tests/sanity/compiler | 2 +- scripts/qemuimage-tests/sanity/connman | 2 +- scripts/qemuimage-tests/sanity/dmesg | 2 +- scripts/qemuimage-tests/sanity/rpm_query | 2 +- scripts/qemuimage-tests/sanity/scp | 2 +- scripts/qemuimage-tests/sanity/shutdown | 7 +++++- scripts/qemuimage-tests/sanity/ssh | 2 +- scripts/qemuimage-tests/sanity/zypper_help | 2 +- scripts/qemuimage-tests/sanity/zypper_search | 2 +- .../scenario/qemuarm/poky-image-lsb | 2 +- .../scenario/qemuarm/poky-image-sato | 2 +- .../scenario/qemuarm/poky-image-sdk | 2 +- .../scenario/qemumips/poky-image-lsb | 2 +- .../scenario/qemumips/poky-image-sato | 2 +- .../scenario/qemumips/poky-image-sdk | 2 +- .../scenario/qemuppc/poky-image-lsb | 2 +- .../scenario/qemuppc/poky-image-sato | 2 +- .../scenario/qemuppc/poky-image-sdk | 2 +- .../scenario/qemux86-64/poky-image-lsb | 2 +- .../scenario/qemux86-64/poky-image-sato | 2 +- .../scenario/qemux86-64/poky-image-sdk | 2 +- .../scenario/qemux86/poky-image-lsb | 2 +- .../scenario/qemux86/poky-image-sato | 2 +- .../scenario/qemux86/poky-image-sdk | 2 +- 27 files changed, 63 insertions(+), 27 deletions(-)
Quoted 5 lines
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky
Merged into Master
Thanks
Sau!