2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

zdtm.py: Fix eval error if empty desc file provided

If desc is empty we should not try to eval it,
otherwise it would lead to exceptio. So test
for its size as well.

travis-ci: success for zdtm.py: Fix eval error if empty desc file provided
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov
2017-01-20 21:38:00 +03:00
committed by Pavel Emelyanov
parent d234b567ad
commit fe68441bf4

View File

@@ -1464,7 +1464,7 @@ default_test = {}
def get_test_desc(tname):
d_path = tname + '.desc'
if os.access(d_path, os.F_OK):
if os.access(d_path, os.F_OK) and os.path.getsize(d_path) > 0:
return eval(open(d_path).read())
return default_test