[CRIU] [PATCH] add join-ns result check to zdtm
Dengguangxing
dengguangxing at huawei.com
Sat Apr 16 01:33:22 PDT 2016
Signed-off-by: Deng Guangxing <dengguangxing at huawei.com>
---
test/zdtm.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/test/zdtm.py b/test/zdtm.py
index 3203542..ce67c29 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -954,6 +954,14 @@ def get_freezer(desc):
fr = cg_freezer(path = fd[0], state = fd[1])
return fr
+def check_joinns_state(t):
+ nsstat = os.stat("/proc/%s/ns/net" % t.getpid())
+ joinns = os.stat(join_ns_file)
+ if nsstat.st_ino != joinns.st_ino:
+ print "should join in namespace %d" % joinns.st_ino
+ print "now in namespace %d" % nsstat.st_ino
+ raise test_fail_exc("join-ns compare")
+
def do_run_test(tname, tdesc, flavs, opts):
tcname = tname.split('/')[0]
@@ -988,6 +996,8 @@ def do_run_test(tname, tdesc, flavs, opts):
t.stop()
else:
check_visible_state(t, s, opts)
+ if opts['join_ns']:
+ check_joinns_state(t)
t.stop()
try_run_hook(t, ["--clean"])
except test_fail_exc as e:
--
2.5.0
More information about the CRIU
mailing list