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