From 4b9de88f99066adf4365c6b747aad4f6d52d0ae2 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 9 Feb 2017 18:09:35 -0700 Subject: [PATCH] LU-7092 tests: generate sanity proc_dirs on facet For sanity test_133f and test_133g generate the list of available /proc and /sys directories for lnet and lustre on the remote facet instead of only the client, so that the tests work during interop. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I0125e20656a712eb620ba4f07d1eaeeb0b9cab07 Reviewed-on: https://review.whamcloud.com/25363 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Steve Guminski Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/tests/rpc.sh | 1 + lustre/tests/sanity.sh | 45 ++++++++++++++++++++++++------------------ lustre/tests/test-framework.sh | 2 +- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/lustre/tests/rpc.sh b/lustre/tests/rpc.sh index bbe9337..a5831c8 100755 --- a/lustre/tests/rpc.sh +++ b/lustre/tests/rpc.sh @@ -16,5 +16,6 @@ RPC_MODE=true init_test_env # framework's job. trap - ERR +log "$HOSTNAME: executing $@" # Execute the command "$@" diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index b0921f5..f66a8c8 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -9677,17 +9677,15 @@ test_133e() { } run_test 133e "Verifying OST {read,write}_bytes nid stats =================" -proc_dirs="" -for dir in /proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \ - /sys/fs/lustre/ /sys/fs/lnet/ /sys/kernel/debug/lnet/ \ - /sys/kernel/debug/lustre/; do - [[ -d $dir ]] && proc_dirs+=" $dir" -done +proc_regexp="/{proc,sys}/{fs,sys,kernel/debug}/{lustre,lnet}/" test_133f() { remote_mds_nodsh && skip "remote MDS with nodsh" && return remote_ost_nodsh && skip "remote OST with nodsh" && return # First without trusting modes. + local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null) + echo "proc_dirs='$proc_dirs'" + [ -n "$proc_dirs" ] || error "no proc_dirs on $HOSTNAME" find $proc_dirs -exec cat '{}' \; &> /dev/null # Second verifying readability. @@ -9696,12 +9694,16 @@ test_133f() { # eventually, this can also be replaced with "lctl get_param -R", # but not until that option is always available on the server local facet - for facet in $SINGLEMDS ost1; do - do_facet $facet find $proc_dirs \ + for facet in mds1 ost1; do + local facet_proc_dirs=$(do_facet $facet \ + \\\ls -d $proc_regexp 2>/dev/null) + echo "${facet}_proc_dirs='$facet_proc_dirs'" + [ -z "$facet_proc_dirs" ] && error "no proc_dirs on $facet" + do_facet $facet find $facet_proc_dirs \ ! -name req_history \ -exec cat '{}' \\\; &> /dev/null - do_facet $facet find $proc_dirs \ + do_facet $facet find $facet_proc_dirs \ ! -name req_history \ -type f \ -exec cat '{}' \\\; &> /dev/null || @@ -9714,6 +9716,9 @@ test_133g() { remote_mds_nodsh && skip "remote MDS with nodsh" && return remote_ost_nodsh && skip "remote OST with nodsh" && return # Second verifying writability. + local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null) + echo "proc_dirs='$proc_dirs'" + [ -n "$proc_dirs" ] || error "no proc_dirs on $HOSTNAME" find $proc_dirs \ -type f \ -not -name force_lbug \ @@ -9721,21 +9726,20 @@ test_133g() { -exec badarea_io '{}' \; &> /dev/null || error "find $proc_dirs failed" - [ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.5.54) ] && - skip "Too old lustre on MDS" && return - - [ $(lustre_version_code ost1) -le $(version_code 2.5.54) ] && - skip "Too old lustre on ost1" && return - local facet - for facet in $SINGLEMDS ost1; do - do_facet $facet find $proc_dirs \ + for facet in mds1 ost1; do + [ $(lustre_version_code $facet) -le $(version_code 2.5.54) ] && + skip "Too old lustre on $facet" && continue + local facet_proc_dirs=$(do_facet $facet \ + \\\ls -d $proc_regexp 2> /dev/null) + echo "${facet}_proc_dirs='$facet_proc_dirs'" + [ -z "$facet_proc_dirs" ] && error "no proc_dirs on $facet" + do_facet $facet find $facet_proc_dirs \ -type f \ -not -name force_lbug \ -not -name changelog_mask \ -exec badarea_io '{}' \\\; &> /dev/null || - error "$facet find $proc_dirs failed" - + error "$facet find $facet_proc_dirs failed" done # remount the FS in case writes/reads /proc break the FS @@ -15633,6 +15637,9 @@ test_401a() { #LU-7437 #count the number of parameters by "list_param -R" local params=$($LCTL list_param -R '*' 2>/dev/null | wc -l) #count the number of parameters by listing proc files + local proc_dirs=$(eval \ls -d $proc_regexp 2>/dev/null) + echo "proc_dirs='$proc_dirs'" + [ -n "$proc_dirs" ] || error "no proc_dirs on $HOSTNAME" local procs=$(find -L $proc_dirs -mindepth 1 -printf '%P\n' 2>/dev/null| sort -u | wc -l) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 1a1ad31..e39d656 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -6067,7 +6067,7 @@ _wait_osc_import_state() { if ! do_rpc_nodes "$(facet_active_host $facet)" \ wait_import_state $expected "$params" $maxtime; then - error "import is not in ${expected} state" + error "$facet: import is not in $expected state after $maxtime" return 1 fi -- 1.8.3.1