X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-sec.sh;h=a8c814dc7671835e5b65b4d5341124ff3f5abd40;hb=5a6aa0e6d1583cc0d4c82ae8c95fb7b9856d6284;hp=289711ac8fb83351d0d0b79e92e3ab5c0a2129ca;hpb=193987fbbb7595d29cec47f03f009f56caa90924;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index 289711a..a8c814d 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -867,6 +867,7 @@ run_test 15 "test id mapping" wait_nm_sync() { local nodemap_name=$1 local key=$2 + local value=$3 local proc_param="${nodemap_name}.${key}" [ "$nodemap_name" == "active" ] && proc_param="active" @@ -875,12 +876,17 @@ wait_nm_sync() { local max_retries=20 local is_sync - local out1=$(do_facet mgs $LCTL get_param nodemap.${proc_param}) + local out1="" local out2 local mgs_ip=$(host_nids_address $mgs_HOST $NETTYPE | cut -d' ' -f1) local i - echo "On MGS ${mgs_ip}, ${proc_param} = $out1" + if [ -z "$value" ]; then + out1=$(do_facet mgs $LCTL get_param nodemap.${proc_param}) + echo "On MGS ${mgs_ip}, ${proc_param} = $out1" + else + out1=$value; + fi # wait up to 10 seconds for other servers to sync with mgs for i in $(seq 1 10); do @@ -889,7 +895,9 @@ wait_nm_sync() { cut -d' ' -f1) is_sync=true - [ $node_ip == $mgs_ip ] && continue + if [ -z "$value" ]; then + [ $node_ip == $mgs_ip ] && continue + fi out2=$(do_node $node_ip $LCTL get_param \ nodemap.$proc_param 2>/dev/null) @@ -1581,6 +1589,7 @@ test_25() { local tmpfile=$(mktemp) local tmpfile2=$(mktemp) local subdir=c0dir + local client nodemap_version_check || return 0 @@ -1590,8 +1599,16 @@ test_25() { nodemap_test_setup - echo c* nodemaps: - do_facet mgs $LCTL get_param nodemap.c*.* + # enable trusted/admin for setquota call in cleanup_and_setup_lustre() + i=0 + for client in $clients; do + do_facet mgs $LCTL nodemap_modify --name c${i} \ + --property admin --value 1 + do_facet mgs $LCTL nodemap_modify --name c${i} \ + --property trusted --value 1 + ((i++)) + done + wait_nm_sync c$((i - 1)) trusted_nodemap trap nodemap_test_cleanup EXIT @@ -1645,6 +1662,8 @@ run_test 26 "test transferring very large nodemap" test_27() { local subdir=c0dir local subsubdir=c0subdir + local fileset_on_mgs="" + local loop=0 nodemap_test_setup trap nodemap_test_cleanup EXIT @@ -1652,11 +1671,9 @@ test_27() { fileset_test_setup # add fileset info to nodemap - do_facet mgs $LCTL set_param nodemap.c0.fileset=/$subdir || - error "unable to set fileset info on nodemap c0" do_facet mgs $LCTL set_param -P nodemap.c0.fileset=/$subdir || error "unable to add fileset info to nodemap c0" - wait_nm_sync c0 fileset + wait_nm_sync c0 fileset "nodemap.c0.fileset=/$subdir" # re-mount client zconf_umount_clients ${clients_arr[0]} $MOUNT || @@ -1683,6 +1700,18 @@ test_27() { # remove fileset info from nodemap do_facet mgs $LCTL nodemap_set_fileset --name c0 --fileset \'\' || error "unable to delete fileset info on nodemap c0" + fileset_on_mgs=$(do_facet mgs $LCTL get_param nodemap.c0.fileset) + while [ "${fileset_on_mgs}" != "nodemap.c0.fileset=" ]; do + if [ $loop -eq 10 ]; then + error "On MGS, fileset cannnot be cleared" + break; + else + loop=$((loop+1)) + echo "On MGS, fileset is still ${fileset_on_mgs}, waiting..." + sleep 20; + fi + fileset_on_mgs=$(do_facet mgs $LCTL get_param nodemap.c0.fileset) + done do_facet mgs $LCTL set_param -P nodemap.c0.fileset=\'\' || error "unable to reset fileset info on nodemap c0" wait_nm_sync c0 fileset