From: Lionel Sambuc Date: Mon, 12 Jan 2015 17:14:43 +0000 (+0100) Subject: testrelpol: let test specific services X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=0485087c58f211e26acf7f253c6227db9e677352;p=minix.git testrelpol: let test specific services If arguments are provided, the services list to test is set from those, instead of initializing it with every currently running service. If such arguments are present, also skip LiveUpdate tests. Change-Id: I14f874666a610072a5ff4a60516e59cf04dc9e31 --- diff --git a/minix/tests/testrelpol.sh b/minix/tests/testrelpol.sh index a6dfddd1e..799aecf6f 100755 --- a/minix/tests/testrelpol.sh +++ b/minix/tests/testrelpol.sh @@ -5,9 +5,14 @@ # for each restatability policy call the policy test function if it is # supported. No accounting of failed / successful test is done, as a # failed test can currently provoque cascading effects, so instead we -# fail the test as a whole on the first failure is found. Live update tests +# fail the test as a whole on the first failure found. Live update tests # are currently policy-agnostic. # +# If arguments are given, use this instead of all entries found in +# /proc/service. Full path have to be provided on the command line, like +# /usr/tests/minix/testrelpol /proc/service/vfs +# to test vfs recovery only. +# # Supported policies have to be in the POLICIES variable, and define a test # function. # @@ -268,12 +273,18 @@ main() { # If there is a running X server, skip the input driver if ps -ef | grep -v grep | grep -q /usr/X11R7/bin/X then - echo "This test can't be run while a Xserver is running" + echo "# This test can't be run while a Xserver is running" echo "not ok # A Xserver is running" exit 1 fi - services=$(echo /proc/service/*) + if [ $# -eq 0 ] + then + services=$(echo /proc/service/*) + else + services="$@" + fi + for service in ${services} do label=$(basename ${service}) @@ -299,6 +310,12 @@ main() { fi done done + if [ $# -gt 0 ] + then + echo "ok # partial test for $@ successful" + exit 0 + fi + multi_lu_labels="" for service in ${services} do @@ -337,4 +354,4 @@ main() { exit 0 } -main +main "$@"