Commit Graph

75 Commits

Author SHA1 Message Date
Brian C. Lane
0eda7829a8 tests: Remove unused lorax-composer tests
This leaves the composer-cli related tests, and switches the default
backend to osbuild-composer for the tests.
2020-09-30 16:35:51 -07:00
Brian C. Lane
7616a10373 Remove lorax-composer, it has been replaced by osbuild-composer
Remove the code, related files, and tests.
2020-09-30 15:42:46 -07:00
Alexander Todorov
cc29b99659 Set BACKEND=osbuild-composer if running that test scenario
- this will execute cli sanity tests in parallel with the other
- make sure to pass BACKED to vm.install too
- more checks in lib.sh
2020-07-23 10:20:47 -07:00
Alexander Todorov
14a3c8d5a7 tests: Use BACKEND env variable instead of hard-coded values
- default BACKEND to lorax-composer
- pass BACKEND everywhere we need to
2020-07-23 10:20:47 -07:00
Brian C. Lane
b86926e275 test: Use pytest instead of nose 2020-01-15 10:40:17 -08:00
Alexander Todorov
30d45a8880 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
2019-11-26 13:52:54 +02:00
Alexander Todorov
82e7335761 Always remove existing VM image before building new one 2019-11-26 13:52:54 +02:00
Jakub Rusz
e38e2ead1e tests: Changed Docker to podman in Makefile 2019-11-18 08:41:55 -08:00
Jakub Rusz
6839390be2 test: fix serializing repo_to_source test
Travis used fedora-32, this commit changes it to fedora-31.
2019-11-18 08:41:55 -08:00
Brian C. Lane
dcd92cf8c0 tests: Add 'test_mkksiso' tests
These use beakerlib to download a Fedora boot.iso and run mkksiso on
it. It currently does not try to boot the resulting iso, it mounts it
and checks that the expected config files have been modified and the
extra files have been added.
2019-11-05 11:09:42 -08:00
Alexander Todorov
1351c4dc63 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.
2019-11-05 19:05:33 +02:00
Alexander Todorov
e7e70313ef Remove unused make targets
these were only used by Jenkins but we don't have Jenkins anymore
2019-11-05 19:05:33 +02:00
Brian C. Lane
b5df65f658 Add composer and lifted to coverage report 2019-10-16 09:17:54 -07:00
Brian C. Lane
de314a0046 tests: Add yamllint of the lifted playbooks 2019-10-16 09:17:53 -07:00
Brian C. Lane
4da569442c tests: Add tests for the new lifted module
These tests cover most of the module's functions, except for the queue
monitor, and the actual execution of the playbooks.
2019-10-16 09:17:53 -07:00
Martin Pitt
a2c67385e4 Support CI testing against a bots project PR
* If `$COCKPIT_BOTS_REF` is set, check out that bots version instead of
   master.

 * Use git cache in $XDG_CACHE_HOME if available. Our CI uses that to
   save downloads, and it does not get in the way for local developers.

Adapted from https://github.com/cockpit-project/starter-kit/pull/233
2019-10-14 20:57:25 +02:00
Martin Pitt
29c308ae73 Makefile: Don't clobber an existing bots checkout
Commit 4643afa58 was a thinko -- for our CI we *don't* want our test to
clobber a pre-existing bots/ checkout, as we often use this to run tests
against an updated image or to validate a changes to the bots project.

On developer machines, bots may also be a symlink to an actual bots
directory in development, so don't clobber that.

Stop making "bots" a phony target, and drop the now unnecessary
`[ -d bots ]` check.

Adapted from https://github.com/cockpit-project/starter-kit/pull/232
2019-10-14 20:57:25 +02:00
Sanne Raymaekers
4643afa58d Makefile: Update bots target for moved GitHub project
Cockpit bots are in their own project now.

Make the target phony so that `make bots` updates an existing checkout.
2019-09-24 10:20:56 +02:00
Jiri Kortus
421cc9c22f tests: Add kickstart tar installation test 2019-09-09 09:28:52 +02:00
Brian C. Lane
7ff4d7ac9e tests: Add RUN_TESTS to Makefile so you can pass in targets
Also add a test_cli target to run things like the blueprint cli tests.
Run this like so:

RUN_TESTS="ci test_cli" make test-in-docker

If nothing is passed it will run the "ci" target.
2019-06-25 14:13:53 +02:00
Alexander Todorov
eb8ca5b5bf Remove quotes around file test in make vm
otherwise make thinks credentials file doesn't exist and
doesn't include it in the VM image causing all cloud tests to
fail.
2019-06-06 14:56:40 +02:00
Alexander Todorov
b67ce5379c Use cloud credentials during test if they exist 2019-05-31 12:57:23 +02:00
Alexander Todorov
6c2b34bf15 Don't execute compose/blueprint sanity tests in Travis CI
instead they will be executed in Cockpit CI
2019-05-31 12:57:23 +02:00
Brian C. Lane
6120f74c73 Revert "Add rpmfluff temporarily"
This reverts commit 6ea1c45734.

python-rpmfluff-0.5.7.1-1 is now available.
2019-05-23 14:57:46 -07:00
Lars Karlitski
250f49f78d Use Cockpit's test images and infrastructure
Allows to run the tests on multiple operating systems and on the
infrastructure that the Cockpit team maintains.

`make vm` downloads one of Cockpit's test images (override which one
with TEST_OS) and installs rpms build from the local checkout of lorax.
The resulting image is placed in `test/images/$TEST_OS`.

TEST_OS can be set to any of Cockpit's supported images (default:
fedora-30).

Run `make check-vm` to run the CLI checks in the VM. The bulk of the
work is done in `test/check-cli`, which uses Cockpit's `bots` library to
start the VM and run the script in it.

Also included is a `test/run` script, which is the entrypoint for
Cockpit's test infrastructure.
2019-05-20 20:24:01 +02:00
Brian C. Lane
6ea1c45734 Add rpmfluff temporarily
There is a problem with rpmfluff and the current version of rpm in
rawhide.

Changes are upstream, but no new build has been done yet.
2019-05-02 16:21:36 -07:00
Brian C. Lane
2acd13d612 Make it easier to generate docs for the next release
Change the docs-in-docker target to generate the docs for the NEXT
release, not the current one. Also pass in uid/gid so that the new files
can be set to the correct ownership instead of root.

Modify docs/conf.py to bump the version of the docs if
LORAX_VERSION=next is set in the environment.
2019-03-26 16:55:51 -07:00
Alexander Todorov
f5286e1243 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.
2019-03-10 21:31:33 +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
Alexander Todorov
b936dfb198 New test: Build qcow2 compose and test it with QEMU-KVM 2019-02-27 10:36:44 +02:00
Brian C. Lane
a7e96ab828 Makefile: Make the .test-results directory
podman won't run if it is missing.
2019-02-25 14:37:57 -08:00
Jan Stodola
ce110afd22 Add script for removing old artifacts from VMware 2019-02-25 11:40:03 +02:00
Alexander Todorov
ea78cce882
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.
2019-02-18 19:14:56 +02:00
Jan Stodola
f26fcba902 Add script for removing old artifacts from Azure 2019-02-06 09:38:18 +01:00
Jan Stodola
67dcff18d9 Collect results from all cleanup scripts
Correctly detect if any of the executed cleanup scripts didn't pass.
2019-01-29 10:43:43 +02:00
Jan Stodola
6680e2ffec Add script for removing old artifacts from OpenStack 2019-01-24 14:12:27 +02:00
Jan Stodola
677c858f60 Add script for removing old artifacts from AWS 2019-01-21 10:54:59 +02:00
Alexander Todorov
57b4f2e8f3 Add empty ci_after_success target for Jenkins
Jenkins uses templates to define all jobs which means they need to
have the same make targets even if the targets don't do anything.
2018-12-03 11:36:29 +02:00
Alexander Todorov
366ae55abe Add make targets for Jenkins
these targets help hooking up things in Jenkins and enable us to
perform build & deploy tests for cloud images.

NOTE: use sudo -E to preserve the environment
2018-11-29 09:46:06 +02:00
Brian C. Lane
b61a91954a Fix reporting of coverage results to coverall.io
When I re-arranged the test-in-docker I didn't realize how .travis.yml
was extracting the results. This should fix it.

When running with test-in-docker we mount the source read-only on
/linux-ro/ inside the container and copy it over to /lorax/ for running
the tests.

The local directory ./.test-results/ is mounted on /test-results/ in the
container and the .coverage file is copied into there so that it is
available on the host.
2018-11-14 09:11:03 -08:00
Brian C. Lane
8a26d0648e Stop using build to run the tests, allow using podman
To use podman run the tests like this:
DOCKER=podman make test-in-docker

This now builds the welder/lorax-tests image as a separate step from
running the tests.

Running the tests uses the welder/lorax-tests image and mounts the
source directory read-only, copies it into /lorax-test/ and runs the
tests from there.
2018-11-12 11:13:37 -08:00
Brian C. Lane
7500a17f27 Build manpages for composer-cli and lorax-composer
Add manpage creation to make docs target to keep them updated.
2018-10-29 13:31:30 -07:00
Brian C. Lane
c017300ad6 Revert "Rename composer-cli to composer"
This reverts commit c9be91c879.

It conflicts with the PHP dependency manager project named 'composer'
2018-10-08 09:23:47 -07:00
Alexander Todorov
8e0b7ba2ca Execute bash tests for composer-cli
these are built on top of beakerlib and we use its internal
protocol to figure out the result without relying on the full
test runner that is tipically used inside of a RHEL environment!

Includes a disabled test snippet for Issue #460
2018-09-20 16:07:57 +03:00
Lars Karlitski
c9be91c879 Rename composer-cli to composer 2018-09-20 12:02:03 +03:00
Stef Walter
ec1ebbc623 Makefile: Fix the 'make install' target
This fixes the 'make install' target to work on a typical RHEL or
Fedora system. We now by default install to a prefix of /usr instead
of /usr/local

The prefix is overridable like so:

     $ make install PREFIX=/opt/
2018-09-19 08:47:08 -07:00
Brian C. Lane
0432c6d56e Add a Makefile target for building html docs using a rawhide environment
This makes it easier to generate new documentation for
http://weldr.io/lorax/

It requires having a current welder/lorax-composer:latest image (created with
the test-in-docker target), then run docs-in-docker to rerun sphinx with
the docs/html directory mounted from the container.
2018-09-07 09:54:21 -07:00
Will Woods
2d01bec2b2 Add etc/bash_completion.d/composer-cli
Here's a bash_completion file for composer-cli! It completes known
commands, subcommands, and flags, plus arguments to flags that take
arguments, and if you've got write access to the socket it'll also
autocomplete:

* source names for commands that need source names
* blueprint names for commands that take blueprint names
* compose uuids for commands that take compose uuids
  * intelligently only suggests appropriate uuids - e.g. only
    suggests uuids of running composes for "compose cancel"

NOTE: bash completion scripts are horrible and this is no exception.
Please forgive me.
2018-08-07 13:00:56 -04:00
Brian C. Lane
db67c1267a Move lorax-composer and composer-cli argument parsing into modules
This allows sphinx-argparse to document them automatically.
2018-05-14 13:00:15 -07:00
Brian C. Lane
825d1931e4 Add composer-cli and tests 2018-05-14 13:00:15 -07:00