nfs-utils: tests: Skip test if /dev/log is missing
Subsystems (2)
PATCH 1/1 nfs-utils: tests: Skip test if /dev/log is missing
From: Ben Hutchings <[email protected]>
Some build environments don't have a /dev/log, without which the daemons will fail to run.
* Add a check_dev_log function to skip a test if it's missing
* Call it in t0001-statd-basic-mon-unmon.sh
Signed-off-by Ben Hutchings <[email protected]>
Signed-off-by Salvatore Bonaccorso <[email protected]>
--- tests/t0001-statd-basic-mon-unmon.sh | 3 ++- tests/test-lib.sh | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
tests/t0001-statd-basic-mon-unmon.sh +2 -1
@@ -21,8 +21,9 @@ . ./test-lib.sh -# This test needs root privileges +# This test needs root privileges and /dev/log check_root +check_dev_log start_statd if [ $? -ne 0 ]; then
tests/test-lib.sh +9 -0
@@ -37,6 +37,15 @@ check_root() { fi } +# Most tests require /dev/log. Skip the test if it doesn't exist in this +# environment. +check_dev_log() { + if ! [ -e /dev/log ]; then + echo "*** Skipping this tests as it requires /dev/log ***" + exit 77 + fi +} + # is lockd registered as a service? lockd_registered() { rpcinfo -p | grep -q nlockmgr
Signature · 1 line
2.34.1
Quoted 10 lines · Salvatore Bonaccorso
From: Ben Hutchings <[email protected]>
Some build environments don't have a
/dev/log, without which the daemons will fail to run.* Add a
check_dev_logfunction to skip a test if it's missing
* Call it int0001-statd-basic-mon-unmon.shSigned-off-by Ben Hutchings <[email protected]>Signed-off-by Salvatore Bonaccorso <[email protected]>
Committed... (tag: nfs-utils-2-6-2-rc1)
steved.
Quoted 40 lines
--- tests/t0001-statd-basic-mon-unmon.sh | 3 ++- tests/test-lib.sh | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)tests/t0001-statd-basic-mon-unmon.sh +2
-1@@ -21,8 +21,9 @@ . ./test-lib.sh -# This test needs root privileges +# This test needs root privileges and /dev/log check_root +check_dev_log start_statd if [ $? -ne 0 ]; thentests/test-lib.sh +9
-0@@ -37,6 +37,15 @@ check_root() { fi } +# Most tests require /dev/log. Skip the test if it doesn't exist in this +# environment. +check_dev_log() { + if ! [ -e /dev/log ]; then + echo "*** Skipping this tests as it requires /dev/log ***" + exit 77 + fi +} + # is lockd registered as a service? lockd_registered() { rpcinfo -p | grep -q nlockmgr