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