Add testing

This commit is contained in:
Kyrylo Gliebov 2018-10-30 15:42:52 +01:00
parent 0f37e525d7
commit 67716138d2
3 changed files with 44 additions and 33 deletions

View file

@ -2,7 +2,7 @@
PACKAGE_NAME := $(shell awk '/"name":/ {gsub(/[",]/, "", $$2); print $$2}' package.json)
VERSION := $(shell T=$$(git describe 2>/dev/null) || T=1; echo $$T | tr '-' '.')
ifeq ($(TEST_OS),)
TEST_OS = centos-7
TEST_OS = rhel-x
endif
export TEST_OS
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
@ -120,6 +120,7 @@ rpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
$(VM_IMAGE): rpm bots
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
bots/image-customize -v -i cockpit -i `pwd`/cockpit-$(PACKAGE_NAME)-*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS)
bots/image-customize -v -u ./test/files/1.journal:/root/1.journal $(TEST_OS)
# convenience target for the above
vm: $(VM_IMAGE)
@ -127,7 +128,7 @@ vm: $(VM_IMAGE)
# run the browser integration tests; skip check for SELinux denials
check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
TEST_AUDIT_NO_SELINUX=1 test/check-application
TEST_AUDIT_NO_SELINUX=1 test/check-application -s
# checkout Cockpit's bots/ directory for standard test VM images and API to launch them
# must be from cockpit's master, as only that has current and existing images; but testvm.py API is stable
@ -139,7 +140,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 176
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 180
git checkout --force FETCH_HEAD -- test/common
git reset test/common