]> The Tcpdump Group git mirrors - tcpdump/commitdiff
make NFLOG test case conditional
authorDenis Ovsienko <[email protected]>
Wed, 23 Apr 2014 19:47:41 +0000 (23:47 +0400)
committerDenis Ovsienko <[email protected]>
Wed, 23 Apr 2014 19:55:50 +0000 (23:55 +0400)
Not all libpcap copies have the support for NFLOG (added in 2013), thus
only run the test when tcpdump was compiled for it.

tests/TESTLIST
tests/nflog-e.sh [new file with mode: 0755]

index 6726fa52b208e1816d5134a40a501ec75890bfb6..91a24d04a779a0d3be36c8e947c5c52814b86c68 100644 (file)
@@ -179,8 +179,7 @@ geonet-calm-fast    geonet_and_calm_fast.pcap       geonet_and_calm_fast.out        -t -vv -n
 m3ua isup.pcap isup.out -t
 m3ua-vv isup.pcap isupvv.out -t -vv
 
-# NFLOG test case
-nflog-e                nflog.pcap              nflog-e.out             -t -e
+# NFLOG test case moved to nflog-e.sh
 
 # syslog test case
 syslog-v       syslog_udp.pcap         syslog-v.out            -t -v
diff --git a/tests/nflog-e.sh b/tests/nflog-e.sh
new file mode 100755 (executable)
index 0000000..00ac4fd
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# NFLOG support depends on both DLT_NFLOG and working <pcap/nflog.h>
+
+if grep '^#define HAVE_PCAP_NFLOG_H 1$' ../config.h >/dev/null
+then
+  ./TESTonce nflog-e nflog.pcap nflog-e.out '-t -e'
+else
+       printf '    %-30s: TEST SKIPPED (compiled w/o NFLOG)\n' 'nflog-e'
+fi