Commit Graph

1872 Commits

Author SHA1 Message Date
Alexander Todorov
f467a3aba7 tests: update skip message for TestApi
Related: rhbz#1785159
2020-04-20 09:28:11 -07:00
Jakub Rusz
4d28da3818 tests: remove --test=2 from compose_sanity
This ensures that after canceling a compose, the next one can be finished.

(cherry picked from commit 6924571d95)

Related: rhbz#1789451
2020-04-20 13:18:38 +03:00
Jakub Rusz
06f09b2335 Add test for canceling a running compose
This is a modification of an existing test for compose sanity.
Cherry picked from 8c9f528cd4

Related: rhbz#1789451
2020-04-20 13:18:38 +03:00
Chris Roberts
772e841a7f Update datastore for VMware testing
This change is needed for VMWare testing due to changes in the storage,
and the datastore we used before is not available for the time being.
Related: rhbz#1785159
2020-04-17 09:29:51 -07:00
Alexander Todorov
c56d57ef7e tests: pip install future
Resolves:
https://github.com/ansible/ansible/issues/68616
https://github.com/cockpit-project/bots/pull/636

Another posibility would be to `yum install python2-future` from
EPEL in vm.install instead.

Related: rhbz#1785159
2020-04-17 09:27:54 -07:00
Brian C. Lane
9291f3f3ea lorax-composer: Estimate metadata size required by Anaconda
Anaconda doesn't download the filelists or 'other' metadata, which can
add a significant amount of space to the metadata cache on the build
host. So to estimate the amount of space needed by Anaconda exclude the
space used by *filelists* and *other* files.

With these changes the lorax-composer estimate should actually be fairly
accurate. But since Anaconda only uses the installedsize * 1.35 we have
to make sure that the size we use is at least as big as what anaconda
will estimate, otherwise the installation will fail.

Resolves: rhbz#1761337
2020-04-17 09:08:53 -07:00
Brian C. Lane
e0da9b987b composer: Add the yum cache archive size to the size estimate
anaconda moves the yum cache to the disk once it is partitioned, so the
downloaded rpms also consume space until the installation is finished.
Take this into account when estimating the size.

Thanks to Christophe Besson for spotting this.

Related: rhbz#1761337
2020-04-17 09:08:53 -07:00
Brian C. Lane
9c44f5213b Automatic commit of package [lorax-composer] release [19.7.39-1].
Created by command:

/usr/bin/tito tag
2019-12-13 16:50:44 -08:00
Brian C. Lane
7fcd0aa979 test: Turn TestLiveIso back on
Related: rhbz#1770193
2019-12-11 15:23:40 -08:00
Brian C. Lane
626dfbd4ea Makefile: archive should not run git tag
This causes 'make vm' to tag the current commit as 'HEAD' which causes
no end of confusion.

Related: rhbz#1770193
2019-12-11 15:23:40 -08:00
Brian C. Lane
a432c71c95 lorax-composer: Add liveuser on live-iso to wheel group
They can already su - to root, adding them to wheel lets sudo also work.

Related: rhbz#1770193
2019-12-11 15:23:40 -08:00
Brian C. Lane
a25fcf4369 tests: Boot the test images with graphics=True
This adds vnc to the libvirt config, which makes booting the
live-iso work.

Related: rhbz#1770193
2019-12-11 15:23:19 -08:00
Brian C. Lane
64998d853d tests: Add serial console to images we boot in CI
In some cases it will not boot without a console, and the CI framework
defaults to using serial console. So set it on live-iso, qcow2, and the
final iso installed with liveimg.

Related: rhbz#1770193
2019-12-11 15:16:50 -08:00
Brian C. Lane
60806ab596 Automatic commit of package [lorax-composer] release [19.7.38-1].
Created by command:

/bin/tito tag
2019-12-09 16:02:22 -08:00
Brian C. Lane
e51b00edca lorax-composer: Change cockpit.socket examples to cockpit
The RHEL7 version of Anaconda only allows .service units to be used with
the kickstart services command. Update the documentation, examples, and
tests to reflect this.

Related: rhbz#1718473
2019-12-06 11:01:55 -08:00
Brian C. Lane
915fc24fee Automatic commit of package [lorax-composer] release [19.7.37-1].
Created by command:

/bin/tito tag
2019-12-02 15:30:50 -08:00
Alexander Todorov
bc0dd4c92c tests: If TEST_OS isn't specified then match the host OS
this will help with downstream snapshots testing making
it easier to match the host OS snapshot

Cherry-picked from 6839390be2

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
b81e260c4d Remove all repo files & install composer-cli from host repos
when testing downstream snapshots this makes sure that
lorax-composer and composer-cli are coming from the host OS.

We also make 100% sure that there are no other repositories inside
the VM other than what has been configured on the host!

Make it possible to override where repo files are copied from by
defining the REPOS_DIR variable. By default the value is
/etc/yum.repos.d

Cherry-picked from bd2f4925de

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
50aa59cec1 Always remove lorax-composer & composer-cli RPMs before installing them
this will ensure locally built packages are always installed

Cherry-picked from 29492b62f6

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
553498d543 Always remove existing VM image before building new one
Cherry-picked from 92bf03ea51

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
c020cec968 tests: enable compose_ext4 test to use CDN repos
Cherry-picked from b903bf0abcf6fb12e308992b875d79d420c5ca74

Related: rhbz#1698366
2019-11-27 19:44:22 +02:00
Brian C. Lane
bb82857ab3 Automatic commit of package [lorax-composer] release [19.7.36-1].
Created by command:

/bin/tito tag
2019-11-19 10:12:14 -08:00
Alexander Todorov
0d344e6cae tests: restart composer after adding optional reporsitory
b/c live-iso needs grub2-efi-*-cdboot from Optional

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
64a593a376 tests: Keep beakerlib repo on the VM for tests which need it
Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
b0dc59534c tests: unskip Qcow2 scenario
previously relying on nested virt

Related: rhbz#1770193

NOTE: live-iso still fails on RHEL 7 and we've been unsuccessfull
figuring out why so skip it for now
2019-11-19 09:59:58 -08:00
Alexander Todorov
d11f5079f4 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#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
dee3f4ed2b tests: Documentation updates
Cherry-picked from c43ba9e78f

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
a0cee0b543 tests: Use host repositories for make vm
to help with running the tests by hand on downstream snapshots.
In that scenario we want TEST_OS/VM_IMAGE to look as closely as
possibly like the snapshot that we'd like to test.

Cherry-picked from 1351c4dc63

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
60ef7231fe Remove unused make targets
these were only used by Jenkins but we don't have Jenkins anymore

Cherry-picked from e7e70313ef

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
92535addc8 DRY when setting up, running & parsing results for beakerlib tests
Cherry-picked from b197e448ff

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
3d3c32819c 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#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
ac1bcd9d1d 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#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
33b9b46fb6 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#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
bb57558603 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#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
ad472685c9 tests: Use --http0.9 for curl ssh test
Cherry-picked from a0ae10c2d7

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
742a245719 test: Boot the live-iso faster, and login using ssh key
On Fedora 31 passworless root login is no longer working. We already
install a ssh key, may as well use it.

This also reduces the live boot timeout to 2s from 60s, which should
help with timeout problems when booting.

Cherry-picked from e3654e8297

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
5cdd01be36 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#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
c1609d7ffe test: Split up the test class to allow booting other images
This splits out the lorax-composer specific execution so that the built
image can be downloaded from the build vm and booted by the host instead
of using nested virt to try and boot it inside the build vm.

Also adds copying the ssh key from the build vm so that it can log into
the image and run the test_boot_* scripts.

Cherry-picked from df7a018ee2

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
8b8f5355bf [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#1770193
2019-11-19 09:59:58 -08:00
Jiri Kortus
a8d7841bc1 [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#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
78fbb7c49e [tests] Use functions for starting and stopping lorax-composer
Cherry-picked from f978d4b01c

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
8e650d1d07 Update for differences from py3 in the backported code
In py3 dicts are not predictable, make sure the keys are sorted so that
the tests are useful.

Use StringIO.StringIO instead of io.StringIO which requires unicode
text.

kickstart timezone.ntpservers is a set() so adjust the test for it.

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
406dddafef Remove repos.git related tests
Support is not included in this patchset.

(cherry picked from commit a643522769)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
39f464d46b composer-cli: Update diff support for customizations and repos.git
composer-cli will now output information about changes to customizations
entries and the repos.git entries.

(cherry picked from commit 156ef0acfd)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
f0efcd9b0f Add support for customizations and repos.git to /blueprints/diff/
This also includes extensive tests for each of the currently supported
customizations. It should be generic enough to continue working as long
as the list of dicts includes a 'name' or 'user' field in the dict.
Otherwise support for a new dict key will need to be added to the
customizations_diff function.

(cherry picked from commit 850c490b6e)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
e2262e57e3 tests: Update custom-base with customizations
(cherry picked from commit 9724731b8d)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
b4a95b8d2b Change customizations.firewall to append items instead of replace
To maintain consistency with the other options this changes firewall to
combine the existing settings from the image template with the settings
from the blueprint.

Also updated the docs, added a new test for it, and sorted the output
for consistency.

(cherry picked from commit 3e08389a0f)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
4d7e3bb4bc Update customizations.services documentation
Make it clear that the services are added to services already listed in
the image templates, and that you can specify any systemd unit filename.

Older releases are more restrictive, and this documentation will need to
be updated when these changes are backported.

(cherry picked from commit 4f701e7e92)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
f2209932a6 lorax-composer: Add services support to blueprints
Add support for enabling and disabling systemd services in the
blueprint. It works like this:

    [customizations.services]
    enabled = ["sshd", "cockpit.socket", "httpd"]
    disabled = ["postfix", "telnetd"]

They are *added* to any existing settings in the kickstart templates.

(cherry picked from commit 1111aee92d)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
780f00d81a lorax-composer: Add firewall support to blueprints
You can now open ports in the firewall, using port numbers or service
names:

    [customizations.firewall]
    ports = ["22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"]

Or enable/disable services registered with firewalld:

     [customizations.firewall.services]
     enabled = ["ftp", "ntp", "dhcp"]
     disabled = ["telnet"]

If the template contains firewall --disabled it cannot be overridden,
under the assumption that it is required for the image to boot in the
selected environment.

(cherry picked from commit 4d35668ab5)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00