Blob Blame History Raw
From d059664e2de82a2e212fe14f3799450ca4ef5a51 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Wed, 27 Nov 2019 13:32:42 -0500
Subject: [PATCH 08/37] test: build: add support for running in containers

This is just a dummy target at the moment.

(cherry picked from commit df13ebc5d8df69b0b0b15c6777c8bb906a67bf5b)
(cherry picked from commit 11c36a3c81987f4e34bf87e99d0800401c24561f)
---
 Makefile.am           | 3 +++
 README                | 7 +++++++
 configure.ac          | 1 +
 src/tests/Makefile.am | 4 ++++
 4 files changed, 15 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index b3dbce1f2b11..c377d6f63792 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,6 +78,9 @@ dist-check:
 		exit 1; \
 	fi
 
+check-container:
+	$(MAKE) -C src/tests $@
+
 update-docs:
 	$(MAKE) -C doc/xml
 
diff --git a/README b/README
index 181d50f301e9..9cb2ef4a15b7 100644
--- a/README
+++ b/README
@@ -102,6 +102,13 @@ Or just the keywords
     |awk '/^[[:space:]]*[[:digit:]]+/{getline; print $0}' \
     |tr ' ' '\n' |sort |uniq
 
+There is also a check-container target that will run the testsuite inside
+various podman/docker containers. This is useful for coverage of multiple
+distributions. As a bonus, it allows us to run tests that may be destructive to
+the host (container) such as NetworkManager integration tests.
+
+  make check-container TESTSUITEFLAGS="-j4"
+
 RPM package
 -----------
 
diff --git a/configure.ac b/configure.ac
index 39d6af1f89f1..0758c69d442c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,7 @@ AC_PATH_PROG([RMMOD], [rmmod], [/sbin/rmmod])
 AC_PATH_PROG([SYSCTL], [sysctl], [/sbin/sysctl])
 
 AC_CONFIG_TESTDIR([src/tests])
+AC_PATH_PROGS([PODMAN], [podman docker], [/bin/false])
 
 GLIB_GSETTINGS
 
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 09bf699b81d0..84c076c847b0 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -41,3 +41,7 @@ AUTOTEST = $(AUTOM4TE) --language=autotest
 $(TESTSUITE): $(TESTSUITE_FILES) $(srcdir)/package.m4
 	$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
 	mv $@.tmp $@
+
+check-container:
+
+.PHONY: check-container
-- 
2.23.0