Fix a few tests that fail on VMS
authorRichard Levitte <levitte@openssl.org>
Mon, 6 Sep 2021 19:49:34 +0000 (21:49 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 7 Sep 2021 08:51:54 +0000 (10:51 +0200)
In one spot, files aren't properly closed, so the sub-process program
that's supposed to read them can't, because it's locked out.

In another spot, srctop_file() was used where srctop_dir() should be
used to properly format a directory specification.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16518)

(cherry picked from commit 7364545e0734ad25e08d7d5ad0e2c9dac85d2d0d)

test/recipes/25-test_verify.t
test/recipes/30-test_defltfips.t

index f7a9f626ca985a500aa34dd391ecdfe22684c650..bcd823bcfb0aede506dfb755dc39279f9d5f048e 100644 (file)
@@ -461,7 +461,8 @@ SKIP: {
     skip "Couldn't create certplusrsa.pem", 1
         unless ( open $certplusrsa, '>', $certplusrsa_file
                  and copy($cert_file, $certplusrsa)
-                 and copy($rsa_file, $certplusrsa) );
+                 and copy($rsa_file, $certplusrsa)
+                 and close $certplusrsa );
 
     ok(run(app([ qw(openssl verify -trusted), $certplusrsa_file, $cert_file ])),
        'Mixed cert + key file test');
@@ -474,7 +475,8 @@ SKIP: {
     skip "Couldn't create rsapluscert.pem", 1
         unless ( open $rsapluscert, '>', $rsapluscert_file
                  and copy($rsa_file, $rsapluscert)
-                 and copy($cert_file, $rsapluscert) );
+                 and copy($cert_file, $rsapluscert)
+                 and close $rsapluscert );
 
     ok(run(app([ qw(openssl verify -trusted), $rsapluscert_file, $cert_file ])),
        'Mixed key + cert file test');
index f0338bb3e0b5094e49c4bbac18d4cc7cad8eb454..426bd660d1fd612159232c107ffb57a58eb6ab6f 100644 (file)
@@ -36,7 +36,7 @@ unless ($no_fips) {
 
     #Configured to run FIPS but the module-mac is bad
     $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "fips.cnf"));
-    $ENV{OPENSSL_CONF_INCLUDE} = srctop_file("test", "recipes", "30-test_defltfips");
+    $ENV{OPENSSL_CONF_INCLUDE} = srctop_dir("test", "recipes", "30-test_defltfips");
     ok(run(test(["defltfips_test", "badfips"])), "running defltfips_test badfips");
 
     #Test an alternative way of configuring fips (but still with bad module-mac)