diff --git a/Makefile b/Makefile index 5113f199..dc061c34 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,10 @@ endif export TEST_OS VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) +ifeq ($(REPOS_DIR),) +REPOS_DIR = /etc/yum.repos.d +endif + default: all src/composer/version.py: lorax.spec @@ -134,8 +138,14 @@ vm: $(VM_IMAGE) # 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 "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 install composer-cli lorax-composer" \ + --run-command "systemctl enable lorax-composer" \ $(TEST_OS) vm-reset: diff --git a/test/README.md b/test/README.md index 9c314465..3e9cde83 100644 --- a/test/README.md +++ b/test/README.md @@ -41,12 +41,13 @@ To delete the generated image, run Base images are stored in `bots/images`. Set `TEST_DATA` to override this directory. -Use +To configure the image with all repositories found on the host system 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! +You may also define `REPOS_DIR` variable to point to another directory +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