lorax/tests/cli/test_boot_qcow2.sh
Brian C. Lane b8bf258a3c tests: Split testing the image into a separate script
Nested virt is not reliable enough, especially on other arches, to rely
on for testing the created images. This moves the test code into
test_boot_* scripts to be run from inside the booted images.

It also adds copying the results of the build into
/var/tmp/test-results/, and includes the generated ssh key so that
whatever boots the image can also log in.

The tests/test_image.sh script has been added to handle running the
test_boot_* scripts without any of the extra lorax-composer specific
setup.
2019-11-01 09:00:57 -07:00

23 lines
484 B
Bash
Executable File

#!/bin/bash
# Note: execute this file from the project root directory
#####
#
# Test the qcow2 image
#
#####
set -e
. /usr/share/beakerlib/beakerlib.sh
. $(dirname $0)/lib/lib.sh
rlJournalStart
rlPhaseStartTest "Verify VM instance"
# Just the fact that this is running means the image can boot and ssh is working
rlAssertExists "/root/.ssh/authorized_keys"
rlAssertGrep "custom_cmdline_arg" /proc/cmdline
rlPhaseEnd
rlJournalEnd
rlJournalPrintText