Testsuite: move sha3 tests to separate testcase
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 10 Feb 2018 17:01:10 +0000 (17:01 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 10 Feb 2018 17:01:10 +0000 (17:01 +0000)
test/confs/2990 [new symlink]
test/runtest
test/scripts/2000-GnuTLS/2000
test/scripts/2100-OpenSSL/2100
test/scripts/2990-sha3/2990 [new file with mode: 0644]
test/scripts/2990-sha3/REQUIRES [new file with mode: 0644]
test/stdout/2000 [deleted file]
test/stdout/2100 [deleted file]
test/stdout/2990 [new file with mode: 0644]

diff --git a/test/confs/2990 b/test/confs/2990
new file mode 120000 (symlink)
index 0000000..af2e09a
--- /dev/null
@@ -0,0 +1 @@
+0000
\ No newline at end of file
index c32222dc010f4f83452a0eea0d664e78aa46a7ee..862eb07ae202d71dd8632febf35e64a2de4c4886 100755 (executable)
@@ -3535,6 +3535,32 @@ DIR: for (my $i = 0; $i < @test_dirs; $i++)
         {
         if (!defined $parm_malware{$1}) { $wantthis = 0; last; }
         }
+      elsif (/^feature (.*)$/)
+        {
+       # move to a subroutine?
+       my $eximinfo = "$parm_exim -C $parm_cwd/test-config -DDIR=$parm_cwd -bP macro $1";
+
+       open (IN, "$parm_cwd/confs/0000") ||
+         tests_exit(-1, "Couldn't open $parm_cwd/confs/0000: $!\n");
+       open (OUT, ">test-config") ||
+         tests_exit(-1, "Couldn't open test-config: $!\n");
+       while (<IN>)
+         {
+         do_substitute($testno);
+         print OUT;
+         }
+       close(IN);
+       close(OUT);
+
+       system($eximinfo . " >/dev/null 2>&1");
+       if ($? != 0) {
+         unlink("$parm_cwd/test-config");
+         $wantthis = 0;
+         $_ = "feature $1";
+         last;
+       }
+       unlink("$parm_cwd/test-config");
+        }
       else
         {
         tests_exit(-1, "Unknown line in \"scripts/$testdir/REQUIRES\": \"$_\"");
index 8717892f24a53d705d414f788af336c553cf9dfa..a1299e57425e5564a743b13cab73b139a4d08f14 100644 (file)
@@ -13,16 +13,3 @@ exim -qf
 ****
 killdaemon
 no_msglog_check
-#
-#
-exim -be
-sha256:   ${sha256:}
-sha256:   ${sha256:abc}
-
-sha3:     ${sha3:}
-sha3:     ${sha3:abc}
-sha3_256: ${sha3_256:}
-sha3_256: ${sha3_256:abc}
-sha3_512: ${sha3_512:}
-sha3_512: ${sha3_512:abc}
-****
index 37ba66fb5d1d10898a8d9043cb4f5905066536e9..c2b0f8981dd5eb2bb8e7882a71b67a0719a4fdb6 100644 (file)
@@ -8,16 +8,3 @@ exim -qf
 ****
 killdaemon
 no_msglog_check
-#
-#
-exim -be
-sha256: ${sha256:}
-sha256: ${sha256:abc}
-
-sha3:     ${sha3:}
-sha3:     ${sha3:abc}
-sha3_256: ${sha3_256:}
-sha3_256: ${sha3_256:abc}
-sha3_512: ${sha3_512:}
-sha3_512: ${sha3_512:abc}
-****
diff --git a/test/scripts/2990-sha3/2990 b/test/scripts/2990-sha3/2990
new file mode 100644 (file)
index 0000000..e0d4aaf
--- /dev/null
@@ -0,0 +1,13 @@
+# sha3 expansions
+#
+exim -be
+sha256:   ${sha256:}
+sha256:   ${sha256:abc}
+
+sha3:     ${sha3:}
+sha3:     ${sha3:abc}
+sha3_256: ${sha3_256:}
+sha3_256: ${sha3_256:abc}
+sha3_512: ${sha3_512:}
+sha3_512: ${sha3_512:abc}
+****
diff --git a/test/scripts/2990-sha3/REQUIRES b/test/scripts/2990-sha3/REQUIRES
new file mode 100644 (file)
index 0000000..378d36d
--- /dev/null
@@ -0,0 +1 @@
+feature _CRYPTO_HASH_SHA3
diff --git a/test/stdout/2000 b/test/stdout/2000
deleted file mode 100644 (file)
index 939df1b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-> sha256:   E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
-> sha256:   BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD
-> 
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> 
diff --git a/test/stdout/2100 b/test/stdout/2100
deleted file mode 100644 (file)
index f349c70..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-> sha256: E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
-> sha256: BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD
-> 
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> Failed: sha3 only supported with GnuTLS 3.5.0 + or OpenSSL 1.1.1 +
-> 
diff --git a/test/stdout/2990 b/test/stdout/2990
new file mode 100644 (file)
index 0000000..203cef9
--- /dev/null
@@ -0,0 +1,10 @@
+> sha256:   E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
+> sha256:   BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD
+> 
+> sha3:     A7FFC6F8BF1ED76651C14756A061D662F580FF4DE43B49FA82D80A4B80F8434A
+> sha3:     3A985DA74FE225B2045C172D6BD390BD855F086E3E9D525B46BFE24511431532
+> sha3_256: A7FFC6F8BF1ED76651C14756A061D662F580FF4DE43B49FA82D80A4B80F8434A
+> sha3_256: 3A985DA74FE225B2045C172D6BD390BD855F086E3E9D525B46BFE24511431532
+> sha3_512: A69F73CCA23A9AC5C8B567DC185A756E97C982164FE25859E0D1DCC1475C80A615B2123AF1F5F94C11E3E9402C3AC558F500199D95B6D3E301758586281DCD26
+> sha3_512: B751850B1A57168A5693CD924B6B096E08F621827444F70D884F5D0240D2712E10E116E9192AF3C91A7EC57647E3934057340B4CF408D5A56592F8274EEC53F0
+>