Commit bb5f5b19 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: add ability to execute non-namespacess tests concurrently

For that zdtm.sh is executed in pidns to avoid pid conflicts.

Cc: Christopher Covington <cov@codeaurora.org>
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 15b39a1d
......@@ -16,11 +16,9 @@ other: .FORCE
$(MAKE) -C $$t run || break; \
done \
zdtm: .FORCE
zdtm: .FORCE
$(MAKE) zdtm_ns
for t in $(shell echo "$(TST)" | tr ' ' '\n' | grep -Pv $(EXP)); do \
$(MAKE) $$t || break; \
done
$(MAKE) zdtm_nons
.PHONY: zdtm
fault-injection: .FORCE
......@@ -28,7 +26,9 @@ fault-injection: .FORCE
.PHONY: fault-injection
zdtm_ns: $(shell echo "$(TST)" | tr ' ' '\n' | grep -P $(EXP))
zdtm_nons: $(shell echo "$(TST)" | tr ' ' '\n' | grep -vP $(EXP))
$(TST):
./zdtm.sh ${ZDTM_ARGS} $(@) &> $(subst /,_,$@).log || \
./zdtm.sh --ct ${ZDTM_ARGS} $(@) &> $(subst /,_,$@).log || \
{ flock Makefile cat $(subst /,_,$@).log; exit 1; }
.PHONY: zdtm_ns
......@@ -763,6 +763,7 @@ Options:
-P : Make pre-dump instead of dump on all iterations except the last one
-s : Make iterative snapshots. Only the last one will be checked.
--auto-dedup : Make auto-dedup on restore. Check sizes of pages imges, it must be zero.
--ct : re-execute $0 in a container
EOF
}
......@@ -869,6 +870,26 @@ while :; do
usage
exit 0
;;
--ct)
[ -z "$ZDTM_SH_IN_CT" ] && {
export ZDTM_SH_IN_CT=1
shift
args="$@"
# pidns is used to avoid conflicts
# mntns is used to mount /proc
# net is used to avoid conflicts of parasite sockets
unshare --pid --mount --ipc --net -- bash -c "
(
ip link set up dev lo &&
mount --make-rprivate / &&
umount -l /proc &&
mount -t proc proc /proc/ &&
./zdtm.sh $args
)"
exit
}
shift
;;
-*)
echo "Unrecognized option $1, aborting!" 1>&2
usage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment