apps/pkcs12: Retain test output files
authorDavid von Oheimb <David.von.Oheimb@siemens.com>
Thu, 14 Dec 2017 13:02:27 +0000 (14:02 +0100)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 19 Nov 2020 10:36:02 +0000 (11:36 +0100)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/4930)

test/recipes/80-test_pkcs12.t

index 07cd91f1965c271bb0ade56ecef331650514b2e0..0f977d7755fb6737b3c377c06eb30ef9f769baad 100644 (file)
@@ -66,17 +66,19 @@ ok(run(test(["pkcs12_format_test"])), "test pkcs12 formats");
 ok(run(app(["openssl", "pkcs12", "-noout",
             "-password", "pass:$pass",
             "-in", srctop_file("test", "shibboleth.pfx")])),
-   "test_pkcs12");
+   "test_load_cert_pkcs12");
 
 my @path = qw(test certs);
-my $tmpfile = "tmp.p12";
+my $outfile1 = "out1.p12";
+my $outfile2 = "out2.p12";
+my $outfile3 = "out3.p12";
 
 # Test the -chain option with -untrusted
 ok(run(app(["openssl", "pkcs12", "-export", "-chain",
             "-CAfile",  srctop_file(@path,  "sroot-cert.pem"),
             "-untrusted", srctop_file(@path, "ca-cert.pem"),
             "-in", srctop_file(@path, "ee-cert.pem"),
-            "-nokeys", "-passout", "pass:", "-out", $tmpfile])),
+            "-nokeys", "-passout", "pass:", "-out", $outfile1])),
    "test_pkcs12_chain_untrusted");
 
 # Test the -passcerts option
@@ -85,9 +87,8 @@ ok(run(app(["openssl", "pkcs12", "-export",
             "-certfile", srctop_file(@path, "v3-certs-TDES.p12"),
             "-passcerts", "pass:v3-certs",
             "-nokeys", "-passout", "pass:v3-certs", "-descert",
-            "-out", $tmpfile])),
-   "test_pkcs12_passcert");
-unlink $tmpfile;
+            "-out", $outfile2])),
+   "test_pkcs12_passcerts");
 
 # Test reading legacy PKCS#12 file
 ok(run(app(["openssl", "pkcs12", "-export",
@@ -95,8 +96,7 @@ ok(run(app(["openssl", "pkcs12", "-export",
             "-passin", "pass:v3-certs",
             "-provider", "default", "-provider", "legacy",
             "-nokeys", "-passout", "pass:v3-certs", "-descert",
-            "-out", $tmpfile])),
-   "test_pkcs12_passcert");
-unlink $tmpfile;
+            "-out", $outfile3])),
+   "test_pkcs12_passcerts_legacy");
 
 SetConsoleOutputCP($savedcp) if (defined($savedcp));