As a proof-of-concept, this adds a "make bats" target which will execute
both the podman and exeter based testcases in parallel using BATS.
Signed-off-by: David Gibson
---
test/.gitignore | 1 +
test/Makefile | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/test/.gitignore b/test/.gitignore
index cf48b885..9412f0d3 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -12,3 +12,4 @@ rampstream
guest-key
guest-key.pub
/exeter/
+*.bats
diff --git a/test/Makefile b/test/Makefile
index 332f3f3e..1853fea3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -5,7 +5,9 @@
# Copyright Red Hat
# Author: David Gibson
+BATS = bats -j $(shell nproc)
WGET = wget -c
+EXETOOL = ./exeter/exetool/exetool
DEBIAN_IMGS = debian-8.11.0-openstack-amd64.qcow2 \
debian-10-nocloud-amd64.qcow2 \
@@ -62,6 +64,12 @@ LOCAL_ASSETS = mbuto.img mbuto.mem.img podman/bin/podman QEMU_EFI.fd \
ASSETS = $(DOWNLOAD_ASSETS) $(LOCAL_ASSETS)
+EXETER_PYPATH = exeter/py3
+EXETER_BATS = smoke/smoke.sh.bats \
+ build/build.py.bats build/static_checkers.sh.bats
+BATS_FILES = $(EXETER_BATS) \
+ podman/test/system/505-networking-pasta.bats
+
CFLAGS = -Wall -Werror -Wextra -pedantic -std=c99
assets: $(ASSETS)
@@ -73,6 +81,8 @@ pull-%: %
exeter:
git clone https://gitlab.com/dgibson/exeter.git
+$(EXETOOL): pull-exeter
+
mbuto:
git clone git://mbuto.sh/mbuto
@@ -118,6 +128,12 @@ medium.bin:
big.bin:
dd if=/dev/urandom bs=1M count=10 of=$@
+$(EXETER_BATS): %.bats: % $(EXETOOL)
+ PYTHONPATH=$(EXETER_PYPATH) $(EXETOOL) bats -- $< > $@
+
+bats: $(BATS_FILES) pull-podman
+ PYTHONPATH=$(EXETER_PYPATH) CONTAINERS_HELPER_BINARY_DIR=.. $(BATS) $(BATS_FILES)
+
check: assets
./run
@@ -127,6 +143,7 @@ debug: assets
clean:
rm -f perf.js *~
rm -f $(LOCAL_ASSETS)
+ rm -f $(EXETER_BATS)
rm -rf test_logs
rm -f prepared-*.qcow2 prepared-*.img
--
2.50.1