From edc19f139c6588cbd5c3eb33a3547d16bfe4fa3e Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 8 Oct 2015 23:07:56 +0300 Subject: [PATCH] zdtm.py: Print out file if it exists Sometimes tests fail before generating .out file, so print its contents only if it exists. Signed-off-by: Pavel Emelyanov --- test/zdtm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/zdtm.py b/test/zdtm.py index 8a3aa9ca2..ed87efb12 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -265,9 +265,10 @@ class zdtm_test: os.unlink(self.__pidfile()) def print_output(self): - print "Test output: " + "=" * 32 - print open(self.__name + '.out').read() - print " <<< " + "=" * 32 + if os.access(self.__name + '.out', os.R_OK): + print "Test output: " + "=" * 32 + print open(self.__name + '.out').read() + print " <<< " + "=" * 32 test_classes = { 'zdtm': zdtm_test }