Commit Graph

42 Commits

Author SHA1 Message Date
Stefan Stanacar a5f4e5fd99 qemuimage-testlib: change default directory for target tests
/tmp is a better location, and it allows copying files
on read only fs images

(From OE-Core rev: e3561c1cae467a4fb79723f83dea54d9d62adf7d)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16 00:23:37 +03:00
Stefan Stanacar c3fabef454 qemuimage-testlib: pass optional timeout to ssh function
Sometimes we need to change the timeout used by the function for
certain kinds of tests.

(From OE-Core rev: 21950ff5eb032fefc4753bd68af57f655d0c61f2)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16 00:23:37 +03:00
Stefan Stanacar 27069483c3 qemuimage-testlib: add support for extra arguments passed to runqemu
Some tests might want to pass extra arguments to runqemu.
I can think of "kvm" or qemuparams="-m 1024" when we want extra muscle.

(From OE-Core rev: 1a5446ca73736753d172c06dcb48858887c7a896)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16 00:23:37 +03:00
Stefan Stanacar cef2446eb3 imagetest-qemu.bbclass, qemuimage-testlib: add support for more FSTYPES
qemuimage-testlib hardcodes ext3 as fs type. This adds support for more
images types which are supported by runqemu: ext[234]/jffs2/btrfs.

I've skipped (for now) vmdk (which qemu can boot) because:
 - we don't have network on images without connman because of the way
runqemu starts vmdk images (can't pass kernel args for network config)
 - qemuimage-testlib-pythonhelper relies on '192.168' being in the output of
ps to return the pid

(From OE-Core rev: 95b7cafafcaa4dda7328632475003f5778ab95bd)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12 08:33:16 +01:00
Ross Burton 8f78158759 qemuimage-testlib: add function to fetch the remote syslog
Add a new function to scp from the target, and another to fetch
/var/log/messages and dump it to the console.

(From OE-Core rev: f94cb0d175309ad6b29598c57ba74cf1c3646661)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05 17:36:34 +01:00
Ross Burton 4b5001de2f qemuimage-testlib: silence some key warnings
Set StrictHostKeyChecking to no to silence the fingerprint warnings, and instead
of creating a temporary file for the known hosts and then deleting it just use
/dev/null.

(From OE-Core rev: 24e4a570eb527cff017386976296d5747c1adf57)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05 17:36:34 +01:00
Richard Purdie 2e1b95d5e3 scripts/qemuimage-testlib: Dump extra info if the network doesn't come up
(From OE-Core rev: db4a4cc8ba8082a27224a3e55fb5e8eb7de2bbe7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04 23:25:22 +01:00
Richard Purdie 92aeb31341 qemuimage-testlib: Fix quoting issue
(From OE-Core rev: c8b411608bea2700e904141268f609eeee542ae2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-30 17:26:56 +00:00
Richard Purdie de208eb812 qemuimage-testlib: Increase qemu startup timeouts
We are seeing timeouts on the autobuilder where qemu does start but the script
doesn't appear to be able to detect it in time. This patch increases the
timeouts since there seems little harm in doing so.

(From OE-Core rev: 53071c6b569067f98c558ee667bb1a4be0d8f6db)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-30 09:08:11 +00:00
Richard Purdie 1eb5214c98 qemuimage-testlib: Capture stderror in the logs as well as stdout
This allows error messages to be captured in the logs which is helpful.

(From OE-Core rev: 09a5fec50d622d338db5bd5516d29e4f4d0cec0d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-27 13:54:15 +00:00
Paul Eggleton 720492dd14 qemuimagetest: collect and print runqemu output
If runqemu (or qemu itself) fails we need to know why, so tee out to a
log file and print it when we can't find the qemu process or determine
its IP address.

(From OE-Core rev: 827106a57ca88760a19f9309d859b500c5c4fe97)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 17:50:09 +00:00
Paul Eggleton b45d63e2ec qemuimagetest: fix erroneous ps errors when qemu couldn't be started
The helper script was printing an error to stdout when it couldn't find
any qemu child processes; output this error to stderr instead and
redirect stderr to /dev/null when running from qemuimage-testlib so that
QEMUPID is actually blank if there are no qemu instances found.

(From OE-Core rev: 7c2137a07cca8e1d40d3c8b4b2c6321d80f2b1de)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 17:50:08 +00:00
Richard Purdie 6211a2bdd3 scripts/qemu-testlib: Add more debugging information
This extra information should allow better forensics if the sanity tests
fail as they're currently doing occasionaly on the autobuilder for unknown
reasons.

The patch also tightens up certain checks to remove pointless noise and
error output from the logs.

(From OE-Core rev: f9970aa0a44aca8ffe6c7a6a3261887fb0db38d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-21 17:05:15 +00:00
Richard Purdie 8207e3f48b qemuimage-testlib: Add extra debugging and sanity check
Check for a zero IP address since its clearly incorrect if that value
is found. Also add debugging for cases where we can't find the qemu
process. A process listing is handy to help understand what the problem
might be.

(From OE-Core rev: 817a8dc6424050973d8fad4f003475ac83ea6bb5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-20 11:53:06 +00:00
Richard Purdie a317cc911a qemuimage-testlib: Add delay to work around races in qemu startup
Qemu changes pid when starting up. On a loaded machine, this can result
in the incorrect pid being returned. Since qemu will take a few seconds to
boot anyway, we might as well delay a short while and allow things to settle
which should fix various race issues being seen on the autobuilder.

(From OE-Core rev: c0cecc16d4305b16ecfb4a51f6d5020d34909794)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-20 09:29:29 +00:00
Richard Purdie 808967b84c qemuimage-testlib: Fix IP address handling
Remove some pointless code and also fix the return handling
for the function since it returns null, not 0 as the comments
would suggest.

(From OE-Core rev: 6b8d7767ff14345af29d7774b7e16e29c3f7fa8e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19 23:35:01 +00:00
Richard Purdie 8852e51bdc scripts/qemutestlib: Add better process debugging and fix process group issue
In single testing with a shutdown scenario the processes are cleaned up correctly
but the manual cleanup fall back used for a minimal image do not work properly.
This patch fixes the kill commands to revert to non-process groups, fixing
the hung process issues that were occuring.

(From OE-Core rev: 6a0134fd4f1b64ef788be0791bd655dc7703d505)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19 20:58:11 +00:00
Richard Purdie 6c9743d9b9 qemu-testlib: Add python helper and simplify shell
The current code has a race since it greps for *any* qemu process
running, even if it isn't the one we started. This leads to some sanity
tests potentially failing on machines where multiple sets of sanity tests
are running.

To resovle this and some other ugly code issues, add a python script
to accurately walk the process tree and find the qemu process. We can
then replace all the shell functions attempting this which happen to
work in many cases but not all.

Also clean up some of the error handling so its more legible.

(From OE-Core rev: b9e052ed6b604f0049bcfa968a57f15d6e3d6395)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19 11:48:30 +00:00
Michael Halstead 7ed7eae878 scripts/qemuimage-testlib: Use wide option to ps calls
Forcing ps to display unlimited column width allows the qemu IP address to
be discovered during sanity testing when the command line is extremely long.

This seems to fix the sanity testing problem on AB05 which was recently updated
to OpenSUSE 12.2. I'm not sure what about qemu or process listing is different
on that distribution but this simpile fix seems to work and my help on other
distro's as well.

(From OE-Core rev: 4cea35cc4e4ed8e68cd117825b1dd4ef1be768c2)

Signed-off-by: Michael Halstead <michael@yoctoproject.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-13 16:52:30 +00:00
Yi Zhao ded4c8eea1 scripts/qemuimage-testlib: fix typos
(From OE-Core rev: 69f019c48b40ac3b7a8bce2da819f03072e78020)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-21 15:33:04 +00:00
Saul Wold d4a942fb51 qemuimage-testlib: rename qemuppc image
A recent set of changes changed the kernel name from bzImage to vmlinux,
this test needs to change also.

(From OE-Core rev: f11f03b27bd0bf41bcb45d0589d9982d006474d2)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-24 11:00:35 +00:00
Richard Purdie a3b987a2f7 scripts/qemuimage-testlib: Output a slightly better error if expect is missing
(From OE-Core rev: bfbbb420c0a6b315f73d3d5e463a518098ca6ef0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:17 +00:00
Paul Eggleton 7d1e1018f4 scripts: use OE_TMPDIR instead of TMPDIR external variable
On OpenSUSE within an X session, TMPDIR is set to the system temporary
directory (/tmp) which is incorrect for these scripts. Thus, change
runqemu and oe-setup-rpmrepo to use OE_TMPDIR from the external
environment rather than TMPDIR.

Fixes [YOCTO #1530]

(From OE-Core rev: 4e24c10952c7a52af7f2447595fd484692d35534)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28 21:41:43 +01:00
Richard Purdie 32bb9c3184 imagetest-qemu/runqueue: Since we no longer support BUILDDIR, use TMPDIR
Commit 993672fa2739794a6dd0dbd7bb232fa60522b897 removed the BUILDDIR
support from runqueue which broke the imagetest-qemu integration. We now
therefore need to set TMPDIR and pass this through the environment to
ensure the runqueue script finds the right locations without running
bitbake directly.

This patch also adds a sleep to the qemu command in the error case so that
this remains on the screen for a period of time so the user can see errors
more easily.

This change unbreaks automated testing failures on the autobuilder.

(From OE-Core rev: de470333dbdeea444199340e4cd458c13fed6a5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-09 18:39:26 +01:00
Jiajun Xu d08a341af7 qemuimagetest: update cvs and iptables to newer version for toolchain test
The old versions of cvs and iptables may meet compile error under some architecture
- cvs 1.11.23 fails on x86-64 host and iptables 1.4.9 fails on arm host. Update them
to latest version could solve these build error.
Meanwhile, 240s timeout is set for sudoku becasue 120s is not enough to finish
compile.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-24 11:28:32 +01:00
Jiajun Xu ea4857a98b qemuimagetest: Enable toolchain automation tests in qemuimagetest
Enable toolchain automation tests in qemuimagetest framework. 3 C/C++ test
projects are added to test toolchain - cvs, iptables and sudoku-savant. User
needs to set TEST_SCEN to "toolchain" in local.conf to enable tests. Test case
will check if toolchain tarball exists under "${DEPLOY_DIR}/sdk". And it will
extract toolchain tarball into /opt. It requires user to chown /opt to non-root
user, who will run qemuimagetest.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-04 00:56:33 +01:00
Richard Purdie 37ac9a0823 scripts/oe-setup-builddir: Fix up OE-Core/Poky mismatch for now (and fix permissions)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 19:19:33 +01:00
Richard Purdie 4d609d5021 Replace POKYBASE with COREBASE
(From OE-Core rev: 607a7657715f6fcba467a4e55ba64f41f4e13a15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:29 +01:00
Richard Purdie 08127d444e Rename poky-qemu to runqemu
(From OE-Core rev: 7687d91f73f4a116593315b3b1488ac3f0904905)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:29 +01:00
Jiajun Xu d2cfd3c54f qemuimagetest: Rename test scenario file from poky-image-sdk to poky-image-sato-sdk
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2011-02-10 15:27:50 +00:00
Jiajun Xu 3e052919c9 qemuimagetest: Use same image during sanity testing instead of copying a new image for each case
To reduce the time on sanity testing, we remove variable SHARE_IMAGE and use
a new variable TEST_SERIALIZE in local.conf. It is by default set to 1. Poky
will copy and boot the to-be tested image for only once. It will not remove
or kill the image and test cases will be serialized executed against the same
image. If it is set to 0, image is always be copied for each cases, which takes
much time. I had a experiment that latest qemuppc sato only takes 7 minutes to
finish 9 sanity test cases, which takes more than 20 minutes before.

I also removed sanity case "boot" from sato/sdk/lsb because the other cases for
these targets already cover the check point of "boot".

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2011-01-20 21:36:57 +00:00
Jiajun Xu 2119274314 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 <jiajun.xu@intel.com>
2011-01-14 08:09:26 -08:00
Jiajun Xu 601af9f8ea qemuimagetest: Remove connman test for lsb image and fix one warning in Test_Create_Qemu
There is no connman in LSB image. So we need to remove connman test from it.
And when we check if ip address fetched by Test_Fetch_Target_IP is valid,
we should use "==" operator for string comparison.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2011-01-06 10:06:32 +00:00
Richard Purdie cab983b0d0 qemuimage-testlib: Improve quoting causing problems under certain circumstances
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-24 01:03:47 +00:00
Richard Purdie 11833f7002 qemuimage-testlib: Fix the check for running qemu processes
Previously, any active command containing the word "qemu" including
in the command path would trigger a "success" result for detecting
the qemu process. This change fixes the check to search for commands
starting with "qemu" and ignores pathnames.

It also shortens the timeout for the qemu process to appear to 10
seconds. If it doesn't appear in that time there is always a problem.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-23 17:28:47 +00:00
Richard Purdie df74cf25f0 qemuimage-testlib: Ensure TOPDIR/BUILDDIR are set
The recent environment changes mean TOPDIR/BUILDDIR need to be exported
specifcially to the enviromnent so the qemu scripts can find the correct
build directory.

Without this, qemu can fail to run.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-23 17:27:14 +00:00
Jiajun Xu 236faced1d qemuimage-testlib: Add check for existence of image and correctness of ip address
Fixes [BUGID #612, #611]

Add check for existence of image to be tested in qemuimage-testlib.
This ensures that sanity test returns failure immediatly when there is
no image found. And also add check for the correctness of ip address.
If the ip address returned by function Test_Fetch_Target_IP is 0, it
means qemu starts up failed and no valid ip address found.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-12-23 15:52:37 +00:00
Jiajun Xu d64c7ae88c imagetest-qemu: Add sanity test cases for scp/shutdown in target
scp test is to check if file copying via network work or not in target.
shutdown test is to check if target can be poweroff with qemu process off.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-11-14 21:08:22 -08:00
Jiajun Xu 12a861359a imagetest-qemu: Add test case for dmesg check in target
Add a test case for error log check with command dmesg in target. The
case introduces a new folder in target, "/opt/test", which holds test
scripts running in target.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-11-10 21:09:22 +08:00
Jiajun Xu 80993c4e1b qemuimage-testlib: kill qemu process according to its pid, instead of process name
poky-qemu-internal will set up a tap lockfile when creating tap device. The lockfile
will be released when a TERM signal is received. In previous code, function
Test_Kill_Qemu uses pkill to kill all process named "qemu". This may cause lockfile
release function not work in poky-qemu-internal. Then poky-qemu-internal will be
hang when user start QEMU the second time. To prevent the issue, the new function
Test_Kill_Qemu kills all child pid with a given parent process ID.

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-09-02 11:00:08 +01:00
Jiajun Xu 8c498e5338 testlib: Add support for qemumips/qemuppc/qemux86-64, and add support for testing with images from autobuilder
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-08-13 23:42:03 +01:00
Jiajun Xu fd1d661b39 test: add automation framework and sanitytest
Automation test is disabled by default. User need set TESTCLASS
to qemu in conf/local.conf and run bitbake command "bitbake
poky-image-xxx" or "bitbake poky-image-xxx -c qemuimagetest" to
trigger it. Currently only the sanity test with two testcases are
added.

To run the test, user need prepare a testing environment:
1) "expect" should be installed on system
2) NOPASSWD should be set for user to run bitbake

Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-07-15 12:48:25 +01:00