4 LUSTRE=${LUSTRE:-$(dirname $0)/..}
5 . $LUSTRE/tests/test-framework.sh
9 # bug number for skipped test:
10 ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT "
12 # it would be nice to have an "all" option :-)
13 if [[ $mds1_FSTYPE == zfs ]] &&
14 (( $(zfs_version_code mds1) >= $(version_code 2.2.7) )); then
15 always_except LU-18889 1a 1b 1c 2a 2b 3a
20 [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; }
24 thrlo=${thrlo:-$(( thrhi / 2))}
26 if [[ -x "$OBDSURVEY" ]]; then
27 echo "OBDSURVEY=$OBDSURVEY"
28 elif [[ -x $LUSTRE/../lustre-iokit/obdfilter-survey/obdfilter-survey ]]; then
30 OBDSURVEY="$LUSTRE/../lustre-iokit/obdfilter-survey/obdfilter-survey"
32 OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
33 echo "OBDSURVEY==$OBDSURVEY"
36 check_and_setup_lustre
38 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
39 minsize=$(min_ost_size)
40 if [ $(( size * 1024 )) -ge $minsize ]; then
41 size=$((minsize * 10 / 1024 / 12 ))
42 echo min kbytesavail: $minsize using size=${size} MBytes per obd instance
52 for osc in $($LCTL get_param -N osc.${FSNAME}-*osc-*); do
53 nid=$($LCTL get_param $osc.import |
54 awk '/current_connection:/ {sub(/@.*/,""); \
55 sub(/"/,""); print $2}')
56 dev=$(echo $osc | sed -e 's/^osc\.//' -e 's/-osc.*//')
59 # For local disk obdfilter-survey requires target devs w/o nid.
61 # case 1 (local disk):
62 # $ nobjhi=2 thrhi=2 size=1024
63 # targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..."
65 ! local_node && [ "$1" == "disk" ] || target=$nid:$target
66 targets="$targets $target"
71 obdflter_survey_targets () {
76 disk) targets=$(get_targets $case);;
77 network) targets=$(host_nids_address $(osts_nodes) $NETTYPE);;
78 *) error "unknown obdflter-survey case!" ;;
83 obdflter_survey_run () {
86 rm -f ${TMP}/obdfilter_survey*
88 local targets=$(obdflter_survey_targets $case)
89 local cmd="NETTYPE=$NETTYPE LCTL=$LCTL thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" $OBDSURVEY"
94 cat ${TMP}/obdfilter_survey*
95 [ $rc = 0 ] || error "$OBDSURVEY failed: $rc"
99 obdflter_survey_run disk
101 run_test 1a "Object Storage Targets survey"
104 local param_file=$TMP/$tfile-params
106 do_nodesv $(comma_list $(osts_nodes)) \
107 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
108 save_lustre_params $(get_facets OST) \
109 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
110 do_nodesv $(comma_list $(osts_nodes)) \
111 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
113 local stime=$(date +%s)
114 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run disk
115 local etime=$(date +%s)
116 # run time of obd survey
117 local rtime=$((etime - stime))
119 echo "obd survey finished in $rtime seconds"
120 restore_lustre_params < $param_file
124 run_test 1b "Object Storage Targets survey, async journal"
127 nobjlo=1 nobjhi=1 thrlo=32 thrhi=32 rszlo=1024 rszhi=1024 size=8192\
128 obdflter_survey_run disk
130 run_test 1c "Object Storage Targets survey, big batch"
133 skip "netdisk was removed"
135 run_test 2a "Stripe F/S over the Network"
138 skip "netdisk was removed"
140 run_test 2b "Stripe F/S over the Network, async journal"
143 # README.obdfilter-survey: In network test only automated run is supported.
145 # obdfilter-survey Prerequisite:
146 # For "network" case you need to have all
147 # modules (those llmount.sh loads) loaded in kernel. And the
148 # 'lctl dl' output must be blank.
149 # Skipping test for CLIENTONLY mode because of
150 # cleanupall()->stopall() does not cleanup the servers on this mode.
151 [ "$CLIENTONLY" ] && skip "CLIENTONLY mode"
153 remote_servers || skip "Local servers"
157 obdflter_survey_run network
161 run_test 3a "Network survey"
163 complete_test $SECONDS
165 check_and_cleanup_lustre