Commit Graph

59 Commits

Author SHA1 Message Date
Jakub Rusz
4dec82ae20 tests: run ssh commands in batch mode
(cherry picked from commit 711668dc99)

Related: rhbz#1785154
2020-01-24 14:27:40 +02:00
Jakub Rusz
2a310efdcf tests: remove --test=2 from compose_sanity
This ensures that after canceling a compose, the next one can be finished.

(cherry picked from commit 2ee92b75b0)

Related: rhbz#1788461
2020-01-21 15:27:13 +02:00
Jakub Rusz
14d399fe0c tests: Check for cloud-init presence in azure image
This tests if the cloud-init is installed and running.
Cherry-picked from: bae3cb06bc

Related: rhbz#1754711
2020-01-14 19:20:38 +02:00
Alexander Todorov
5189a97f0a tests: Enable Elastic Network Adapter support for AWS
- this is required for arm64 but is present in all latest kernels
  so doesn't seem to hurt
- when registering the AMI mark its architecture properly

Cherry-picked from 6c35448feb

Related: rhbz#1789308
2020-01-13 15:35:54 -08:00
Alexander Todorov
69589123b7 AWS test: take into account different instance type for non x86
- also fix equality comparison to use == for consistency

Cherry-picked from d3d7e072d9

Related: rhbz#1789308
2020-01-13 15:35:54 -08:00
Brian C. Lane
17ce6ee4e4 lorax-composer: Enable ami on aarch64
Resolves: rhbz#1789308
2020-01-13 15:10:16 -08:00
Jakub Rusz
23d528c705 Add test for canceling a running compose
This is a modification of an existing test for compose sanity.
Cherry-picked from master 8c9f528cd4

Related: rhbz#1788461
2020-01-11 13:52:33 +02:00
Jiri Kortus
d20b2f3309 Add test for running composer with --no-system-repos option
- add test coverage for rhbz#1650363
- cherry-picked from 5322664432

Related: rhbz#1785154
2020-01-06 09:31:57 +02:00
Brian C. Lane
054669d027 composer-cli: Only display the available compose types
The enabled bool is now being used so the cli should only show the types
actually available on the architecture.

Also modifies the test in test_compose_sanity.sh

Related: rhbz#1751998
2019-12-10 15:52:39 -08:00
Jakub Rusz
86ea9adbab tests: enable compose_ext4 test to use CDN repos
Related: rhbz#1777265
2019-11-27 15:08:27 +02:00
Alexander Todorov
7945d00aa1 tests: Ensure failure if beakerlib results file not found
In example here
https://209.132.184.41:8493/logs/pull-887-20191025-100505-509b9eae-weldr-lorax--fedora-31-tar/log.html

we're seeing stuff like:
/tests/test_cli.sh: line 109: /tmp/composer-test.wIAITH/TestResults: No such file or directory

but the result is PASS

Cherry-picked from 2b578dcee8

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Alexander Todorov
3409d0a949 DRY when setting up, running & parsing results for beakerlib tests
Cherry-picked from b197e448ff

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Brian C. Lane
bb4b6b7059 tests: Use journalctl -g to check for failed login
/var/log/audit/audit.log isn't always available (eg. tar liveimg
install), but it is logged to the journal, which can be grepped with
'journalctl -g' so use that instead.

Cherry-picked from 89539a7bf4

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Brian C. Lane
a7c9c049eb tests: Fix check_root_account when used with tar liveimg test
passwd and openssh-clients need to be installed, and there is no need to
use sudo when you are connecting to the system as root.

Cherry-picked from 454af0c5d5

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Alexander Todorov
4a052314f4 tests: Use the same asserts as before
after the changes around live-iso and qcow2 test cases the asserts
used have also changed. This commit utilizes the existing test lib.

Cherry-picked from d67745d755

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Alexander Todorov
471adbd8de tests: switch to using podman instead of docker
Note: use podman-docker to avoid changing tests too much. This
is also what we have on the RHEL branches.

There's no service to be started/restarted so remove everything
related to docker service.

Cherry-picked from e1b45958f4

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Brian C. Lane
493055c03c tests: Remove nested vm from tar liveimg kickstart test
Use anaconda to install the root.tar.xz into a disk image.  Copy the
disk image to the host, and use the cockpit vm support to boot it and
test it.

Cherry-picked from 4705ff3b1e

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Brian C. Lane
020fd300a4 tests: Use --http0.9 for curl ssh test
Cherry-picked from a0ae10c2d7

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Brian C. Lane
e7cfd20ca3 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.

Cherry-picked from b8bf258a3c

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Alexander Todorov
29cfda8eae [tests] Collect compose logs after each build
- save compose logs under /var/log/$TEST
- save qemu logs under /var/log/$TEST/qemu.log
- download everything to $TEST_ATTACHMENTS so it can be saved
  in CI results

Cherry-picked from 8af9723c

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Jiri Kortus
16daa25137 [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.

Cherry-picked from 836f0ddf

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Alexander Todorov
e7f2706461 [tests] Use functions for starting and stopping lorax-composer
Cherry-picked from f978d4b01c

Related: rhbz#1769525
2019-11-08 13:57:35 +02:00
Jiri Kortus
71a666507b tests: Add kickstart tar installation test
Related: rhbz#1733975
2019-11-05 11:30:56 +02:00
Jiri Kortus
1f7efc3bba tests: add option to disable kernel command line parameters check
Related: rhbz#1733975
2019-11-05 11:30:56 +02:00
Brian C. Lane
3b0bb5718c tests: Use a loop to wait for VM and sshd to start
Related: rhbz#1733975
2019-11-05 11:30:56 +02:00
Alexander Todorov
305dc9b7f6 tests: Document Azure setup 2019-10-21 20:50:22 +03:00
Brian C. Lane
ecc1ab705b 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.

(cherry picked from commit d0e947fe3b)

Related: rhbz#1724073
2019-09-11 14:16:27 +03:00
Alexander Todorov
dcb4c1a0e5 Backport Cockpit CI changes for RHEL 8
Notes:

- also install podman-docker
- on RHEL 8 there's no docker.service to start

Related: rhbz#1724073
2019-09-11 14:16:27 +03:00
Brian C. Lane
c96beac237 tests: Drop sort from compose types test
The output from the API is already sorted, and 'sort' changes this
ordering in some situations.

Related: rhbz#1714103
2019-09-02 15:00:25 +03:00
Alexander Todorov
d538aa9176 New test: assert toml files in git workspace
export BLUEPRINTS_DIR for use in tests

Depending on the way the tests are run the directory may be a temporary
dir, or it may be the standard /var/lib/lorax/... path.

Related: rhbz#1714103
2019-09-02 15:00:25 +03:00
Jiri Kortus
91cfdb277e Use passwd --status for locked root account check
Related: rhbz#1728571
2019-07-11 11:55:22 +03:00
Jiri Kortus
755e71b542 Add test for passing custom option on kernel command line
Related: rhbz#1687743
2019-04-29 12:52:22 +03:00
Jiri Kortus
81ad0509f2 Use verify_image function as a helper for generic tests
Related: rhbz#1704172
2019-04-29 12:52:22 +03:00
Alexander Todorov
07a64aab07 Change [[modules]] to [[packages]] in tests
> bcl: this should really be [[packages]] since [[modules]] is
> going to change to actual modules at some point

Related: rhbz#1698368
2019-04-19 13:52:32 +03:00
Alexander Todorov
b735c8ce0c Add new test to verify compose paths exist
because they are mentioned in the official documentation

Related: rhbz#1698368
2019-04-19 13:52:32 +03:00
Alexander Todorov
c9978b800c Add new sanity tests for blueprints
- verify SemVer .patch number will be automatically updated when
  we push the blueprint a second time without changing version
- verify show displays the content in TOML format and it matches
  what is on disk. Because of that also start with empty packages
  and groups fields in the initial toml. If they are missing they
  will be added automatically by lorax-composer and this simplifies
  the test
- verify delete works

Related: rhbz#1698368
2019-04-19 13:52:32 +03:00
Chris Roberts
41d4d78f00 Update VMware info for VMware testing
Cluster and Network changed due to new hardware in RDU2 DC

Related: rhbz#1678937
2019-04-18 10:34:55 +03:00
Jiri Kortus
e5fb0b3f37 Add test for starting compose with deleted blueprint
Related: rhbz#1699303
2019-04-17 13:41:42 +03:00
Jiri Kortus
5962533e56 Fixes for locked root account test
Fixes related to a few issues in the locked root account test I somehow
managed to overlook in the initial commit.

Related: rhbz#1698473
2019-04-17 13:39:39 +03:00
David Shea
0467377810 Add a compose type for alibaba.
This compose type creates a partitioned disk as a qcow2 file, but with
only one partition instead of using a separate /boot.

(cherry picked from commit 44e14176bb)

Resolves: rhbz#1689140
2019-04-05 11:38:01 -04:00
David Shea
138db14acd Add a compose check for google cloud images.
(cherry picked from commit c6fcf9d1eb)

Related: rhbz#1689140
2019-04-05 11:32:30 -04:00
David Shea
49810847c4 Add a compose type for Google Compute Engine
(cherry picked from commit bd804c271b)

Resolved: rhbz#1689140
2019-04-05 11:31:56 -04:00
Jiri Kortus
9e0e2b718f 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.

Related: rhbz#1626122
2019-03-29 23:13:01 +02:00
Chris Roberts
6b4b3d98a8 Update VMware datastore location to unblock tests
Datastore switched from NFS to iSCSI

Related: rhbz#1678937
2019-03-21 11:27:12 -07:00
Alexander Todorov
551723816c 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

Related: rhbz#1678937
2019-03-15 11:03:38 +02:00
Alexander Todorov
82492a54bc New test: Build live-iso and boot with KVM
explicitly enables sshd for live-iso during testing

Related: rhbz#1653934
2019-03-04 22:08:22 +02:00
Alexander Todorov
e78e0e610c New test: Build qcow2 compose and test it with QEMU-KVM
Related: rhbz#1653934
2019-03-04 13:18:35 +02:00
Alexander Todorov
50febb4381 New test: Verify tar images with Docker and systemd-nspawn
- on some arches (also Fedora x86_64) systemd-nspawn may not be
  available
- delete composes from other tests in rlPhaseStartCleanup because
  we're seeing the tar compose kind of hanging in Jenkins and that
  test script is executed last so the slave may be running out of
  disk space. Be a good citizen and clean up after the previous
  tests.

Related: rhbz#1653934
2019-02-19 21:16:40 +02:00
Alexander Todorov
b6e86b4216 Update OpenStack flavor and network settings in tests
b/c we've migrated to Upshift we must use different instance type,
specify the desired network to connect to and update how we get
the ip address of the launched VM.

Related: rhbz#1653934
2019-02-18 12:15:37 +02:00
Jan Stodola
6d477a403a Use existing storage account
To avoid creating a new storage account for every new VM.

Related: rhbz#1653934
2019-02-06 19:19:35 +01:00