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
This commit is contained in:
Alexander Todorov 2019-11-21 13:25:00 +02:00 committed by Alexander Todorov
parent 70baff3bc2
commit 30d45a8880
2 changed files with 15 additions and 4 deletions

View File

@ -21,6 +21,10 @@ endif
export TEST_OS export TEST_OS
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
ifeq ($(REPOS_DIR),)
REPOS_DIR = /etc/yum.repos.d
endif
default: all default: all
src/composer/version.py: lorax.spec src/composer/version.py: lorax.spec
@ -166,8 +170,14 @@ vm: $(VM_IMAGE)
# sure VM_IMAGE is as close as possible to the host! # sure VM_IMAGE is as close as possible to the host!
vm-local-repos: vm vm-local-repos: vm
bots/image-customize -v \ bots/image-customize -v \
--upload /etc/yum.repos.d:/etc/yum.repos.d/ \ --run-command "rm -rf /etc/yum.repos.d" \
$(TEST_OS)
bots/image-customize -v \
--upload $(REPOS_DIR):/etc/yum.repos.d \
--run-command "yum -y remove composer-cli lorax-composer" \
--run-command "yum -y update" \ --run-command "yum -y update" \
--run-command "yum -y install composer-cli lorax-composer" \
--run-command "systemctl enable lorax-composer" \
$(TEST_OS) $(TEST_OS)
vm-reset: vm-reset:

View File

@ -41,12 +41,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 To configure the image with all repositories found on the host system use
$ make vm-local-repos $ make vm-local-repos
to configure the image with all repositories found on the host system! This You may also define `REPOS_DIR` variable to point to another directory
is mostly useful when running tests by hand on a downstream snapshot! containing yum .repo files. By default the value is `/etc/yum.repos.d`!
This is mostly useful when running tests by hand on a downstream snapshot!
## Running tests ## Running tests