dist-git/beaker-tests
2020-05-16 22:07:40 +02:00
..
data add tests with rpkg and move them to basic test 2018-01-13 21:32:01 +01:00
files/etc update fedpkg config for f31 fedpkg 2020-05-13 09:00:33 +02:00
pkgs-files simplified tests not to used https for lookaside 2018-02-06 15:39:48 +01:00
tests run grok-mirror related tests only if grok-mirror is installed 2020-05-16 18:09:00 +02:00
Makefile beaker-tests added 2017-02-09 15:24:03 +01:00
PURPOSE beaker-tests added 2017-02-09 15:24:03 +01:00
README.md add note about problems with default vagrant file ownership 2020-05-16 22:07:40 +02:00
run.sh disable rhpkg tests as it is not a public tool 2020-05-13 09:00:33 +02:00
setup.sh install test deps by a single command in beaker-tests/setup.sh 2020-05-16 18:08:18 +02:00

How to run tests

The following command will setup your system, setup a Fedora virtual machine and run tests from the ./tests/ subdirectory. You need to be root and the command will modify your system, i.e. install some packages, overwrite /etc/rpkg/*.conf configs and /etc/rpkg.conf, write an entry into /etc/hosts, and generates root ssh public key if not generated yet.

# ./run.sh

The setup part for most of the host system modifications and creation of the virtual machine is done by ./setup.sh script that is invoked from run.sh and is the part that requires root privileges. Use cat setup.sh to see what the script does. You can choose not to run the script during ./run.sh execution if you have run it before (either through ./run.sh or ./setup.sh directly). To do this, pass -x switch to ./run.sh:

# ./run.sh -x

To run the tests for CentOS-7 (with epel-7 repos enabled) instead of Fedora, you can use:

# DISTGIT_FLAVOR=dist-git-centos-7 ./run.sh

This will spawn a new CentOS-7/epel-7 virtual machine.

To do the same for CentOS-8 (with epel-8 repos enabled), you can use:

# DISTGIT_FLAVOR=dist-git-centos-8 ./run.sh

Between each run, you need to remove pkgs.example.org record from /root/.ssh/known_hosts and you should also clean-up /etc/hosts from stale pkgs.example.org records.

Once the virtual machine you want to test exists and once it is correctly pointed to by pkgs.example.org IP record in /etc/hosts, you can again run just ./run.sh -x to skip the ./setup.sh invocation.

At this point, you can also run just a specific test by switching into ./tests/<testname> subdirectory and invoking ./run.sh there. Alternatively, you can pass -r <testname> together with -x switch to the master ./run.sh script (the one next to this README):

# ./run.sh -x -r fedpkg-test

If you want to look inside the created virtual machines, switch to the git top-level directory and run vagrant ssh <dist-git-flavour> command there as root, e.g.:

# vagrant ssh dist-git

to switch to the Fedora virtual machine.

Or

# vagrant ssh dist-git-centos-8

to switch to CentOS-8/epel-8 virtual machine.

NOTES:

If you encounter vagrant error like: Call to virDomainCreateWithFlags failed: Cannot access storage file '/root/.local/share/libvirt/images/dist-git_dist-git.img' (as uid:107, gid:107): Permission denied, add the following into /etc/libvirt/qemu.conf.

user=root
group=root