public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v5 4/4] test: Allow exeter & podman tests to be parallel executed with BATS
Date: Wed, 20 Aug 2025 20:54:56 +1000	[thread overview]
Message-ID: <20250820105456.1281906-5-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20250820105456.1281906-1-david@gibson.dropbear.id.au>

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 <david@gibson.dropbear.id.au>
---
 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 <david@gibson.dropbear.id.au>
 
+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
 
-- 
@@ -5,7 +5,9 @@
 # Copyright Red Hat
 # Author: David Gibson <david@gibson.dropbear.id.au>
 
+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


  parent reply	other threads:[~2025-08-20 10:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 10:54 [PATCH v5 0/4] RFC: New proof-of-concept based exeter tests David Gibson
2025-08-20 10:54 ` [PATCH v5 1/4] test: Extend test scripts to allow running " David Gibson
2025-08-20 10:54 ` [PATCH v5 2/4] test: Run static checkers as " David Gibson
2025-08-20 10:54 ` [PATCH v5 3/4] test: Convert build tests to exeter David Gibson
2025-08-20 10:54 ` David Gibson [this message]
2025-08-20 20:40 ` [PATCH v5 0/4] RFC: New proof-of-concept based exeter tests Stefano Brivio
2025-08-21  2:48   ` David Gibson
2025-08-21 21:27     ` Stefano Brivio
2025-08-25  1:55       ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250820105456.1281906-5-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).