Commit Graph

1814 Commits

Author SHA1 Message Date
Jiri Kortus
22acf067cd tests: Add kickstart tar installation test
Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Jiri Kortus
2795969126 tests: Increase test VM memory to 3 GB
The reason for this change is that the tar image kickstart installation
test doesn't work with 2 GB.

Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Jiri Kortus
64f00d94b8 tests: add option to disable kernel command line parameters check
Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Brian C. Lane
c2c6bfa458 tests: Use a loop to wait for VM and sshd to start
Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Brian C. Lane
9d7fcc8642 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#1749802
2019-09-13 14:05:42 +03:00
Alexander Todorov
80c69f0621 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#1749802
2019-09-13 14:05:42 +03:00
Alexander Todorov
258d01647a Change paths for '/api/status' calls and skip this test
Skipping because:

larsu: I get `open failed: administratively prohibited: open failed`
larsu: ssh somehow disallows making a side channel for the forward
larsu: there's an option that controls it, but it's set to "yes"
larsu: I've straced the sshd, with no luck coming closer

We'll deal with this later, possibly together with the rest of
the skipped test cases.

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
22de8ed603 Ignore Cockpit CI files when linting
- these files are executed under Python 3 while the linter
  is Python 2 for RHEL 7 so we just ingore them
- also reverts the changes introduced to make these files Py2
  compatible, making them the same as on master branch

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
b38a358ea3 Use optional repository in Live ISO test
live-iso image type needs grub2-efi-*-cdboot from optional.

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
77649cbf76 Install test dependencies inside virtualenv
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
89e56aa3b4 Install python2-pip in the test VM and disable EPEL repo
so we don't use EPEL when actually building the images

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
2136d88cd6 Use qemu-kvm in tests instead of qemu-system
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
a728011196 Skip AWS, Azure, qcow2 and live-iso tests
due to infrastructure issues. These will be investigated and enabled
later.

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
3d27053605 Don't hard-code the path to toml-compare
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
29531d373e Install or remove packages in the test environment
which are needed for running the tests or prevent some test tools
from installing

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
e7035b8f78 Install additional repositories for testing
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
d97ff118d9 Prevent ssh asking for password when testing on interactive terminal
Related: rhbz#1704209
2019-09-13 11:27:12 +03:00
Alexander Todorov
0777e91d52 Fail if number of excuted tests != number of dicovered tests
this will report failing status in CI in case we have the
'Ran 0 tests in 46.486s' scenario.

Note: the check is placed after runner.run() to present the
message shown above which should make it more clear what went on.

Related: rhbz#1698366

0 run
2019-09-13 11:27:12 +03:00
Alexander Todorov
9bce583fc2 Fix typo from test backport
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Jiri Kortus
b0b603dc2e Use passwd --status for locked root account check
Related: rhbz#1687595
2019-07-10 09:17:58 +02:00
Alexander Todorov
8734f662e9 Backport changes for Cockpit CI
Related: rhbz#1698366
2019-06-25 11:57:33 +03:00
Brian C. Lane
3951363660 Automatic commit of package [lorax-composer] release [19.7.35-1].
Created by command:

/bin/tito tag
2019-06-24 16:45:10 -07:00
Lars Karlitski
fd2e1738ab test_compose_tar: Fix docker test
The docker phase always failed because `-ti` was passed even though the
the output was not a terminal. Moreover docker service isn't running by
default on RHEL-7, so it's necessary to start it first explicitly.

Related: rhbz#1720224
2019-06-24 10:33:37 +03:00
Brian C. Lane
cdfdb651f7 tests: kill the qemu process name used to start it
Related: rhbz#1710877
2019-06-24 10:33:37 +03:00
Brian C. Lane
7c8e6e75ca Update local copy of lorax to current rhel7-branch
These are used when running tests, so catch-up with changes in lorax.
Includes adding rootfs-size, extra kernel args, and using locking to
prevent temporary files from being deleted by systemd tmpfiles handling.

Related: rhbz#1668520
Related: rhbz#1715116
Related: rhbz#1689314
2019-06-24 10:33:37 +03:00
Brian C. Lane
9e52529025 Update the lorax templates to match what lorax provides
lorax-creator doesn't ship these, but it uses them for running tests, so
make sure they are current.

Related: rhbz#1689314
2019-06-24 10:33:37 +03:00
Brian C. Lane
16a00db1f0 Enable networking in lorax-composer templates
Because anaconda --dirinstall is used the kickstart's network like isn't
processed at all. So we need to remove the NetworkManager-server-config
package which disables networking.

Resolves: rhbz#1710877
2019-06-17 16:12:34 -07:00
Brian C. Lane
47cce303d5 Automatic commit of package [lorax-composer] release [19.7.34-1].
Created by command:

/bin/tito tag
2019-06-13 08:38:21 -07:00
Alexander Todorov
63c50c08eb [tests] Handle blueprints in setup_tests/teardown_tests correctly
It's necessary to make sure the blueprints directory doesn't contain
the git/ directory before the tests are run, so that we can just simply
modify the blueprint files without using blueprints push.

Related: rhbz#1698366
2019-06-12 21:50:08 +03:00
Lars Karlitski
7c0d2577a8 tests: Set BLUEPRINTS_DIR in all cases
`setup_tests()` expected BLUEPRINTS_DIR to be set, but it wasn't when
running in automated mode (with $CLI set).

Fix this and move share and blueprint dirs to function arguments.

Related: rhbz#1698366
2019-06-12 21:50:08 +03:00
Alexander Todorov
9b5554aa1e tests: Change the way how we remove pyOpenSSL
the version coming from RPM is older and prevents installing
ansible[azure] via pip. OTOH removing with yum also removes
lorax-composer and breaks tests when running against the RPM
instead of git checkout (which will be the default with Cockpit CI).

Related: rhbz#1715003
2019-06-12 11:21:56 +03:00
Jiri Kortus
94892e56dd Use a less strict regex for disabled root account check
Related: rhbz#1687595
2019-05-13 15:31:27 +03:00
Jiri Kortus
481f33b898 Add test for passing custom option on kernel command line
Related: rhbz#1688335
2019-05-13 15:31:27 +03:00
Jiri Kortus
0980ddfc54 Use verify_image function as a helper for generic tests
Related: rhbz#1704209
2019-05-13 15:31:27 +03:00
Brian C. Lane
59793f9889 Automatic commit of package [lorax-composer] release [19.7.33-1].
Created by command:

/bin/tito tag
2019-05-07 10:56:29 -07:00
Lars Karlitski
e7c910d4fa Pass ssl certificate options to anaconda
If a repository has `sslcacert`, `sslclientcert`, or `ssclientkey` set,
pass them to anaconda through the kickstart file. This is mostly the
case when using RHEL repositories that are accessed through a
subscription.

Resolves: rhbz#1701033
2019-05-07 10:42:09 -07:00
Alexander Todorov
1bf7708830 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#1698366
2019-05-07 19:19:27 +03:00
Alexander Todorov
83707bfa06 Add new test to verify compose paths exist
because they are mentioned in the official documentation

Related: rhbz#1698366
2019-05-07 19:19:27 +03:00
Alexander Todorov
ff7d7c2d49 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#1698366
2019-05-07 19:19:27 +03:00
Brian C. Lane
b7b17391de Automatic commit of package [lorax-composer] release [19.7.32-1].
Created by command:

/bin/tito tag
2019-04-29 16:29:13 -07:00
Brian C. Lane
41d822f754 tests: Add a test for using [[customizations]] with [customizations.kernel]
Make sure this is really fixed by running the template tests with both
variations. NOTE: [customizations] is the correct form. An early
documentation bug led to both being accepted.

Related: rhbz#1688335
2019-04-29 16:01:30 -07:00
Brian C. Lane
5b2d894269 lorax-composer: Fix customizations when creating a recipe
This fixes the customizations list problem earlier than in
add_customizations.

In the recipe it should be [customizations] not [[customizations]]
which creates a list. If it was used that way grab the first element and
replace the list with it.

Related: rhbz#1688335
2019-04-29 16:01:17 -07:00
Brian C. Lane
8ca8702fbc Automatic commit of package [lorax-composer] release [19.7.31-1].
Created by command:

/bin/tito tag
2019-04-29 11:20:26 -07:00
Brian C. Lane
e988b8e7d6 Fixup print function usage with StringIO
Related: rhbz#1688335
2019-04-29 10:41:57 -07:00
Brian C. Lane
0b8a5ac87c lorax-composer: pass customization.kernel append to extra_boot_args
This allows iso builds to include the extra kernel boot parameters by
passing them to the arch-specific live/*tmpl template.

Also adds tests to make sure it is written to config.toml in the build
metadata.

Resolves: rhbz#1688335
2019-04-29 10:41:57 -07:00
Brian C. Lane
9cebd1ddaf lorax-composer: Add the ability to append to the kernel command-line
Sometimes it is necessary to modify the kernel command-line of the
image, this adds support for a [customizations.kernel] section to the
blueprint:

[customizations.kernel]
append = "nosmt=force"

This will be appended to the kickstart's bootloader --append argument.

Includes tests for modifying the bootloader line, the kickstart
template, and examining the final-kickstart.ks created for a compose.

Related: rhbz#1688335
2019-04-29 10:41:57 -07:00
Brian C. Lane
72d1094fb6 Automatic commit of package [lorax-composer] release [19.7.30-1].
Created by command:

/bin/tito tag
2019-04-24 09:36:28 -07:00
Jiri Kortus
5b45593f3c Add test for starting compose with deleted blueprint
Related: rhbz#1683442
2019-04-24 14:14:40 +03:00
Brian C. Lane
a81964a603 lorax-composer: Return UnknownBlueprint errors when using deleted blueprints
Reading a blueprint wasn't checking to see if it had been deleted so it
was returning the most recent commit before it had been deleted. This
allowed things like starting a compose with a blueprint that technically
doesn't exist.

One exception to this is the /changes/ route, it must be available so
that you can use the commit hash to undo a delete.

This also adds tests for the various operations.

(cherry picked from commit d32f477e0b)

Resolves: rhbz#1683442
2019-04-22 10:17:25 -07:00
Brian C. Lane
2eb4437159 lorax-composer: Delete workspace copy when deleting blueprint
Also extends the blueprint delete test to also check the workspace.

(cherry picked from commit 26bd2c1378)

Related: rhbz#1683442
2019-04-22 10:16:40 -07:00