5 LUSTRE=${LUSTRE:-`dirname $0`/..}
6 . $LUSTRE/tests/test-framework.sh
13 # the summary file a bit smaller than OSTSIZE
14 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
17 [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; }
18 thrlo=${thrlo:-$(( thrhi / 2))}
20 # bug number for skipped test:
21 ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT"
22 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
24 OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
27 check_and_setup_lustre
29 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
30 minsize=$(min_ost_size)
31 if [ $(( size * 1024 )) -ge $minsize ]; then
32 size=$((minsize * 10 / 1024 / 12 ))
33 echo min kbytesavail: $minsize using size=${size} MBytes per obd instance
43 for osc in $($LCTL get_param -N osc.${FSNAME}-*osc-*); do
44 nid=$($LCTL get_param $osc.import |
45 awk '/current_connection:/ {sub(/@.*/,""); print $2}')
46 dev=$(echo $osc | sed -e 's/^osc\.//' -e 's/-osc.*//')
49 # For local disk obdfilter-survey requires target devs w/o nid.
51 # case 1 (local disk):
52 # $ nobjhi=2 thrhi=2 size=1024
53 # targets="lustre-OST0000 lustre-OST0001 ..."
55 local_node && [ "$1" == "disk" ] || target=$nid:$target
56 targets="$targets $target"
61 obdflter_survey_targets () {
66 disk) targets=$(get_targets $case);;
67 netdisk) targets=$(get_targets $case);;
68 network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
69 *) error "unknown obdflter-survey case!" ;;
74 obdflter_survey_run () {
77 rm -f ${TMP}/obdfilter_survey*
79 local targets=$(obdflter_survey_targets $case)
80 local cmd="NETTYPE=$NETTYPE thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" $OBDSURVEY"
85 cat ${TMP}/obdfilter_survey*
86 [ $rc = 0 ] || error "$OBDSURVEY failed: $rc"
90 obdflter_survey_run disk
92 run_test 1a "Object Storage Targets survey"
95 local param_file=$TMP/$tfile-params
97 do_nodesv $(comma_list $(osts_nodes)) \
98 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
99 save_lustre_params $(get_facets OST) \
100 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
101 do_nodesv $(comma_list $(osts_nodes)) \
102 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
104 local stime=$(date +%s)
105 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run disk
106 local etime=$(date +%s)
107 # run time of obd survey
108 local rtime=$((etime - stime))
110 echo "obd survey finished in $rtime seconds"
111 restore_lustre_params < $param_file
115 run_test 1b "Object Storage Targets survey, async journal"
118 nobjlo=1 nobjhi=1 thrlo=32 thrhi=32 rszlo=1024 rszhi=1024 size=8192\
119 obdflter_survey_run disk
121 run_test 1c "Object Storage Targets survey, big batch"
124 obdflter_survey_run netdisk
126 run_test 2a "Stripe F/S over the Network"
129 local param_file=$TMP/$tfile-params
131 do_nodesv $(comma_list $(osts_nodes)) \
132 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
133 save_lustre_params $(get_facets OST) \
134 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
135 do_nodesv $(comma_list $(osts_nodes)) \
136 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
138 local stime=$(date +%s)
139 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run netdisk
140 local etime=$(date +%s)
141 local rtime=$((etime - stime))
143 echo "obd survey finished in $rtime seconds"
144 restore_lustre_params < $param_file
148 run_test 2b "Stripe F/S over the Network, async journal"
151 # README.obdfilter-survey: In network test only automated run is supported.
153 # obdfilter-survey Prerequisite:
154 # For "network" case you need to have all
155 # modules (those llmount.sh loads) loaded in kernel. And the
156 # 'lctl dl' output must be blank.
157 # Skipping test for CLIENTONLY mode because of
158 # cleanupall()->stopall() does not cleanup the servers on this mode.
159 [ "$CLIENTONLY" ] && skip "CLIENTONLY mode"
161 remote_servers || skip "Local servers"
165 obdflter_survey_run network
169 run_test 3a "Network survey"
173 check_and_cleanup_lustre