summaryrefslogtreecommitdiff
path: root/scripts/qemuimage-testlib
AgeCommit message (Collapse)AuthorFiles
2013-05-16qemuimage-testlib: change default directory for target testsStefan Stanacar1
/tmp is a better location, and it allows copying files on read only fs images Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16qemuimage-testlib: pass optional timeout to ssh functionStefan Stanacar1
Sometimes we need to change the timeout used by the function for certain kinds of tests. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16qemuimage-testlib: add support for extra arguments passed to runqemuStefan Stanacar1
Some tests might want to pass extra arguments to runqemu. I can think of "kvm" or qemuparams="-m 1024" when we want extra muscle. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12imagetest-qemu.bbclass, qemuimage-testlib: add support for more FSTYPESStefan Stanacar1
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 Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05qemuimage-testlib: add function to fetch the remote syslogRoss Burton1
Add a new function to scp from the target, and another to fetch /var/log/messages and dump it to the console. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05qemuimage-testlib: silence some key warningsRoss Burton1
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. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04scripts/qemuimage-testlib: Dump extra info if the network doesn't come upRichard Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-30qemuimage-testlib: Fix quoting issueRichard Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-30qemuimage-testlib: Increase qemu startup timeoutsRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-27qemuimage-testlib: Capture stderror in the logs as well as stdoutRichard Purdie1
This allows error messages to be captured in the logs which is helpful. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26qemuimagetest: collect and print runqemu outputPaul Eggleton1
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26qemuimagetest: fix erroneous ps errors when qemu couldn't be startedPaul Eggleton1
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-21scripts/qemu-testlib: Add more debugging informationRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-20qemuimage-testlib: Add extra debugging and sanity checkRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-20qemuimage-testlib: Add delay to work around races in qemu startupRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19qemuimage-testlib: Fix IP address handlingRichard Purdie1
Remove some pointless code and also fix the return handling for the function since it returns null, not 0 as the comments would suggest. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19scripts/qemutestlib: Add better process debugging and fix process group issueRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19qemu-testlib: Add python helper and simplify shellRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-13scripts/qemuimage-testlib: Use wide option to ps callsMichael Halstead1
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. Signed-off-by: Michael Halstead <michael@yoctoproject.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-21scripts/qemuimage-testlib: fix typosYi Zhao1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-24qemuimage-testlib: rename qemuppc imageSaul Wold1
A recent set of changes changed the kernel name from bzImage to vmlinux, this test needs to change also. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10scripts/qemuimage-testlib: Output a slightly better error if expect is missingRichard Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28scripts: use OE_TMPDIR instead of TMPDIR external variablePaul Eggleton1
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] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-09imagetest-qemu/runqueue: Since we no longer support BUILDDIR, use TMPDIRRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-24qemuimagetest: update cvs and iptables to newer version for toolchain testJiajun Xu1
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>
2011-05-04qemuimagetest: Enable toolchain automation tests in qemuimagetestJiajun Xu1
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>
2011-04-20Replace POKYBASE with COREBASERichard Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-20Rename poky-qemu to runqemuRichard Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10qemuimagetest: Rename test scenario file from poky-image-sdk to ↵Jiajun Xu1
poky-image-sato-sdk Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2011-01-20qemuimagetest: Use same image during sanity testing instead of copying a new ↵Jiajun Xu1
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-14qemuimagetest: Use the same image in sanity testing to fix the timeout issue ↵Jiajun Xu1
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-06qemuimagetest: Remove connman test for lsb image and fix one warning in ↵Jiajun Xu1
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>
2010-12-24qemuimage-testlib: Improve quoting causing problems under certain circumstancesRichard Purdie1
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-23qemuimage-testlib: Fix the check for running qemu processesRichard Purdie1
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-23qemuimage-testlib: Ensure TOPDIR/BUILDDIR are setRichard Purdie1
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-23qemuimage-testlib: Add check for existence of image and correctness of ip ↵Jiajun Xu1
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-11-14imagetest-qemu: Add sanity test cases for scp/shutdown in targetJiajun Xu1
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-10imagetest-qemu: Add test case for dmesg check in targetJiajun Xu1
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-09-02qemuimage-testlib: kill qemu process according to its pid, instead of ↵Jiajun Xu1
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-08-13testlib: Add support for qemumips/qemuppc/qemux86-64, and add support for ↵Jiajun Xu1
testing with images from autobuilder Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
2010-07-15test: add automation framework and sanitytestJiajun Xu1
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>