zdtm: Check stats file presence before reading

Submitted by Pavel Emelianov on May 28, 2019, 8:47 a.m.

Details

Message ID d48a641b-85a8-65de-5993-af5a10f4d500@virtuozzo.com
State Accepted
Series "zdtm: Check stats file presence before reading"
Headers show

Commit Message

Pavel Emelianov May 28, 2019, 8:47 a.m.
In some cases the stats-dump file can be missing, so do not
crash the whole zdtm.py in this case.

https://ci.openvz.org/job/CRIU/job/criu-live-migration/job/criu-dev/2362/console

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 test/zdtm.py | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index 9f48369..0adc22c 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1109,6 +1109,9 @@  class criu:
 		subprocess.Popen([self.__crit_bin, "show", self.__stats_file(action)]).wait()
 
 	def check_pages_counts(self):
+		if not os.access(self.__stats_file("dump"), os.R_OK):
+			return
+
 		stats_written = -1
 		with open(self.__stats_file("dump"), 'rb') as stfile:
 			stats = crpc.images.load(stfile)