In order to run tests, you need to do the following:
Set up to avoid interaction
with sudo
for networking:
To accomplish this, you must do one of the
following:
Add
NOPASSWD
for your user
in /etc/sudoers
either for
ALL commands or just for
runqemu-ifup
.
You must provide the full path as that can
change if you are using multiple clones of the
source repository.
/etc/sudoers
.
Manually configure a tap interface for your system.
Run as root the script in
scripts/runqemu-gen-tapdevs
,
which should generate a list of tap devices.
This is the option typically chosen for
Autobuilder-type environments.
Set the
DISPLAY
variable:
You need to set this variable so that you have an X
server available (e.g. start
vncserver
for a headless machine).
Be sure your host's firewall
accepts incoming connections from
192.168.7.0/24:
Some of the tests (in particular smart tests) start an
HTTP server on a random high number port, which is
used to serve files to the target.
The smart module serves
${DEPLOY_DIR}/rpm
so it can run
smart channel commands. That means your host's firewall
must accept incoming connections from 192.168.7.0/24,
which is the default IP range used for tap devices
by runqemu
.
Once you start running the tests, the following happens:
A copy of the root filesystem is written
to ${WORKDIR}/testimage
.
The image is booted under QEMU using the
standard runqemu
script.
A default timeout of 500 seconds occurs
to allow for the boot process to reach the login prompt.
You can change the timeout period by setting
TEST_QEMUBOOT_TIMEOUT
in the local.conf
file.
Once the boot process is reached and the
login prompt appears, the tests run.
The full boot log is written to
${WORKDIR}/testimage/qemu_boot_log
.
Each test module loads in the order found
in TEST_SUITES
.
You can find the full output of the commands run over
SSH in
${WORKDIR}/testimgage/ssh_target_log
.
If no failures occur, the task running the
tests ends successfully.
You can find the output from the
unittest
in the task log at
${WORKDIR}/temp/log.do_testimage
.