Bug 594 - Display an error when IMAGETEST is set but DISPLAY is not.
Summary: Display an error when IMAGETEST is set but DISPLAY is not.
Status: VERIFIED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.0 M3
Assignee: Jiajun Xu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2010-12-14 13:23 UTC by Scott Garman
Modified: 2011-04-18 15:59 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Garman 2010-12-14 13:23:33 UTC
Because the qemu sanity tests need to open windows under Xorg, the DISPLAY variable needs to be set. If IMAGETEST is set in local.conf but DISPLAY is not, the following python error will occur:

Source: http://autobuilder.pokylinux.org:8010/builders/poky-incremental/builds/29/steps/shell_20/logs/stdio

NOTE: package poky-image-lsb-1.0-r0: task do_qemuimagetest: Started
ERROR: There was an error when executing a python function in: /builds1/pokybuild/poky-slave/poky-incremental/build/meta/recipes-extended/images/poky-image-lsb.bb
ERROR: Exception:<type 'exceptions.TypeError'> Message:putenv() argument 2 must be string, not None
ERROR: The stack trace of python calls that resulted in thie exception/failure was:
ERROR:   File "do_qemuimagetest", line 4, in <module>
ERROR: 
ERROR:   File "do_qemuimagetest", line 2, in do_qemuimagetest
ERROR: 
ERROR:   File "imagetest-qemu.bbclass", line 111, in qemuimagetest_main
ERROR: 
ERROR:   File "imagetest-qemu.bbclass", line 34, in runtest
ERROR: 
ERROR:   File "/usr/lib64/python2.6/os.py", line 471, in __setitem__
ERROR:     putenv(key, item)
ERROR: 
ERROR: The code that was being executed was:
ERROR:      0001:def do_qemuimagetest(d):
ERROR:      0002:    qemuimagetest_main(d)
ERROR:      0003:
ERROR:  *** 0004:do_qemuimagetest(d)
ERROR: (file: 'do_qemuimagetest', lineno: 4, function: <module>)
ERROR:      0001:def do_qemuimagetest(d):
ERROR:  *** 0002:    qemuimagetest_main(d)
ERROR:      0003:
ERROR:      0004:do_qemuimagetest(d)
ERROR: (file: 'do_qemuimagetest', lineno: 2, function: do_qemuimagetest)
ERROR: Task failed: ('Function do_qemuimagetest failed', '/builds1/pokybuild/poky-slave/poky-incremental/build/build/tmp/work/qemuarm-poky-linux-gnueabi/poky-image-lsb-1.0-r0/temp/log.do_qemuimagetest.5017')
ERROR: Logfile of failure stored in: /builds1/pokybuild/poky-slave/poky-incremental/build/build/tmp/work/qemuarm-poky-linux-gnueabi/poky-image-lsb-1.0-r0/temp/log.do_qemuimagetest.5017
Log data follows:
| ERROR: There was an error when executing a python function in: /builds1/pokybuild/poky-slave/poky-incremental/build/meta/recipes-extended/images/poky-image-lsb.bb
| ERROR: Exception:<type 'exceptions.TypeError'> Message:putenv() argument 2 must be string, not None
| ERROR: The stack trace of python calls that resulted in thie exception/failure was:
| ERROR:   File "do_qemuimagetest", line 4, in <module>
| ERROR:
| ERROR:   File "do_qemuimagetest", line 2, in do_qemuimagetest
| ERROR:
| ERROR:   File "imagetest-qemu.bbclass", line 111, in qemuimagetest_main
| ERROR:
| ERROR:   File "imagetest-qemu.bbclass", line 34, in runtest
| ERROR:
| ERROR:   File "/usr/lib64/python2.6/os.py", line 471, in __setitem__
| ERROR:     putenv(key, item)
| ERROR:
| ERROR: The code that was being executed was:
| ERROR:      0001:def do_qemuimagetest(d):
| ERROR:      0002:    qemuimagetest_main(d)
| ERROR:      0003:
| ERROR:  *** 0004:do_qemuimagetest(d)
| ERROR: (file: 'do_qemuimagetest', lineno: 4, function: <module>)
| ERROR:      0001:def do_qemuimagetest(d):
| ERROR:  *** 0002:    qemuimagetest_main(d)
| ERROR:      0003:
| ERROR:      0004:do_qemuimagetest(d)
| ERROR: (file: 'do_qemuimagetest', lineno: 2, function: do_qemuimagetest)
| ERROR: Task failed: ('Function do_qemuimagetest failed', '/builds1/pokybuild/poky-slave/poky-incremental/build/build/tmp/work/qemuarm-poky-linux-gnueabi/poky-image-lsb-1.0-r0/temp/log.do_qemuimagetest.5017')

To fix this, Richard suggested that we should error out immediately if this condition is detected. This is something that could be added to sanity.bbclass.
Comment 1 Ke Yu 2010-12-16 18:04:35 UTC
Fixed in commit b99fd0374e554f4d2183f349f271220951299c9a
Comment 2 Scott Garman 2011-04-18 15:59:35 UTC
Verified that the following error is displayed when IMAGETEST is set but DISPLAY is not:

"qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)"