Commit Graph

1789 Commits

Author SHA1 Message Date
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
Jan Stodola
73de195334 Use existing storage account
To avoid creating a new storage account for every new VM.

Related: rhbz#1673012
2019-04-22 15:57:07 +03:00
Jan Stodola
fabf428f00 Record date/time of VM creation
Related: rhbz#1673012
2019-04-22 15:57:07 +03:00
Chris Roberts
2ebf60f28d Update datastore for VMware testing
Cluster and Network changed due to new hardware in RDU2 DC

Related: rhbz#1656105
2019-04-18 10:35:53 +03:00
Jiri Kortus
6fb94326e7 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#1687595
2019-04-09 18:54:03 +03:00
Jiri Kortus
277d391f01 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#1687595
2019-03-29 15:22:57 +02:00
Jiri Kortus
5d6446a7bd 'compose info' is 'compose details' on RHEL-7
Add the correct composer-cli command 'compose details' in places
where 'compose info' was still used on RHEL-7
(see commit 808454b561)

Related: rhbz#1687595
2019-03-29 14:44:53 +02:00
Chris Roberts
c6e8befe21 Update some grammer issues in the test Bash scripts
Related: rhbz#1656105
2019-03-22 12:15:38 +02:00
Chris Roberts
48a28e0950 Update datastore for VMware testing
Datastore switched from NFS to iSCSI

Related: rhbz#1656105
2019-03-22 12:11:56 +02:00
Brian C. Lane
86718c517d Automatic commit of package [lorax-composer] release [19.7.29-1].
Created by command:

/bin/tito tag
2019-03-19 09:27:03 -07:00
Alexander Todorov
64baf7c147 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#1687595
2019-03-15 11:02:00 +02:00
Alexander Todorov
e96a5917bb Use make ci inside test-in-copy target
this minimizes the possibility of these two to diverge over time.
make ci is the default for Jenkins and will also be used for
internal gating tests.

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

Related: rhbz#1656105
2019-03-04 22:08:43 +02:00
Alexander Todorov
561302a30a New test: Build qcow2 compose and test it with QEMU-KVM
Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
c24ad2fed7 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#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
41e3f8fecb 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#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
44a79a8a6b Install ansible and openstacksdk inside virtualenv
otherwise we get a conflict with python-ipaddress which is a
dependency of python2-pip and can't really be removed!

Installing from RPM is also a no-go b/c openstacksdk is
not available in EPEL 7. OTOH the RDO repositories which
OpenStack recommends have older version (0.11) and ansible wants
0.12 or later!

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
2f51fcfb8b Remove python-requests, python-dateutil and pyOpenSSL
b/c they conflict with the modules coming from pip and
prevent azure/ansible installation

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
5adde2671e Add /usr/local/bin to PATH for tests
pip will install commands there and later scripts will not be able
to find them.

Related rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
9c0f34c0ab Do not generate journal.xml from beakerlib
bacause this requires additional Python modules and we don't
really use it!

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Jan Stodola
cd1f26d4e7 Expand parameters as separate words
Related rhbz#1656105
2019-02-27 21:46:44 +02:00
Brian C. Lane
619daa1307 Automatic commit of package [lorax-composer] release [19.7.28-1].
Created by command:

/bin/tito tag
2019-02-25 12:03:19 -08:00
Brian C. Lane
f9c1dad0ba lorax-composer: Check for STATUS before deleting
When there is no run or new symlink do one last check to make sure no
STATUS file was written. If it is missing, go ahead and remove the
results directory.

(cherry picked from commit a8f616c6da)

Related: rhbz#1659129
2019-02-21 16:47:07 -08:00
Brian C. Lane
0baa524d8d Check for existing CANCEL request, and exit on FINISHED
If another CANCEL request has already been made just exit from
uuid_cancel. If the build is FINISHED before it times out just exit,
don't remove the finished results.

(cherry picked from commit 962d10b3b7)

Related: rhbz#1659129
2019-02-21 09:37:24 -08:00
Brian C. Lane
48c8ae6819 Add cancel_func to virt and novirt_install functions
In addition to monitoring the logs for errors, call a function (or
functions) that tell it to cancel the anaconda process and cleanup.

Also check for a cancel after creating the squashfs image for live-iso
since that's a long running process.

This required adding a new argument to a number of existing functions,
passing it down to VirtualInstall and novirt_install where the function
is called.

(cherry picked from commit 4b84475612)

Resolves: rhbz#1659129
2019-02-21 09:37:24 -08:00
Brian C. Lane
ade25f34b3 Remove duplicate repositories from the sources list
In some cases when the host has, for whatever reason, multiple copies of
the same repo listed the build may fail with an error about running out
of space.

So this commit removes duplicate entries after the host's repos have been
loaded. It also adjusts some of the test repos to use different
temporary repo names for the tests.

Resolves: rhbz#1664128
2019-02-21 09:19:30 -08:00