Commit Graph

16 Commits

Author SHA1 Message Date
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
Jiri Kortus
836f0ddf7a [tests] Use a function to wait for compose to finish
The function is meant to replace the duplicate pieces of code used in various
tests, the polling interval is unified to 20 seconds.
2019-09-13 12:16:22 +03:00
Brian C. Lane
beff4f6967 tests: Use a loop to wait for VM and sshd to start 2019-09-09 09:28:52 +02:00
Brian C. Lane
3cb007a25b tests: Use liveuser account for live-iso boot check
On rawhide you cannot ssh in as root without changing PermitRootLogin,
and really we should be testing that liveuser can login not root.
2019-07-11 11:47:11 +03:00
Brian C. Lane
d0e947fe3b tests: Add check to make sure the compose actually finished
Previously it was looping, waiting for FINISHED|FAILED but was not
actually failing the test if the compose failed to build.
This adds a function to check the status of the compose and calls it
after each compose.
2019-07-10 08:58:24 -07:00
Brian C. Lane
fb89e6f275 Update qemu arguments to work correctly with nographic
Add -monitor none to turn off the qemu monitor multiplexing.
Pass -boot d for -cdrom booting instead of 'c'.

Add 'console=ttyS0,115200n8' to the boot arguments so that kernel output
will show up on the serial port.
2019-06-18 14:28:58 -07:00
Alexander Todorov
688f70eefa Revert "remove the check for qemu-kvm"
Partially reverts commit 303a69bcbd.
2019-06-10 13:26:11 +03:00
Lars Karlitski
ce3a277100 tests: Fail on script errors
Fixes #727
2019-06-04 14:07:36 +03:00
Lars Karlitski
1e5a5921e3 tests: Source lib.sh from the right directory
When testing in one of the VMs, tests are in /tests. Source the lib from
a relative directory instead.
2019-05-24 00:23:21 +02:00
Lars Karlitski
c261cec33d tests: Fail immediately when image build fails
We were checking for composer's FINISHED status only, which meant that
when a compose failed, the test ran until it timed out.

Check for failed as well. Also, always time out after 30 minutes.
2019-05-22 08:24:49 +02:00
Lars Karlitski
bdffaa02f4 tests: Re-enable kvm
In 303a69bc, we stopped using kvm, because it doesn't exist on all test
builders. Enable it again on those that have it.
2019-05-21 22:45:32 +02:00
Lars Karlitski
303a69bcbd tests: Don't depend on kvm for tar and qcow2 tests
Some test runners don't have nested virtualization enabled. Because
these checks are only checking that a boot works, kvm doesn't give us
that much. Disable for now.

Also remove the check for qemu-kvm. It doesn't abort the test
prematurely anyway.
2019-05-20 20:24:01 +02:00
Jiri Kortus
596cba2255 Use verify_image function as a helper for generic tests 2019-05-07 12:36:32 +03:00
Jiri Kortus
655e7e40c0 Add checks for disabled root account
The root account checks are applied to generated and deployed images
to make sure that root account is locked, except for live ISO.
2019-03-22 12:06:34 +02:00
Alexander Todorov
85dfbd7911 Allow overriding $CLI outside test scripts
this will allow you to test against installed RPM like so:

    # export CLI="/usr/bin/composer-cli"
    # make test_images

If you already have lorax-composer running then you can directly
execute test scripts:

    # ./tests/cli/test_build_and_deploy_aws.sh
2019-03-10 21:29:55 +02:00
Alexander Todorov
eef11ef405 New test: Build live-iso and boot with KVM
explicitly enables sshd for live-iso during testing
2019-03-04 13:19:57 +02:00