]> git.proxmox.com Git - mirror_zfs.git/commitdiff
OpenZFS 6642 - testrunner output can be displayed in the wrong order
authorJohn Wren Kennedy <john.kennedy@delphix.com>
Thu, 25 Feb 2016 05:13:41 +0000 (21:13 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 11 Feb 2017 20:57:13 +0000 (12:57 -0800)
6643 zfstest should enforce the required privileges before running.
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Jonathan Mackenzie <jonathan.mackenzie@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov
OpenZFS-issue: https://www.illumos.org/issues/6642
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/412db4e
Closes #5777

Porting notes:
- The 6643 changes were dropped a different version of this script
  is used to configure the environment under Linux.

tests/test-runner/cmd/test-runner.py

index d7727e8d8d8a2eff8a4d2b93add0f720a228d286..b0ef79aaf1b27d96d30af0a65e3ac6cdf60a5985 100755 (executable)
@@ -12,7 +12,7 @@
 #
 
 #
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
 #
 
 import ConfigParser
@@ -272,8 +272,10 @@ class Cmd(object):
         else:
             logger.debug('%s%s%s' % (msga, pad, msgb))
 
-        lines = self.result.stdout + self.result.stderr
-        for dt, line in sorted(lines):
+        lines = sorted(self.result.stdout + self.result.stderr,
+                       cmp=lambda x, y: cmp(x[0], y[0]))
+
+        for dt, line in lines:
             logger.debug('%s %s' % (dt.strftime("%H:%M:%S.%f ")[:11], line))
 
         if len(self.result.stdout):
@@ -286,7 +288,7 @@ class Cmd(object):
                     os.write(err.fileno(), '%s\n' % line)
         if len(self.result.stdout) and len(self.result.stderr):
             with open(os.path.join(self.outputdir, 'merged'), 'w') as merged:
-                for _, line in sorted(lines):
+                for _, line in lines:
                     os.write(merged.fileno(), '%s\n' % line)