tests: If TEST_OS isn't specified then match the host OS

this will help with downstream snapshots testing making
it easier to match the host OS snapshot

Cherry-picked from 6839390be2

Related: rhbz#1770193
This commit is contained in:
Alexander Todorov 2019-11-27 14:01:04 +02:00 committed by Alexander Todorov
parent b81e260c4d
commit bc0dd4c92c

View File

@ -10,7 +10,9 @@ TAG = lorax-$(VERSION)-$(RELEASE)
IMAGE_RELEASE = $(shell awk -F: '/FROM/ { print $$2}' Dockerfile.test) IMAGE_RELEASE = $(shell awk -F: '/FROM/ { print $$2}' Dockerfile.test)
ifeq ($(TEST_OS),) ifeq ($(TEST_OS),)
TEST_OS = rhel-7-7 OS_ID = $(shell awk -F= '/^ID=/ {print $$2}' /etc/os-release)
OS_VERSION = $(shell awk -F= '/^VERSION_ID/ {print $$2}' /etc/os-release | tr '.' '-')
TEST_OS = $(OS_ID)-$(OS_VERSION)
endif endif
export TEST_OS export TEST_OS
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)