Blob Blame History Raw
From 71627db6c8852d7805ec559506f5f3cb8d89a131 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Wed, 30 Jan 2019 15:12:54 +0100
Subject: [PATCH] Support DLZ filesystem detection in feature-test

Do not use variable from configure to detect the feature.
---
 bin/tests/system/Makefile.in                     | 2 +-
 bin/tests/system/dlz/{prereq.sh.in => prereq.sh} | 2 +-
 bin/tests/system/feature-test.c                  | 9 +++++++++
 configure.ac                                     | 1 -
 4 files changed, 11 insertions(+), 3 deletions(-)
 rename bin/tests/system/dlz/{prereq.sh.in => prereq.sh} (91%)

diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in
index c18b4c5..dea2f75 100644
--- a/bin/tests/system/Makefile.in
+++ b/bin/tests/system/Makefile.in
@@ -19,7 +19,7 @@ SUBDIRS =	dlzexternal dyndb lwresd pipelined rndc rsabigexponent tkey
 
 CINCLUDES =	${ISC_INCLUDES} ${DNS_INCLUDES}
 
-CDEFINES =	@USE_GSSAPI@
+CDEFINES =	@USE_GSSAPI@ @CONTRIB_DLZ@
 CWARNINGS =
 
 DNSLIBS =
diff --git a/bin/tests/system/dlz/prereq.sh.in b/bin/tests/system/dlz/prereq.sh
similarity index 91%
rename from bin/tests/system/dlz/prereq.sh.in
rename to bin/tests/system/dlz/prereq.sh
index afec653..fb3328e 100644
--- a/bin/tests/system/dlz/prereq.sh.in
+++ b/bin/tests/system/dlz/prereq.sh
@@ -12,7 +12,7 @@
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
-if [ "@DLZ_SYSTEM_TEST@" != "filesystem" ]; then
+if ! $FEATURETEST --with-dlz-filesystem; then
         echo_i "DLZ filesystem driver not supported"
         exit 255
 fi
diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c
index 11863a3..428d107 100644
--- a/bin/tests/system/feature-test.c
+++ b/bin/tests/system/feature-test.c
@@ -51,6 +51,7 @@ usage() {
 	fprintf(stderr, "	--rpz-nsip\n");
 	fprintf(stderr, "	--with-idn\n");
 	fprintf(stderr, "	--with-lmdb\n");
+	fprintf(stderr, "	--with-dlz-filesystem\n");
 }
 
 int
@@ -182,6 +183,14 @@ main(int argc, char **argv) {
 #endif
 	}
 
+	if (strcmp(argv[1], "--with-dlz-filesystem") == 0) {
+#ifdef DLZ_FILESYSTEM
+		return (0);
+#else
+		return (1);
+#endif
+	}
+
 	if (strcmp(argv[1], "--ipv6only=no") == 0) {
 #ifdef WIN32
 		return (0);
diff --git a/configure.ac b/configure.ac
index fddc63a..5e1ba8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5458,7 +5458,6 @@ AC_CONFIG_FILES([
 	bin/tests/pkcs11/benchmarks/Makefile
 	bin/tests/system/Makefile
 	bin/tests/system/conf.sh
-	bin/tests/system/dlz/prereq.sh
 	bin/tests/system/dlzexternal/Makefile
 	bin/tests/system/dlzexternal/ns1/dlzs.conf
 	bin/tests/system/dyndb/Makefile
-- 
2.20.1