[CRIU] [PATCH 2/2] zdtm: generate a test list only once
Andrey Vagin
avagin at openvz.org
Fri Jan 23 03:20:20 PST 2015
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
test/Makefile | 32 ++++++++++++--------------------
test/Makefile.zdtm | 15 +++++++++++++++
2 files changed, 27 insertions(+), 20 deletions(-)
create mode 100644 test/Makefile.zdtm
diff --git a/test/Makefile b/test/Makefile
index 0d08805..44a414c 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,3 @@
-TST = $(shell ./zdtm.sh -l)
RM := rm -f --one-file-system
ZDTM_ARGS ?= -C
@@ -20,18 +19,21 @@ other: .FORCE
$(MAKE) -C $$t run || break; \
done \
-zdtm: .FORCE
- $(MAKE) zdtm_ns
- $(MAKE) zdtm_nons
+zdtm-tst-list: zdtm.sh
+ ./zdtm.sh -l > zdtm-tst-list
-zdtm-pre-dump:
- ZDTM_ARGS="-P -p -i 3 -C" $(MAKE) ns/static/pipe00
+zdtm: zdtm-tst-list .FORCE
+ $(MAKE) -f Makefile.zdtm zdtm_ns
+ $(MAKE) -f Makefile.zdtm zdtm_nons
-zdtm-snapshot:
- ZDTM_ARGS="-s -i 3 -C" $(MAKE) ns/static/pipe00
+zdtm-pre-dump: zdtm-tst-list
+ ZDTM_ARGS="-P -p -i 3 -C" $(MAKE) -f Makefile.zdtm ns/static/pipe00
-zdtm-iter:
- ZDTM_ARGS="-i 3 -C" $(MAKE) ns/static/pipe00
+zdtm-snapshot: zdtm-tst-list
+ ZDTM_ARGS="-s -i 3 -C" $(MAKE) -f Makefile.zdtm ns/static/pipe00
+
+zdtm-iter: zdtm-tst-list
+ ZDTM_ARGS="-i 3 -C" $(MAKE) -f Makefile.zdtm ns/static/pipe00
.PHONY: zdtm
@@ -39,11 +41,7 @@ fault-injection: .FORCE
$(MAKE) -C fault-injection
.PHONY: fault-injection
-zdtm_ns: $(shell echo "$(TST)" | tr ' ' '\n' | awk '/^ns\// && !/tty|pty/ {print}')
-zdtm_nons: $(shell echo "$(TST)" | tr ' ' '\n' | awk '!/^ns\// || /tty|pty/ {print}')
-
override CFLAGS += -D_GNU_SOURCE
-zdtm_ct: zdtm_ct.c
clean:
$(RM) zdtm_ct
@@ -57,10 +55,4 @@ clean:
$(Q) $(MAKE) -C rpc clean
$(Q) $(MAKE) -C crit clean
-mount_cgroups: .FORCE
- flock zdtm_mount_cgroups ./zdtm_mount_cgroups
-
-$(TST): zdtm_ct mount_cgroups .FORCE
- ./zdtm.sh --ct ${ZDTM_ARGS} $(@) &> $(subst /,_,$@).log; \
- { ret=$$?; fname=$(subst /,_,$@).log; flock Makefile cat $$fname; unlink $$fname; exit $$ret; }
.PHONY: zdtm_ns
diff --git a/test/Makefile.zdtm b/test/Makefile.zdtm
new file mode 100644
index 0000000..24ddf39
--- /dev/null
+++ b/test/Makefile.zdtm
@@ -0,0 +1,15 @@
+TST = $(shell cat zdtm-tst-list)
+
+.FORCE:
+
+zdtm_ns: $(shell echo "$(TST)" | tr ' ' '\n' | awk '/^ns\// && !/tty|pty/ {print}')
+zdtm_nons: $(shell echo "$(TST)" | tr ' ' '\n' | awk '!/^ns\// || /tty|pty/ {print}')
+
+$(TST): zdtm_ct mount_cgroups .FORCE
+ ./zdtm.sh --ct ${ZDTM_ARGS} -r $(@) &> $(subst /,_,$@).log; \
+ { ret=$$?; fname=$(subst /,_,$@).log; flock Makefile cat $$fname; unlink $$fname; exit $$ret; }
+
+mount_cgroups: .FORCE
+ flock zdtm_mount_cgroups ./zdtm_mount_cgroups
+
+zdtm_ct: zdtm_ct.c
--
1.9.3
More information about the CRIU
mailing list