]> The Tcpdump Group git mirrors - tcpdump/commitdiff
make OpenSSL-specific tests conditional
authorDenis Ovsienko <[email protected]>
Sun, 16 Feb 2014 20:22:37 +0000 (00:22 +0400)
committerDenis Ovsienko <[email protected]>
Sun, 16 Feb 2014 20:24:08 +0000 (00:24 +0400)
tests/TESTLIST
tests/crypto.sh [new file with mode: 0755]

index 6e54b8d8c800d1004bec3044c2af221f1cf54fee..0b402c289dd1408000ae03cf936dd714a70f00f8 100644 (file)
@@ -25,12 +25,7 @@ eapon1 eapon1.pcap eapon1.out -t
 
 # ESP tests
 esp0 02-sunrise-sunset-esp.pcap esp0.out -t -n
-esp1 02-sunrise-sunset-esp.pcap esp1.out -t -E "[email protected] 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"
-esp2 08-sunrise-sunset-esp2.pcap esp2.out -t -E "[email protected] 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,[email protected] 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"
-esp3 02-sunrise-sunset-esp.pcap esp1.out -t -E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"
-esp4 08-sunrise-sunset-esp2.pcap esp2.out -t -E "file esp-secrets.txt"
-esp5 08-sunrise-sunset-aes.pcap esp5.out -t -E "file esp-secrets.txt"
-espudp1 espudp1.pcap                    espudp1.out -nnnn -t -E "file esp-secrets.txt"
+# more ESP tests in crypto.sh
 
 # ISAKMP tests
 isakmp1 isakmp-delete-segfault.pcap isakmp1.out -t
@@ -52,7 +47,7 @@ ospf-gmpls    ospf-gmpls.pcap         ospf-gmpls.out  -t -v
 ikev2four      ikev2four.pcap          ikev2four.out   -t -v
 ikev2fourv     ikev2four.pcap          ikev2fourv.out  -t -v -v -v
 ikev2fourv4    ikev2four.pcap          ikev2fourv4.out -t -v -v -v -v
-ikev2pI2       ikev2pI2.pcap           ikev2pI2.out    -t -E "file ikev2pI2-secrets.txt" -v -v -v -v
+# ikev2pI2 test in crypto.sh
 
 # IETF ROLL RPL packets
 dio01           rpl-dio.pcap                rpl-dio.out         -t -v
diff --git a/tests/crypto.sh b/tests/crypto.sh
new file mode 100755 (executable)
index 0000000..93d1adc
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Only attempt OpenSSL-specific tests when compiled with the library.
+
+if grep '^#define HAVE_LIBCRYPTO 1$' ../config.h >/dev/null
+then
+       ./TESTonce esp1 02-sunrise-sunset-esp.pcap esp1.out '-t -E "[email protected] 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
+       ./TESTonce esp2 08-sunrise-sunset-esp2.pcap esp2.out '-t -E "[email protected] 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,[email protected] 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"'
+       ./TESTonce esp3 02-sunrise-sunset-esp.pcap esp1.out '-t -E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
+       ./TESTonce esp4 08-sunrise-sunset-esp2.pcap esp2.out '-t -E "file esp-secrets.txt"'
+       ./TESTonce esp5 08-sunrise-sunset-aes.pcap esp5.out '-t -E "file esp-secrets.txt"'
+       ./TESTonce espudp1 espudp1.pcap espudp1.out '-nnnn -t -E "file esp-secrets.txt"'
+       ./TESTonce ikev2pI2 ikev2pI2.pcap ikev2pI2.out '-t -E "file ikev2pI2-secrets.txt" -v -v -v -v'
+else
+       FORMAT='    %-30s: TEST SKIPPED (compiled w/o OpenSSL)\n'
+       printf "$FORMAT" esp1
+       printf "$FORMAT" esp2
+       printf "$FORMAT" esp3
+       printf "$FORMAT" esp4
+       printf "$FORMAT" esp5
+       printf "$FORMAT" espudp1
+       printf "$FORMAT" ikev2pI2
+fi