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
This commit is contained in:
Alexander Todorov 2019-10-22 09:03:20 -04:00 committed by Brian C. Lane
parent 60ef7231fe
commit a0cee0b543
2 changed files with 16 additions and 0 deletions

View File

@ -127,6 +127,15 @@ $(VM_IMAGE): srpm bots
vm: $(VM_IMAGE) vm: $(VM_IMAGE)
echo $(VM_IMAGE) echo $(VM_IMAGE)
# grab all repositories from the host system, overwriting what's inside the VM
# and update the image. Mostly used when testing downstream snapshots to make
# sure VM_IMAGE is as close as possible to the host!
vm-local-repos: vm
bots/image-customize -v \
--upload /etc/yum.repos.d:/etc/yum.repos.d/ \
--run-command "yum -y update" \
$(TEST_OS)
vm-reset: vm-reset:
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2 rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2

View File

@ -38,6 +38,13 @@ To delete the generated image, run
Base images are stored in `bots/images`. Set `TEST_DATA` to override this Base images are stored in `bots/images`. Set `TEST_DATA` to override this
directory. directory.
Use
$ make vm-local-repos
to configure the image with all repositories found on the host system! This
is mostly useful when running tests by hand on a downstream snapshot!
## Running tests ## Running tests
After building a test image, run After building a test image, run