1e41691
From 71627db6c8852d7805ec559506f5f3cb8d89a131 Mon Sep 17 00:00:00 2001
d0d7288
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
d0d7288
Date: Wed, 30 Jan 2019 15:12:54 +0100
d0d7288
Subject: [PATCH] Support DLZ filesystem detection in feature-test
d0d7288
d0d7288
Do not use variable from configure to detect the feature.
d0d7288
---
d0d7288
 bin/tests/system/Makefile.in                     | 2 +-
d0d7288
 bin/tests/system/dlz/{prereq.sh.in => prereq.sh} | 2 +-
d0d7288
 bin/tests/system/feature-test.c                  | 9 +++++++++
1e41691
 configure.ac                                     | 1 -
d0d7288
 4 files changed, 11 insertions(+), 3 deletions(-)
d0d7288
 rename bin/tests/system/dlz/{prereq.sh.in => prereq.sh} (91%)
d0d7288
d0d7288
diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in
d0d7288
index c18b4c5..dea2f75 100644
d0d7288
--- a/bin/tests/system/Makefile.in
d0d7288
+++ b/bin/tests/system/Makefile.in
d0d7288
@@ -19,7 +19,7 @@ SUBDIRS =	dlzexternal dyndb lwresd pipelined rndc rsabigexponent tkey
d0d7288
 
d0d7288
 CINCLUDES =	${ISC_INCLUDES} ${DNS_INCLUDES}
d0d7288
 
d0d7288
-CDEFINES =	@USE_GSSAPI@
d0d7288
+CDEFINES =	@USE_GSSAPI@ @CONTRIB_DLZ@
d0d7288
 CWARNINGS =
d0d7288
 
d0d7288
 DNSLIBS =
d0d7288
diff --git a/bin/tests/system/dlz/prereq.sh.in b/bin/tests/system/dlz/prereq.sh
d0d7288
similarity index 91%
d0d7288
rename from bin/tests/system/dlz/prereq.sh.in
d0d7288
rename to bin/tests/system/dlz/prereq.sh
d0d7288
index afec653..fb3328e 100644
d0d7288
--- a/bin/tests/system/dlz/prereq.sh.in
d0d7288
+++ b/bin/tests/system/dlz/prereq.sh
d0d7288
@@ -12,7 +12,7 @@
d0d7288
 SYSTEMTESTTOP=..
d0d7288
 . $SYSTEMTESTTOP/conf.sh
d0d7288
 
d0d7288
-if [ "@DLZ_SYSTEM_TEST@" != "filesystem" ]; then
d0d7288
+if ! $FEATURETEST --with-dlz-filesystem; then
d0d7288
         echo_i "DLZ filesystem driver not supported"
d0d7288
         exit 255
d0d7288
 fi
d0d7288
diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c
1e41691
index 11863a3..428d107 100644
d0d7288
--- a/bin/tests/system/feature-test.c
d0d7288
+++ b/bin/tests/system/feature-test.c
d0d7288
@@ -51,6 +51,7 @@ usage() {
d0d7288
 	fprintf(stderr, "	--rpz-nsip\n");
d0d7288
 	fprintf(stderr, "	--with-idn\n");
d0d7288
 	fprintf(stderr, "	--with-lmdb\n");
d0d7288
+	fprintf(stderr, "	--with-dlz-filesystem\n");
d0d7288
 }
d0d7288
 
d0d7288
 int
d0d7288
@@ -182,6 +183,14 @@ main(int argc, char **argv) {
d0d7288
 #endif
d0d7288
 	}
d0d7288
 
d0d7288
+	if (strcmp(argv[1], "--with-dlz-filesystem") == 0) {
d0d7288
+#ifdef DLZ_FILESYSTEM
d0d7288
+		return (0);
d0d7288
+#else
d0d7288
+		return (1);
d0d7288
+#endif
d0d7288
+	}
d0d7288
+
d0d7288
 	if (strcmp(argv[1], "--ipv6only=no") == 0) {
d0d7288
 #ifdef WIN32
d0d7288
 		return (0);
1e41691
diff --git a/configure.ac b/configure.ac
1e41691
index fddc63a..5e1ba8c 100644
1e41691
--- a/configure.ac
1e41691
+++ b/configure.ac
1e41691
@@ -5458,7 +5458,6 @@ AC_CONFIG_FILES([
d0d7288
 	bin/tests/pkcs11/benchmarks/Makefile
d0d7288
 	bin/tests/system/Makefile
d0d7288
 	bin/tests/system/conf.sh
d0d7288
-	bin/tests/system/dlz/prereq.sh
d0d7288
 	bin/tests/system/dlzexternal/Makefile
d0d7288
 	bin/tests/system/dlzexternal/ns1/dlzs.conf
d0d7288
 	bin/tests/system/dyndb/Makefile
d0d7288
-- 
d0d7288
2.20.1
d0d7288