From daf71fa26785943618eb21f61d58ec09f9ee26e9 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Tue, 22 Oct 2019 09:03:20 -0400 Subject: [PATCH] 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 1351c4dc63f1e8d4f3b36f08ede346be46bbdeff Related: rhbz#1769525 --- Makefile | 9 +++++++++ test/README.md | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/Makefile b/Makefile index ca0ee865..7189c0c4 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,15 @@ $(VM_IMAGE): srpm bots vm: $(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: rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2 diff --git a/test/README.md b/test/README.md index 72732ea4..50888665 100644 --- a/test/README.md +++ b/test/README.md @@ -38,6 +38,13 @@ To delete the generated image, run Base images are stored in `bots/images`. Set `TEST_DATA` to override this 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 After building a test image, run