[CRIU] test/zdtm: add -n option to run in-namespace tests only

Yicheng Qin yichengq at google.com
Fri Aug 9 11:08:11 EDT 2013


From: Yicheng Qin <yichengq at google.com>
Subject: [PATCH] test/zdtm: add -n option to run in-namespace tests only

Support -n option in zdtm, which means that only in-namespace tests
will be run.

Signed-off-by: Yicheng Qin <yichengq at google.com>
---
 test/zdtm.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 5b064f7..6db2bf0 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -173,6 +173,7 @@ CLEANUP=0
 PAGE_SERVER=0
 PS_PORT=12345
 TCPDUMP_PID=
+NS_TEST_ONLY=0

 check_mainstream()
 {
@@ -358,6 +359,11 @@ run_test()
  expr "$test" : 'ns/' > /dev/null && PIDNS=1 || PIDNS=""
  test=${ZP}/${test#ns/}

+ # option '-n' to skip tests without namespace
+ if [[ $NS_TEST_ONLY -eq 1 ]] && [[ "$PIDNS" == "" ]]; then
+ return
+ fi
+
  shift
  local args=$*
  local tname=`basename $test`
@@ -629,6 +635,11 @@ while :; do
  shift
  continue;
  fi
+ if [ "$1" = "-n" ]; then
+ shift
+ NS_TEST_ONLY=1
+ continue
+ fi
  if [ "$1" = "-s" ]; then
  SNAPSHOT=1
  shift
@@ -682,6 +693,7 @@ Options:
  -t : mount tmpfs for dump files
  -a <FILE>.tar.gz : save archive with dump files and logs
  -g : Generate executables only
+ -n : Run tests in namespace only
 EOF
 elif [ "${1:0:1}" = '-' ]; then
  echo "unrecognized option $1"
-- 
1.8.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130809/4687d4a4/attachment-0001.html>


More information about the CRIU mailing list