[CRIU] [PATCH] zdtm: don't use same cgoup names for a few tests (v2)

Andrew Vagin avagin at openvz.org
Fri Aug 15 05:37:48 PDT 2014


We run tests concurrently and they can race for equal resources

v2: fix hooks too
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/cgroup.hook   | 20 --------------------
 test/zdtm/live/static/cgroup00.c    |  2 +-
 test/zdtm/live/static/cgroup00.hook | 19 ++++++++++++++++++-
 test/zdtm/live/static/cgroup01.c    |  2 +-
 test/zdtm/live/static/cgroup01.hook | 20 +++++++++++++++++++-
 5 files changed, 39 insertions(+), 24 deletions(-)
 delete mode 100755 test/zdtm/live/static/cgroup.hook
 mode change 120000 => 100755 test/zdtm/live/static/cgroup00.hook
 mode change 120000 => 100755 test/zdtm/live/static/cgroup01.hook

diff --git a/test/zdtm/live/static/cgroup.hook b/test/zdtm/live/static/cgroup.hook
deleted file mode 100755
index f1a3158..0000000
--- a/test/zdtm/live/static/cgroup.hook
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-set -e
-
-tname=$(mktemp -d cgclean.XXXXXX)
-mount -t cgroup none $tname -o "none,name=zdtmtst"
-
-echo "Cleaning $tname"
-
-set +e
-rmdir "$tname/subcg/subsubcg/"
-rmdir "$tname/subcg/empty.0/"
-rmdir "$tname/subcg/empty.1/"
-rmdir "$tname/subcg/"
-set -e
-
-echo "Left there is:"
-ls "$tname"
-umount "$tname"
-rmdir "$tname"
diff --git a/test/zdtm/live/static/cgroup00.c b/test/zdtm/live/static/cgroup00.c
index 9b8c3df..b590156 100644
--- a/test/zdtm/live/static/cgroup00.c
+++ b/test/zdtm/live/static/cgroup00.c
@@ -13,7 +13,7 @@ const char *test_author	= "Pavel Emelianov <xemul at parallels.com>";
 char *dirname;
 TEST_OPTION(dirname, string, "cgroup directory name", 1);
 static const char *cgname = "zdtmtst";
-#define SUBNAME	"subcg"
+#define SUBNAME	"subcg00"
 #define SUBNAME2 SUBNAME"/subsubcg"
 
 static int cg_move(char *name)
diff --git a/test/zdtm/live/static/cgroup00.hook b/test/zdtm/live/static/cgroup00.hook
deleted file mode 120000
index 99dc411..0000000
--- a/test/zdtm/live/static/cgroup00.hook
+++ /dev/null
@@ -1 +0,0 @@
-cgroup.hook
\ No newline at end of file
diff --git a/test/zdtm/live/static/cgroup00.hook b/test/zdtm/live/static/cgroup00.hook
new file mode 100755
index 0000000..44ad2dd
--- /dev/null
+++ b/test/zdtm/live/static/cgroup00.hook
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+tname=$(mktemp -d cgclean.XXXXXX)
+mount -t cgroup none $tname -o "none,name=zdtmtst"
+
+echo "Cleaning $tname"
+
+set +e
+rmdir "$tname/subcg00/subsubcg/"
+rmdir "$tname/subcg00/"
+set -e
+
+echo "Left there is:"
+ls "$tname"
+umount "$tname"
+rmdir "$tname"
diff --git a/test/zdtm/live/static/cgroup01.c b/test/zdtm/live/static/cgroup01.c
index 10de6fc..9868cca 100644
--- a/test/zdtm/live/static/cgroup01.c
+++ b/test/zdtm/live/static/cgroup01.c
@@ -12,7 +12,7 @@ const char *test_author	= "Tycho Andersen <tycho.andersen at canonical.com>";
 char *dirname;
 TEST_OPTION(dirname, string, "cgroup directory name", 1);
 static const char *cgname = "zdtmtst";
-static const char *subname = "subcg";
+static const char *subname = "subcg01";
 static const char *empty = "empty";
 
 int main(int argc, char **argv)
diff --git a/test/zdtm/live/static/cgroup01.hook b/test/zdtm/live/static/cgroup01.hook
deleted file mode 120000
index 99dc411..0000000
--- a/test/zdtm/live/static/cgroup01.hook
+++ /dev/null
@@ -1 +0,0 @@
-cgroup.hook
\ No newline at end of file
diff --git a/test/zdtm/live/static/cgroup01.hook b/test/zdtm/live/static/cgroup01.hook
new file mode 100755
index 0000000..9697e1b
--- /dev/null
+++ b/test/zdtm/live/static/cgroup01.hook
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+tname=$(mktemp -d cgclean.XXXXXX)
+mount -t cgroup none $tname -o "none,name=zdtmtst"
+
+echo "Cleaning $tname"
+
+set +e
+rmdir "$tname/subcg01/empty.0/"
+rmdir "$tname/subcg01/empty.1/"
+rmdir "$tname/subcg01/"
+set -e
+
+echo "Left there is:"
+ls "$tname"
+umount "$tname"
+rmdir "$tname"
-- 
1.9.3



More information about the CRIU mailing list