[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Sat Apr 2 21:13:45 UTC 2016


The branch master has been updated
       via  25c78440d21c814705e0e50c6e567300936aa02b (commit)
       via  cb2ceb18f242bbc573c0e332f34b9ca42fc5f561 (commit)
      from  d3e6d6bcdfb725a57f94330367e7b752036c7a2c (commit)


- Log -----------------------------------------------------------------
commit 25c78440d21c814705e0e50c6e567300936aa02b
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Apr 1 15:09:28 2016 +0200

    Adapt some test recipes to the newer cmdstr()
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit cb2ceb18f242bbc573c0e332f34b9ca42fc5f561
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Apr 1 15:05:52 2016 +0200

    Enhance OpenSSL::Test::cmdstr to give cmd string variants
    
    Within OpenSSL::Test, all commands end up existing in two variants,
    one that has redirections that are needed internally to work well
    together with the test harness, and one without those redirections.
    
    Depending on what the result is going to be used for, the caller may
    want one for or the other, so we give them the possibility.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 test/recipes/70-test_sslcertstatus.t  |  2 +-
 test/recipes/70-test_sslextension.t   |  2 +-
 test/recipes/70-test_sslsessiontick.t |  2 +-
 test/recipes/70-test_sslskewith0p.t   |  2 +-
 test/recipes/70-test_sslvertol.t      |  2 +-
 test/recipes/70-test_tlsextms.t       |  2 +-
 test/recipes/80-test_ca.t             |  2 +-
 test/recipes/80-test_tsa.t            |  2 +-
 test/recipes/90-test_networking.t     |  2 +-
 test/testlib/OpenSSL/Test.pm          | 27 +++++++++++++++++++++++++--
 10 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/test/recipes/70-test_sslcertstatus.t b/test/recipes/70-test_sslcertstatus.t
index 48014e2..d2bc280 100755
--- a/test/recipes/70-test_sslcertstatus.t
+++ b/test/recipes/70-test_sslcertstatus.t
@@ -72,7 +72,7 @@ plan skip_all => "$test_name needs the sock feature enabled"
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&certstatus_filter,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/recipes/70-test_sslextension.t b/test/recipes/70-test_sslextension.t
index 92c6762..7d45ce2 100755
--- a/test/recipes/70-test_sslextension.t
+++ b/test/recipes/70-test_sslextension.t
@@ -72,7 +72,7 @@ plan skip_all => "$test_name needs the sock feature enabled"
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&extension_filter,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/recipes/70-test_sslsessiontick.t b/test/recipes/70-test_sslsessiontick.t
index 7045738..cbd4c65 100755
--- a/test/recipes/70-test_sslsessiontick.t
+++ b/test/recipes/70-test_sslsessiontick.t
@@ -83,7 +83,7 @@ my $ticketseen = 0;
 
 my $proxy = TLSProxy::Proxy->new(
     undef,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/recipes/70-test_sslskewith0p.t b/test/recipes/70-test_sslskewith0p.t
index 0bed4bf..ac88ed5 100755
--- a/test/recipes/70-test_sslskewith0p.t
+++ b/test/recipes/70-test_sslskewith0p.t
@@ -75,7 +75,7 @@ plan skip_all => "$test_name needs the sock feature enabled"
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&ske_0_p_filter,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/recipes/70-test_sslvertol.t b/test/recipes/70-test_sslvertol.t
index a3285a6..c1ec38f 100755
--- a/test/recipes/70-test_sslvertol.t
+++ b/test/recipes/70-test_sslvertol.t
@@ -72,7 +72,7 @@ plan skip_all => "$test_name needs the sock feature enabled"
 $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&vers_tolerance_filter,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/recipes/70-test_tlsextms.t b/test/recipes/70-test_tlsextms.t
index 5c41a90..24abfcf 100644
--- a/test/recipes/70-test_tlsextms.t
+++ b/test/recipes/70-test_tlsextms.t
@@ -84,7 +84,7 @@ my $fullhand = 0;
 
 my $proxy = TLSProxy::Proxy->new(
     \&extms_filter,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/recipes/80-test_ca.t b/test/recipes/80-test_ca.t
index 983f8ce..09d5ba6 100644
--- a/test/recipes/80-test_ca.t
+++ b/test/recipes/80-test_ca.t
@@ -9,7 +9,7 @@ use OpenSSL::Test qw/:DEFAULT cmdstr srctop_file/;
 
 setup("test_ca");
 
-$ENV{OPENSSL} = cmdstr(app(["openssl"]));
+$ENV{OPENSSL} = cmdstr(app(["openssl"]), display => 1);
 my $std_openssl_cnf =
     srctop_file("apps", $^O eq "VMS" ? "openssl-vms.cnf" : "openssl.cnf");
 
diff --git a/test/recipes/80-test_tsa.t b/test/recipes/80-test_tsa.t
index 6785698..f2ceeeb 100644
--- a/test/recipes/80-test_tsa.t
+++ b/test/recipes/80-test_tsa.t
@@ -79,7 +79,7 @@ indir "tsa" => sub
     $ENV{OPENSSL_CONF} = srctop_file("test", "CAtsa.cnf");
     # Because that's what ../apps/CA.pl really looks at
     $ENV{OPENSSL_CONFIG} = "-config ".$ENV{OPENSSL_CONF};
-    $ENV{OPENSSL} = cmdstr(app(["openssl"]));
+    $ENV{OPENSSL} = cmdstr(app(["openssl"]), display => 1);
     $testtsa = srctop_file("test", "recipes", "80-test_tsa.t");
     $CAtsa = srctop_file("test", "CAtsa.cnf");
 
diff --git a/test/recipes/90-test_networking.t b/test/recipes/90-test_networking.t
index 408d89a..85de81a 100644
--- a/test/recipes/90-test_networking.t
+++ b/test/recipes/90-test_networking.t
@@ -73,7 +73,7 @@ $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 
 my $proxy = TLSProxy::Proxy->new(
     undef,
-    cmdstr(app(["openssl"])),
+    cmdstr(app(["openssl"]), display => 1),
     srctop_file("apps", "server.pem"),
     (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm
index b0a609f..ca2e369 100644
--- a/test/testlib/OpenSSL/Test.pm
+++ b/test/testlib/OpenSSL/Test.pm
@@ -548,19 +548,42 @@ sub with {
 
 =over 4
 
-=item B<cmdstr CODEREF>
+=item B<cmdstr CODEREF, OPTS>
 
 C<cmdstr> takes a CODEREF from C<app> or C<test> and simply returns the
 command as a string.
 
+C<cmdstr> takes some additiona options OPTS that affect the string returned:
+
+=over 4
+
+=item B<display =E<gt> 0|1>
+
+When set to 0, the returned string will be with all decorations, such as a
+possible redirect of stderr to the null device.  This is suitable if the
+string is to be used directly in a recipe.
+
+When set to 1, the returned string will be without extra decorations.  This
+is suitable for display if that is desired (doesn't confuse people with all
+internal stuff), or if it's used to pass a command down to a subprocess.
+
+Default: 0
+
+=back
+
 =back
 
 =cut
 
 sub cmdstr {
     my ($cmd, $display_cmd) = shift->(0);
+    my %opts = @_;
 
-    return $cmd;
+    if ($opts{display}) {
+        return $display_cmd;
+    } else {
+        return $cmd;
+    }
 }
 
 =over 4


More information about the openssl-commits mailing list