[CRIU] [PATCH] zdtm/netns: user correct file names for test files

Andrey Vagin avagin at openvz.org
Wed Oct 28 08:42:22 PDT 2015


From: Andrei Vagin <avagin at openvz.org>

We clean up test files from Makefile.
The name format for them is testname.XXX.test.

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/Makefile | 4 ++--
 test/zdtm/live/static/netns.c  | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
index a34c573..b54b300 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -351,10 +351,10 @@ cleandep:	clean
 	$(RM) -f $(DEP)
 
 cleanout:
-	$(RM) -f -r *.pid *.out* *.test* *.state ip.dump ip.rst
+	$(RM) -f -r *.pid *.out* *.test* *.state
 
 %.cleanout: %
-	$(Q) $(RM) -f -r $<.pid $<.out* *$<.test* $<.*.test $<.state
+	$(Q) $(RM) -f -r $<.pid $<.out* *$<.test* $<.*.test $<.state $<.init.pid
 
 realclean:	cleandep cleanout
 
diff --git a/test/zdtm/live/static/netns.c b/test/zdtm/live/static/netns.c
index 5b84e5f..0b85e85 100644
--- a/test/zdtm/live/static/netns.c
+++ b/test/zdtm/live/static/netns.c
@@ -29,7 +29,8 @@ static int test_fn(int argc, char **argv)
 		return -1;
 	}
 
-	if (system("ip link > ip.dump && ip addr >> ip.dump && ip route >> ip.dump")) {
+	if (system("ip link > netns.dump.test && ip addr >> netns.dump.test && ip route >> netns.dump.test")) {
+		sleep(1000);
 		fail("Can't save net config");
 		return -1;
 	}
@@ -37,12 +38,12 @@ static int test_fn(int argc, char **argv)
 	test_daemon();
 	test_waitsig();
 
-	if (system("ip link > ip.rst && ip addr >> ip.rst && ip route >> ip.rst")) {
+	if (system("ip link > netns.rst.test && ip addr >> netns.rst.test && ip route >> netns.rst.test")) {
 		fail("Can't get net config");
 		return -1;
 	}
 
-	if (system("diff ip.rst ip.dump")) {
+	if (system("diff netns.rst.test netns.dump.test")) {
 		fail("Net config differs after restore");
 		return -1;
 	}
-- 
2.4.3



More information about the CRIU mailing list