[CRIU] [PATCH] zdtm: Remove cgroup hierarhy after test cgroup01 is finished

Kirill Tkhai ktkhai at odin.com
Mon Nov 23 07:56:48 PST 2015


Hierarhy remains even after cgroup is umounted, so it's need
to kill it manually.

Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
---
 test/zdtm/live/static/cgroup01.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/live/static/cgroup01.c b/test/zdtm/live/static/cgroup01.c
index 7f964cf..d3c0d87 100644
--- a/test/zdtm/live/static/cgroup01.c
+++ b/test/zdtm/live/static/cgroup01.c
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
 	cgf = fopen("/proc/self/mountinfo", "r");
 	if (cgf == NULL) {
 		fail("No mountinfo file");
-		goto out_rs;
+		goto out_hier;
 	}
 
 	while (fgets(paux, sizeof(paux), cgf)) {
@@ -106,6 +106,13 @@ int main(int argc, char **argv)
 
 out_close:
 	fclose(cgf);
+out_hier:
+	for (i = 0; i < 2; i++) {
+		sprintf(paux, "%s/%s/%s.%d", dirname, subname, empty, i);
+		rmdir(paux);
+        }
+	sprintf(paux, "%s/%s", dirname, subname);
+	rmdir(paux);
 out_rs:
 	umount(dirname);
 out_rd:



More information about the CRIU mailing list