[CRIU] [PATCH] test: skip pre-dump images in socket-tcp*.hook

Andrei Vagin avagin at openvz.org
Mon Dec 5 14:56:50 PST 2016


From: Andrei Vagin <avagin at virtuozzo.com>

These hooks opens inetsk.img, but it doesn't exist if
processes were pre-dumped.

Reported-by: Pavel Emelyanov <xemul at openvz.org>
Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 test/zdtm/static/socket-tcp-fin-wait1.hook | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/static/socket-tcp-fin-wait1.hook b/test/zdtm/static/socket-tcp-fin-wait1.hook
index 76200eb..ae0b51d 100755
--- a/test/zdtm/static/socket-tcp-fin-wait1.hook
+++ b/test/zdtm/static/socket-tcp-fin-wait1.hook
@@ -22,7 +22,11 @@ if sys.argv[1] != "--post-restore":
 print "Check TCP images"
 
 def get_sockets(image_dir):
-    f = open(os.path.join(image_dir, "inetsk.img"))
+    fname = os.path.join(image_dir, "inetsk.img")
+    if not os.access(fname, os.F_OK):
+        return None
+
+    f = open(fname)
     sockets = pycriu.images.load(f)
     sockets = sockets["entries"]
 
-- 
2.7.4



More information about the CRIU mailing list