Blame SOURCES/0014-test-build-support-integration-tests.patch

66253d
From a49f1e42bc8ac34df7790446e3a421d376c4d216 Mon Sep 17 00:00:00 2001
66253d
From: Eric Garver <eric@garver.life>
66253d
Date: Mon, 16 Dec 2019 13:11:24 -0500
66253d
Subject: [PATCH 14/37] test: build: support integration tests
66253d
66253d
These use the target "check-integration". We use a separate target
66253d
because these tests may be destructive to the host. The plan is to run
66253d
them from within the "check-container" target.
66253d
66253d
(cherry picked from commit ab6c22b8419f5eb333484376ea41d592c809eb2a)
66253d
(cherry picked from commit 50c393d5618bf34110b59a3805963444e5f41e3a)
66253d
---
66253d
 Makefile.am                        |  4 +++-
66253d
 src/tests/Makefile.am              | 17 ++++++++++++++++-
66253d
 src/tests/integration/testsuite.at | 11 +++++++++++
66253d
 3 files changed, 30 insertions(+), 2 deletions(-)
66253d
 create mode 100644 src/tests/integration/testsuite.at
66253d
66253d
diff --git a/Makefile.am b/Makefile.am
66253d
index c377d6f63792..85da0b5857d2 100644
66253d
--- a/Makefile.am
66253d
+++ b/Makefile.am
66253d
@@ -78,9 +78,11 @@ dist-check:
66253d
 		exit 1; \
66253d
 	fi
66253d
 
66253d
-check-container:
66253d
+check-container check-integration installcheck-integration:
66253d
 	$(MAKE) -C src/tests $@
66253d
 
66253d
+.PHONY: check-container check-integration installcheck-integration
66253d
+
66253d
 update-docs:
66253d
 	$(MAKE) -C doc/xml
66253d
 
66253d
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
66253d
index cef17b6eba4b..c00c198bf9bb 100644
66253d
--- a/src/tests/Makefile.am
66253d
+++ b/src/tests/Makefile.am
66253d
@@ -1,12 +1,16 @@
66253d
 TESTSUITE = $(srcdir)/testsuite
66253d
+TESTSUITE_INTEGRATION = $(srcdir)/integration/testsuite
66253d
+
66253d
 TESTSUITE_FILES = \
66253d
 	$(wildcard $(srcdir)/*.at) \
66253d
 	$(wildcard $(srcdir)/dbus/*.at) \
66253d
 	$(wildcard $(srcdir)/features/*.at) \
66253d
+	$(wildcard $(srcdir)/integration/*.at) \
66253d
 	$(wildcard $(srcdir)/regression/*.at)
66253d
 
66253d
 EXTRA_DIST = \
66253d
 	$(TESTSUITE) \
66253d
+	$(TESTSUITE_INTEGRATION) \
66253d
 	$(TESTSUITE_FILES) \
66253d
 	$(wildcard $(srcdir)/python/*.py) \
66253d
 	$(srcdir)/package.m4 \
66253d
@@ -38,7 +42,7 @@ clean-local:
66253d
 
66253d
 AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
66253d
 AUTOTEST = $(AUTOM4TE) --language=autotest
66253d
-$(TESTSUITE): $(TESTSUITE_FILES) $(srcdir)/package.m4
66253d
+$(TESTSUITE) $(TESTSUITE_INTEGRATION): $(TESTSUITE_FILES) $(srcdir)/package.m4
66253d
 	$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
66253d
 	mv $@.tmp $@
66253d
 
66253d
@@ -80,3 +84,14 @@ check-container: check-container-fedora-rawhide
66253d
 .PHONY: check-container
66253d
 .PHONY: check-container-debian-sid
66253d
 .PHONY: check-container-fedora-rawhide
66253d
+
66253d
+check-integration: atconfig atlocal $(TESTSUITE_INTEGRATION)
66253d
+	$(SHELL) '$(TESTSUITE_INTEGRATION)' $(TESTSUITEFLAGS) \
66253d
+		AUTOTEST_PATH="src" \
66253d
+		PYTHONPATH="${abs_top_srcdir}/src:${PYTHONPATH}" \
66253d
+		FIREWALLD_DEFAULT_CONFIG="${abs_top_srcdir}/config"
66253d
+
66253d
+installcheck-integration: atconfig atlocal $(TESTSUITE_INTEGRATION)
66253d
+	$(SHELL) '$(TESTSUITE_INTEGRATION)' $(TESTSUITEFLAGS)
66253d
+
66253d
+.PHONY: check-integration installcheck-integration
66253d
diff --git a/src/tests/integration/testsuite.at b/src/tests/integration/testsuite.at
66253d
new file mode 100644
66253d
index 000000000000..bbaf07a191b9
66253d
--- /dev/null
66253d
+++ b/src/tests/integration/testsuite.at
66253d
@@ -0,0 +1,11 @@
66253d
+AT_INIT
66253d
+AT_COLOR_TESTS
66253d
+
66253d
+dnl Override m4_include to avoid warning about inclusion
66253d
+dnl
66253d
+m4_define([m4_include], [m4_builtin([include], [$1])])
66253d
+
66253d
+m4_include([functions.at])
66253d
+
66253d
+m4_foreach([FIREWALL_BACKEND], [[nftables], [iptables]], [
66253d
+])
66253d
-- 
66253d
2.23.0
66253d