]> The Tcpdump Group git mirrors - tcpdump/commitdiff
switch from crypto.sh to crypto.tests
authorMichael Richardson <[email protected]>
Mon, 3 Feb 2020 02:29:41 +0000 (03:29 +0100)
committerDenis Ovsienko <[email protected]>
Tue, 4 Feb 2020 22:19:17 +0000 (22:19 +0000)
tests/crypto.sh [deleted file]
tests/crypto.tests

diff --git a/tests/crypto.sh b/tests/crypto.sh
deleted file mode 100755 (executable)
index d6bcfc7..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/sh
-
-#
-# Get the tests directory from $0.
-#
-testsdir=`dirname "$0"`
-
-exitcode=0
-passed=`cat .passed`
-failed=`cat .failed`
-
-# Only attempt OpenSSL-specific tests when compiled with the library.
-
-if grep '^#define HAVE_LIBCRYPTO 1$' ../config.h >/dev/null
-then
-       if ${testsdir}/TESTonce esp1 ${testsdir}/02-sunrise-sunset-esp.pcap ${testsdir}/esp1.out '-E "[email protected] 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-       if ${testsdir}/TESTonce esp2 ${testsdir}/08-sunrise-sunset-esp2.pcap ${testsdir}/esp2.out '-E "[email protected] 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,[email protected] 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-       if ${testsdir}/TESTonce esp3 ${testsdir}/02-sunrise-sunset-esp.pcap ${testsdir}/esp1.out '-E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-       # Reading the secret(s) from a file does not work with Capsicum.
-       if grep '^#define HAVE_CAPSICUM 1$' ../config.h >/dev/null
-       then
-               FORMAT='    %-40s: TEST SKIPPED (compiled w/Capsicum)\n'
-               printf "$FORMAT" esp4
-               printf "$FORMAT" esp5
-               printf "$FORMAT" espudp1
-               printf "$FORMAT" ikev2pI2
-               printf "$FORMAT" isakmp4
-       else
-               if ${testsdir}/TESTonce esp4 ${testsdir}/08-sunrise-sunset-esp2.pcap ${testsdir}/esp2.out "-E \"file ${testsdir}/esp-secrets.txt\""
-               then
-                       passed=`expr $passed + 1`
-                       echo $passed >.passed
-               else
-                       failed=`expr $failed + 1`
-                       echo $failed >.failed
-                       exitcode=1
-               fi
-               if ${testsdir}/TESTonce esp5 ${testsdir}/08-sunrise-sunset-aes.pcap ${testsdir}/esp5.out "-E \"file ${testsdir}/esp-secrets.txt\""
-               then
-                       passed=`expr $passed + 1`
-                       echo $passed >.passed
-               else
-                       failed=`expr $failed + 1`
-                       echo $failed >.failed
-                       exitcode=1
-               fi
-               if ${testsdir}/TESTonce espudp1 ${testsdir}/espudp1.pcap ${testsdir}/espudp1.out "-nnnn -E \"file ${testsdir}/esp-secrets.txt\""
-               then
-                       passed=`expr $passed + 1`
-                       echo $passed >.passed
-               else
-                       failed=`expr $failed + 1`
-                       echo $failed >.failed
-                       exitcode=1
-               fi
-               if ${testsdir}/TESTonce ikev2pI2 ${testsdir}/ikev2pI2.pcap ${testsdir}/ikev2pI2.out "-E \"file ${testsdir}/ikev2pI2-secrets.txt\" -v -v -v -v"
-               then
-                       passed=`expr $passed + 1`
-                       echo $passed >.passed
-               else
-                       failed=`expr $failed + 1`
-                       echo $failed >.failed
-                       exitcode=1
-               fi
-               if ${testsdir}/TESTonce isakmp4 ${testsdir}/isakmp4500.pcap ${testsdir}/isakmp4.out "-E \"file ${testsdir}/esp-secrets.txt\""
-               then
-                       passed=`expr $passed + 1`
-                       echo $passed >.passed
-               else
-                       failed=`expr $failed + 1`
-                       echo $failed >.failed
-                       exitcode=1
-               fi
-       fi
-       if ${testsdir}/TESTonce bgp-as-path-oobr-ssl ${testsdir}/bgp-as-path-oobr.pcap ${testsdir}/bgp-as-path-oobr-ssl.out '-vvv -e'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-       if ${testsdir}/TESTonce bgp-aigp-oobr-ssl ${testsdir}/bgp-aigp-oobr.pcap ${testsdir}/bgp-aigp-oobr-ssl.out '-vvv -e'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-       FORMAT='    %-40s: TEST SKIPPED (compiled w/OpenSSL)\n'
-       printf "$FORMAT" bgp-as-path-oobr-nossl
-       printf "$FORMAT" bgp-aigp-oobr-nossl
-else
-       FORMAT='    %-40s: 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
-       printf "$FORMAT" isakmp4
-       printf "$FORMAT" bgp-as-path-oobr-ssl
-       printf "$FORMAT" bgp-aigp-oobr-ssl
-       if ${testsdir}/TESTonce bgp-as-path-oobr-nossl ${testsdir}/bgp-as-path-oobr.pcap ${testsdir}/bgp-as-path-oobr-nossl.out '-vvv -e'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-       if ${testsdir}/TESTonce bgp-aigp-oobr-nossl ${testsdir}/bgp-aigp-oobr.pcap ${testsdir}/bgp-aigp-oobr-nossl.out '-vvv -e'
-       then
-               passed=`expr $passed + 1`
-               echo $passed >.passed
-       else
-               failed=`expr $failed + 1`
-               echo $failed >.failed
-               exitcode=1
-       fi
-fi
-
-exit $exitcode
index 27c8ce5f038f056f36e73d4c9265b6f2466977df..f0ab6f3cba8032bcae82e2f877863ea646f958ca 100644 (file)
@@ -1,7 +1,7 @@
 # -*- perl -*-
 
 $testlist = [
-    { 
+    {
         config_set => 'HAVE_LIBCRYPTO',
         name => 'esp1',
         input => '02-sunrise-sunset-esp.pcap',
@@ -24,15 +24,88 @@ $testlist = [
         output => 'esp1.out',
         args   => '-E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"',
     },
-    
+
     {
-        config_set   => 'HAVE_LIBCRYPTO', 
-        config_unset => 'HAVE_CAPSICUM', 
+        config_set   => 'HAVE_LIBCRYPTO',
+        config_unset => 'HAVE_CAPSICUM',
         name => 'esp4',
         input => '08-sunrise-sunset-esp2.pcap',
         output => 'esp2.out',
         args   => '-E "file @TESTDIR@/esp-secrets.txt"',
-    }
+    },
+
+    {
+        config_set   => 'HAVE_LIBCRYPTO',
+        config_unset => 'HAVE_CAPSICUM',
+        name => 'esp5',
+        input => '08-sunrise-sunset-aes.pcap',
+        output => 'esp5.out',
+        args   => '-E "file @TESTDIR@/esp-secrets.txt"',
+    },
+
+    {
+        config_set   => 'HAVE_LIBCRYPTO',
+        config_unset => 'HAVE_CAPSICUM',
+        name => 'espudp1',
+        input => 'espudp1.pcap',
+        output => 'espudp1.out',
+        args   => '-nnnn -E "file @TESTDIR@/esp-secrets.txt"',
+    },
+
+    {
+        config_set   => 'HAVE_LIBCRYPTO',
+        config_unset => 'HAVE_CAPSICUM',
+        name => 'ikev2pI2',
+        input => 'ikev2pI2.pcap',
+        output => 'ikev2pI2.out',
+        args   => '-v -v -v -v -E "file @TESTDIR@/ikev2pI2-secrets.txt"',
+    },
+
+    {
+        config_set   => 'HAVE_LIBCRYPTO',
+        config_unset => 'HAVE_CAPSICUM',
+        name => 'isakmp4',
+        input => 'isakmp4500.pcap',
+        output => 'isakmp4.out',
+        args   => '-E "file @TESTDIR@/esp-secrets.txt"',
+    },
+
+    #bgp-as-path-oobr-ssl ${testsdir}/bgp-as-path-oobr.pcap ${testsdir}/bgp-as-path-oobr-ssl.out '-vvv -e'
+    {
+        config_set   => 'HAVE_LIBCRYPTO',
+        name => 'bgp-as-path-oobr-ssl',
+        input => 'bgp-as-path-oobr.pcap',
+        output => 'bgp-as-path-oobr-ssl.out',
+        args   => '-vvv -e'
+    },
+
+    # bgp-aigp-oobr-ssl ${testsdir}/bgp-aigp-oobr.pcap ${testsdir}/bgp-aigp-oobr-ssl.out '-vvv -e'
+    {
+        config_set   => 'HAVE_LIBCRYPTO',
+        name => 'bgp-aigp-oobr-ssl',
+        input => 'bgp-aigp-oobr.pcap',
+        output => 'bgp-aigp-oobr-ssl.out',
+        args   => '-vvv -e'
+    },
+
+    # bgp-as-path-oobr-nossl ${testsdir}/bgp-as-path-oobr.pcap ${testsdir}/bgp-as-path-oobr-nossl.out '-vvv -e'
+    {
+        config_unset   => 'HAVE_LIBCRYPTO',
+        name => 'bgp-as-path-oobr-nossl',
+        input => 'bgp-as-path-oobr.pcap',
+        output => 'bgp-as-path-oobr-nossl.out',
+        args   => '-vvv -e'
+    },
+
+    # bgp-aigp-oobr-nossl ${testsdir}/bgp-aigp-oobr.pcap ${testsdir}/bgp-aigp-oobr-nossl.out '-vvv -e'
+    {
+        config_unset   => 'HAVE_LIBCRYPTO',
+        name => 'bgp-aigp-oobr-nossl',
+        input => 'bgp-aigp-oobr.pcap',
+        output => 'bgp-aigp-oobr-nossl.out',
+        args   => '-vvv -e'
+    },
+
     ];
 
 1;