Skip to content

Commit

Permalink
zdtm.py: print full pie errors in grep Error omitting line breaks
Browse files Browse the repository at this point in the history
Before:
=[log]=> dump/zdtm/transition/shmem/142/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
------------------------ ERROR OVER ------------------------

After:
=[log]=> dump/zdtm/transition/shmem/62/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
------------------------ ERROR OVER ------------------------

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
  • Loading branch information
0x7f454c46 authored and xemul committed Dec 9, 2016
1 parent 890457e commit 6077c3d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/zdtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,15 +1482,27 @@ def print_sep(title, sep = "=", width = 80):
print (" " + title + " ").center(width, sep)


def print_error(line):
line = line.rstrip()
print line
if line.endswith('>'): # combine pie output
return True
return False


def grep_errors(fname):
first = True
print_next = False
for l in open(fname):
if "Error" in l:
if first:
print_fname(fname, 'log')
print_sep("grep Error", "-", 60)
first = False
print l,
print_next = print_error(l)
else:
if print_next:
print_next = print_error(l)
if not first:
print_sep("ERROR OVER", "-", 60)

Expand Down

0 comments on commit 6077c3d

Please sign in to comment.