[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Fri Feb 12 19:57:56 UTC 2016


The branch master has been updated
       via  d1dc699ac6e5ada11b1f5baaaa1695e403dce638 (commit)
       via  d40b0622fa4d0e4e79af2abda9f51b31c3a2cba6 (commit)
       via  b44b935e3966ac03c581e267e9a99547f91dcb78 (commit)
       via  b843cdb1054413b97739433fde7fa18496ab222f (commit)
      from  6faffd0ad23801dc540d3865bfd5bbb92e40c791 (commit)


- Log -----------------------------------------------------------------
commit d1dc699ac6e5ada11b1f5baaaa1695e403dce638
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Feb 12 18:42:46 2016 +0100

    Now that we have good verbosity, turn it on for Travis
    
    It's nearly impossible to determine what goes wrong in the tests
    running there without this.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit d40b0622fa4d0e4e79af2abda9f51b31c3a2cba6
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Feb 12 18:33:34 2016 +0100

    Document the changes in "make test" behavior
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit b44b935e3966ac03c581e267e9a99547f91dcb78
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Feb 12 18:26:16 2016 +0100

    Let all TLSProxy based tests display debug text conditionally
    
    If the environment variable HARNESS_ACTIVE isn't defined or
    HARNESS_VERBOSE is defined, it's probable that lots of output is
    desired.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit b843cdb1054413b97739433fde7fa18496ab222f
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Feb 12 18:16:23 2016 +0100

    Rethink logging of test recipes
    
    The logging that was performed in OpenSSL::Test was initially set up
    as a means not to let messages that test programs write to STDERR get
    displayed when a test isn't running in verbose mode.  However, the way
    it was implemented, it meant that those messages were never displayed,
    and you had to look in a test log.  This also meant that output to
    STDERR and output to STDOUT got broken apart, which isn't optimal.
    
    So, we remove the whole test log file implementation, and instead,
    we're sending STDERR to the null device unless one of these conditions
    apply:
    
    - the test recipe already redirects stderr.  Just let it.
    - the environment variable HARNESS_ACTIVE is undefined, meaning the
      recipe is run directly as a perl script instead of being harnessed
      by Test::Harness
    - the environment variable HARNESS_VERBOSE is set.
    
    Getting a full log of the tests now becomes as simple as this:
    
        HARNESS_VERBOSE=yes make test 2>&1 | tee tests.log
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 .travis.yml                           |  2 +-
 INSTALL                               |  6 +++---
 test/recipes/70-test_sslcertstatus.t  |  3 ++-
 test/recipes/70-test_sslextension.t   |  3 ++-
 test/recipes/70-test_sslsessiontick.t |  3 ++-
 test/recipes/70-test_sslskewith0p.t   |  3 ++-
 test/recipes/70-test_sslvertol.t      |  3 ++-
 test/recipes/70-test_tlsextms.t       |  2 +-
 test/recipes/90-test_networking.t     |  3 ++-
 test/testlib/OpenSSL/Test.pm          | 39 +++++++----------------------------
 10 files changed, 25 insertions(+), 42 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index cb23320..8e365b3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -104,7 +104,7 @@ script:
     - if [ -n "$CROSS_COMPILE" ]; then
           export EXE_SHELL="wine" WINEPREFIX=`pwd`;
       fi
-    - make test
+    - HARNESS_VERBOSE=yes make test
     - cd ..
 
 notifications:
diff --git a/INSTALL b/INSTALL
index 520de7b..5ed0d58 100644
--- a/INSTALL
+++ b/INSTALL
@@ -194,9 +194,6 @@
 
        $ HARNESS_VERBOSE=yes make test
 
-     Also, you will find logs for all commands the tests have executed
-     in logs, test/test_*.log, one for each individual test.
-
      If you want to run just one or a few specific tests, you can use
      the make variable TESTS to specify them, like this:
 
@@ -210,6 +207,9 @@
 
        $ make list-tests
 
+     Have a look at the manual for the perl module Test::Harness to
+     see what other HARNESS_* variables there are.
+
      If you find a problem with OpenSSL itself, try removing any
      compiler optimization flags from the CFLAG line in Makefile and
      run "make clean; make".
diff --git a/test/recipes/70-test_sslcertstatus.t b/test/recipes/70-test_sslcertstatus.t
index a7f2d8a..9a0c5f8 100755
--- a/test/recipes/70-test_sslcertstatus.t
+++ b/test/recipes/70-test_sslcertstatus.t
@@ -74,7 +74,8 @@ $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&certstatus_filter,
     cmdstr(app(["openssl"])),
-    srctop_file("apps", "server.pem")
+    srctop_file("apps", "server.pem"),
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 1;
diff --git a/test/recipes/70-test_sslextension.t b/test/recipes/70-test_sslextension.t
index f7ac9f4..4582c5c 100755
--- a/test/recipes/70-test_sslextension.t
+++ b/test/recipes/70-test_sslextension.t
@@ -74,7 +74,8 @@ $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&extension_filter,
     cmdstr(app(["openssl"])),
-    srctop_file("apps", "server.pem")
+    srctop_file("apps", "server.pem"),
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 1;
diff --git a/test/recipes/70-test_sslsessiontick.t b/test/recipes/70-test_sslsessiontick.t
index f2c00da..8a361fd 100755
--- a/test/recipes/70-test_sslsessiontick.t
+++ b/test/recipes/70-test_sslsessiontick.t
@@ -84,7 +84,8 @@ my $ticketseen = 0;
 my $proxy = TLSProxy::Proxy->new(
     undef,
     cmdstr(app(["openssl"])),
-    srctop_file("apps", "server.pem")
+    srctop_file("apps", "server.pem"),
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 8;
diff --git a/test/recipes/70-test_sslskewith0p.t b/test/recipes/70-test_sslskewith0p.t
index 0e6a780..fac1e8d 100755
--- a/test/recipes/70-test_sslskewith0p.t
+++ b/test/recipes/70-test_sslskewith0p.t
@@ -77,7 +77,8 @@ $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&ske_0_p_filter,
     cmdstr(app(["openssl"])),
-    srctop_file("apps", "server.pem")
+    srctop_file("apps", "server.pem"),
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 1;
diff --git a/test/recipes/70-test_sslvertol.t b/test/recipes/70-test_sslvertol.t
index b12abee..e014d3f 100755
--- a/test/recipes/70-test_sslvertol.t
+++ b/test/recipes/70-test_sslvertol.t
@@ -74,7 +74,8 @@ $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&vers_tolerance_filter,
     cmdstr(app(["openssl"])),
-    srctop_file("apps", "server.pem")
+    srctop_file("apps", "server.pem"),
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 2;
diff --git a/test/recipes/70-test_tlsextms.t b/test/recipes/70-test_tlsextms.t
index a4419f5..82cb856 100644
--- a/test/recipes/70-test_tlsextms.t
+++ b/test/recipes/70-test_tlsextms.t
@@ -87,7 +87,7 @@ my $proxy = TLSProxy::Proxy->new(
     \&extms_filter,
     cmdstr(app(["openssl"])),
     srctop_file("apps", "server.pem"),
-    1
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 9;
diff --git a/test/recipes/90-test_networking.t b/test/recipes/90-test_networking.t
index 1e2d5fc..cf3b43a 100644
--- a/test/recipes/90-test_networking.t
+++ b/test/recipes/90-test_networking.t
@@ -75,7 +75,8 @@ $ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     undef,
     cmdstr(app(["openssl"])),
-    srctop_file("apps", "server.pem")
+    srctop_file("apps", "server.pem"),
+    (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE})
 );
 
 plan tests => 2;
diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm
index 47c1bdc..5139a5e 100644
--- a/test/testlib/OpenSSL/Test.pm
+++ b/test/testlib/OpenSSL/Test.pm
@@ -93,7 +93,6 @@ sub __env;
 sub __cwd;
 sub __apps_file;
 sub __results_file;
-sub __test_log;
 sub __fixup_cmd;
 sub __build_cmd;
 
@@ -136,9 +135,6 @@ sub setup {
 	unless -f srctop_file("Configure");
 
     __cwd($directories{RESULTS});
-
-    # Loop in case we're on a platform with more than one file generation
-    1 while unlink(__test_log());
 }
 
 =over 4
@@ -309,7 +305,7 @@ the function C<with> further down.
 =cut
 
 sub run {
-    my ($cmd, $display_cmd, %errlogs) = shift->(0);
+    my ($cmd, $display_cmd) = shift->(0);
     my %opts = @_;
 
     return () if !$cmd;
@@ -336,15 +332,6 @@ sub run {
     # non-zero.
     $? = 0;
 
-    open ERR, ">>", __test_log();
-    { local $| = 1; print ERR "$display_cmd => $e\n"; }
-    foreach (keys %errlogs) {
-	copy($_,\*ERR);
-	copy($_,$errlogs{$_}) if defined($errlogs{$_});
-	unlink($_);
-    }
-    close ERR;
-
     if ($opts{capture}) {
 	return @r;
     } else {
@@ -541,7 +528,7 @@ command as a string.
 =cut
 
 sub cmdstr {
-    my ($cmd, $display_cmd, %errlogs) = shift->(0);
+    my ($cmd, $display_cmd) = shift->(0);
 
     return $display_cmd;
 }
@@ -616,11 +603,6 @@ is located.  Defaults to C<$TOP/apps> (adapted to the operating system).
 If defined, its value should be the directory where the test applications
 are located.  Defaults to C<$TOP/test> (adapted to the operating system).
 
-=item B<RESULT_D>
-
-If defined, its value should be the directory where the log files are
-located.  Defaults to C<$TEST_D>.
-
 =item B<STOPTEST>
 
 If defined, it puts testing in a different mode, where a recipe with
@@ -701,10 +683,6 @@ sub __results_file {
     return catfile($directories{RESULTS}, at _,$f);
 }
 
-sub __test_log {
-    return __results_file("$test_name.log");
-}
-
 sub __cwd {
     my $dir = catdir(shift);
     my %opts = @_;
@@ -757,7 +735,6 @@ sub __cwd {
 	print STDERR "  \$directories{APPS}    = \"$directories{APPS}\"\n";
 	print STDERR "  \$directories{SRCTOP}  = \"$directories{SRCTOP}\"\n";
 	print STDERR "  \$directories{BLDTOP}  = \"$directories{BLDTOP}\"\n";
-	print STDERR "  \$test_log             = \"",__test_log(),"\"\n";
 	print STDERR "\n";
 	print STDERR "  current directory is \"",curdir(),"\"\n";
 	print STDERR "  the way back is \"$reverse\"\n";
@@ -852,19 +829,19 @@ sub __build_cmd {
     $stdout= " > ".$fileornull->($opts{stdout}) if exists($opts{stdout});
     $stderr=" 2> ".$fileornull->($opts{stderr}) if exists($opts{stderr});
 
-    $saved_stderr = $opts{stderr}		if defined($opts{stderr});
-
-    my $errlog =
-        __results_file($num ? "$test_name.$num.tmp_err" : "$test_name.tmp_err");
     my $display_cmd = "$cmd$arg_str$stdin$stdout$stderr";
-    $cmd .= "$arg_str$stdin$stdout 2> $errlog";
+
+    $stderr=" 2> ".$null
+        unless $stderr || !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
+
+    $cmd .= "$arg_str$stdin$stdout$stderr";
 
     if ($debug) {
 	print STDERR "DEBUG[__build_cmd]: \$cmd = \"$cmd\"\n";
 	print STDERR "DEBUG[__build_cmd]: \$display_cmd = \"$display_cmd\"\n";
     }
 
-    return ($cmd, $display_cmd, $errlog => $saved_stderr);
+    return ($cmd, $display_cmd);
 }
 
 =head1 SEE ALSO


More information about the openssl-commits mailing list