return 0
}
-# do cleanup for netdisk case.
-cleanup_netdisk () {
- for osc in $@; do
- $lctl <<-EOF
- cfg_device $osc
- cleanup
- detach
- EOF
- done
-}
-
# do cleanup for network case.
cleanup_network () {
local clean_srv_OSS=$1
if [ $case == "network" ]; then
cleanup_network $1
fi
- if [ $case == "netdisk" ]; then
- shift
- cleanup_netdisk $@
- fi
if [ $exit_status ]; then
if [ $exit_status -ne 0 ]; then
echo "program exited with error "
fi
exit $exit_status
}
-trap 'cleanup 0 $clean_srv_OSS $cleanup_oscs' EXIT SIGHUP SIGINT SIGTERM
+trap 'cleanup 0 $clean_srv_OSS' EXIT SIGHUP SIGINT SIGTERM
# gets echoclient device number and attach it to the client UUID
# Results are returned by an echo followed by an exit
exit 0
}
-# Create echo-clients using osc_names and osc_uuid
-# It creates echoclients for all osc listed using #lctl device_list command
-ec_using_osc () {
- local osc_name=$1
-
- $lctl <<-EOF
- attach echo_client ${osc_name}_ecc ${osc_name}_ecc_UUID
- cfg_device ${osc_name}_ecc
- setup $osc_name
- EOF
-
-}
-
# create echo client using server nid.
ec_using_srv_nid () {
local server_nid=$1
EOF
}
-setup_osc_for_remote_ost () {
- local ost_nid=$1
- local obdfilter_name=$2
- local host_name=host_$3
-
- $lctl add_uuid ${host_name}_UUID $ost_nid@$NETTYPE >/dev/null 2>&1
- $lctl <<-EOF
- attach osc ${obdfilter_name}_osc ${obdfilter_name}_osc_UUID
- cfg_device ${obdfilter_name}_osc
- setup ${obdfilter_name}_UUID ${host_name}_UUID
- EOF
-}
-
# setup obdecho on server
setup_srv_obd () {
local server_nid=$1
# ... use 'host:name' for obd instances on other nodes.
# allow these to be passed in via string...
# OR
-# one can specify only case=disk or case=network or case=netdisk through
+# one can specify only case=disk or case=network through
# command line.
-# Prerequisite: For "disk" case and "netdisk" case you need to have lustre setup
+# Prerequisite: For "disk" case you need to have lustre setup
# with one or more ost's. For "network" case you need to have all
# modules (those llmount.sh loades) loaded in kernel. And the
# 'lctl dl' output must be blank.
# $ nobjhi=2 thrhi=2 size=1024 targets="<name/ip_of_server>" case=network sh obdfilter-survey
# where, targets is name or ip address of system, which you want to
# set as server.
-# case 3 (network and disk):
-# $ nobjhi=2 thrhi=2 size=1024 case=netdisk sh obdfilter-survey
-# one can also run test with user defined targets as follows,
-# $ nobjhi=2 thrhi=2 size=1024 targets="<osc_name> ..." sh obdfilter-survey
#[ NOTE: It is advised to have automated login (passwordless entry) between server and
# client systems on which this test runs.]
ost_names[$i]=${client_names[$i]}
done
fi
-if [ $case == "netdisk" ]; then
- if [ "$targets" ]; then
- for ((i = 0; i < $ndevs; i++)); do
- setup_osc_for_remote_ost ${host_names[$i]} \
- ${client_names[$i]} $i
- osc_name=${client_names[$i]}_osc
- ec_using_osc $osc_name
- cleanup_oscs="$cleanup_oscs $osc_name"
- done
- else
- client_names_str=$($lctl dl | grep -v mdt |
- awk '{if ($2 == "UP" && $3 == "osc") {print $4} }')
- count=0;
- for name in $client_names_str; do
- client_names[$count]=$(echo $name | sed 's/-osc-.*$//')
- count=$((count + 1))
- done
-
- host_names_str=$($lctl dl -t | grep -v mdt |
- awk '{if ($2 == "UP" && $3 == "osc") {print $7} }')
- count=0;
- for name in $host_names_str; do
- host_names[$count]=$(echo $name | sed 's/@.*$//')
- count=$((count + 1))
- done
-
- for (( i = 0; i < $count; i++ )) do
- setup_osc_for_remote_ost ${host_names[$i]} \
- ${client_names[$i]} $i
- osc_name=${client_names[$i]}_osc
- ec_using_osc $osc_name
- cleanup_oscs="$cleanup_oscs $osc_name"
- done
- fi
-
- echo_clients=$($lctl dl | grep echo_client |
- awk "{if (\$2 == \"UP\" && \$3 == \"echo_client\") { \
- print \$4} }")
- cnt=0;
- for name in $echo_clients; do
- client_names[$cnt]=$name
- host_names[$cnt]=localhost
- cnt=$((cnt + 1))
- done
- ndevs=${#client_names[@]}
-fi
if [ $case == "network" ]; then
server_nid=$targets
if [ -z "$server_nid" ]; then
done
if (($ndevs <= 0 || ${#host_names[@]} <= 0)); then
echo "no devices or hosts specified"
- cleanup 0 $clean_srv_OSS $cleanup_oscs
+ cleanup 0 $clean_srv_OSS
fi
print_summary "$(date) Obdfilter-survey for case=$case from $(hostname)"
done # $thr
done # $nobj
done # $rsz
-cleanup 0 $clean_srv_OSS $cleanup_oscs
+cleanup 0 $clean_srv_OSS
exit 0
case $case in
disk) targets=$(get_targets $case);;
- netdisk) targets=$(get_targets $case);;
network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
*) error "unknown obdflter-survey case!" ;;
esac
run_test 1c "Object Storage Targets survey, big batch"
test_2a () {
- obdflter_survey_run netdisk
+ skip "netdisk was removed"
}
run_test 2a "Stripe F/S over the Network"
test_2b () {
- local param_file=$TMP/$tfile-params
-
- do_nodesv $(comma_list $(osts_nodes)) \
- $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
- save_lustre_params $(get_facets OST) \
- "obdfilter.${FSNAME}-*.sync_journal" > $param_file
- do_nodesv $(comma_list $(osts_nodes)) \
- $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
-
- local stime=$(date +%s)
- thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run netdisk
- local etime=$(date +%s)
- local rtime=$((etime - stime))
-
- echo "obd survey finished in $rtime seconds"
- restore_lustre_params < $param_file
-
- rm -f $param_file
+ skip "netdisk was removed"
}
run_test 2b "Stripe F/S over the Network, async journal"
}
test_180a() {
- [ $PARALLEL == "yes" ] && skip "skip parallel run"
-
- if ! [ -d /sys/fs/lustre/echo_client ] &&
- ! module_loaded obdecho; then
- load_module obdecho/obdecho &&
- stack_trap "rmmod obdecho" EXIT ||
- error "unable to load obdecho on client"
- fi
-
- local osc=$($LCTL dl | grep -v mdt | awk '$3 == "osc" {print $4; exit}')
- local host=$($LCTL get_param -n osc.$osc.import |
- awk '/current_connection:/ { print $2 }' )
- local target=$($LCTL get_param -n osc.$osc.import |
- awk '/target:/ { print $2 }' )
- target=${target%_UUID}
-
- if [ -n "$target" ]; then
- setup_obdecho_osc $host $target &&
- stack_trap "cleanup_obdecho_osc $target" EXIT ||
- { error "obdecho setup failed with $?"; return; }
-
- obdecho_test ${target}_osc client ||
- error "obdecho_test failed on ${target}_osc"
- else
- $LCTL get_param osc.$osc.import
- error "there is no osc.$osc.import target"
- fi
+ skip "obdecho on osc is no longer supported"
}
run_test 180a "test obdecho on osc"
run_test 27 "align non-overlapping extent locks from request ==="
test_28() { # bug 9977
- ECHO_UUID="ECHO_osc1_UUID"
- tOST=$($LCTL dl | awk '/-osc-|OSC.*MNT/ { print $4 }' | head -n1)
-
- $LFS setstripe $DIR1/$tfile -S 1048576 -i 0 -c 2
- tOBJID=`$LFS getstripe $DIR1/$tfile | awk '$1 == 1 {print $2}'`
- dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2
-
- $LCTL <<-EOF
- newdev
- attach echo_client ECHO_osc1 $ECHO_UUID
- setup $tOST
- EOF
-
- tECHOID=`$LCTL dl | grep $ECHO_UUID | awk '{ print $1 }'`
- $LCTL --device $tECHOID destroy "${tOBJID}:0"
-
- $LCTL <<-EOF
- cfg_device ECHO_osc1
- cleanup
- detach
- EOF
-
- # reading of 1st stripe should pass
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error "dd failed"
- # reading of 2nd stripe should fail (this stripe was destroyed)
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 && error
-
- # now, recreating test file
- dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2 || error "dd failed"
- # reading of 1st stripe should pass
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error "dd failed"
- # reading of 2nd stripe should pass
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 ||
- error "dd failed"
+ skip "echo_client on osc is no longer supported"
}
run_test 28 "read/write/truncate file with lost stripes"