4 LUSTRE=${LUSTRE:-$(dirname $0)/..}
5 . $LUSTRE/tests/test-framework.sh
9 # bug number for skipped test:
10 ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT "
11 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
15 [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; }
19 thrlo=${thrlo:-$(( thrhi / 2))}
21 OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
23 check_and_setup_lustre
25 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
26 minsize=$(min_ost_size)
27 if [ $(( size * 1024 )) -ge $minsize ]; then
28 size=$((minsize * 10 / 1024 / 12 ))
29 echo min kbytesavail: $minsize using size=${size} MBytes per obd instance
39 for osc in $($LCTL get_param -N osc.${FSNAME}-*osc-*); do
40 nid=$($LCTL get_param $osc.import |
41 awk '/current_connection:/ {sub(/@.*/,""); print $2}')
42 dev=$(echo $osc | sed -e 's/^osc\.//' -e 's/-osc.*//')
45 # For local disk obdfilter-survey requires target devs w/o nid.
47 # case 1 (local disk):
48 # $ nobjhi=2 thrhi=2 size=1024
49 # targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..."
51 local_node && [ "$1" == "disk" ] || target=$nid:$target
52 targets="$targets $target"
57 obdflter_survey_targets () {
62 disk) targets=$(get_targets $case);;
63 netdisk) targets=$(get_targets $case);;
64 network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
65 *) error "unknown obdflter-survey case!" ;;
70 obdflter_survey_run () {
73 rm -f ${TMP}/obdfilter_survey*
75 local targets=$(obdflter_survey_targets $case)
76 local cmd="NETTYPE=$NETTYPE thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" $OBDSURVEY"
81 cat ${TMP}/obdfilter_survey*
82 [ $rc = 0 ] || error "$OBDSURVEY failed: $rc"
86 obdflter_survey_run disk
88 run_test 1a "Object Storage Targets survey"
91 local param_file=$TMP/$tfile-params
93 do_nodesv $(comma_list $(osts_nodes)) \
94 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
95 save_lustre_params $(get_facets OST) \
96 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
97 do_nodesv $(comma_list $(osts_nodes)) \
98 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
100 local stime=$(date +%s)
101 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run disk
102 local etime=$(date +%s)
103 # run time of obd survey
104 local rtime=$((etime - stime))
106 echo "obd survey finished in $rtime seconds"
107 restore_lustre_params < $param_file
111 run_test 1b "Object Storage Targets survey, async journal"
114 nobjlo=1 nobjhi=1 thrlo=32 thrhi=32 rszlo=1024 rszhi=1024 size=8192\
115 obdflter_survey_run disk
117 run_test 1c "Object Storage Targets survey, big batch"
120 obdflter_survey_run netdisk
122 run_test 2a "Stripe F/S over the Network"
125 local param_file=$TMP/$tfile-params
127 do_nodesv $(comma_list $(osts_nodes)) \
128 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
129 save_lustre_params $(get_facets OST) \
130 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
131 do_nodesv $(comma_list $(osts_nodes)) \
132 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
134 local stime=$(date +%s)
135 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run netdisk
136 local etime=$(date +%s)
137 local rtime=$((etime - stime))
139 echo "obd survey finished in $rtime seconds"
140 restore_lustre_params < $param_file
144 run_test 2b "Stripe F/S over the Network, async journal"
147 # README.obdfilter-survey: In network test only automated run is supported.
149 # obdfilter-survey Prerequisite:
150 # For "network" case you need to have all
151 # modules (those llmount.sh loads) loaded in kernel. And the
152 # 'lctl dl' output must be blank.
153 # Skipping test for CLIENTONLY mode because of
154 # cleanupall()->stopall() does not cleanup the servers on this mode.
155 [ "$CLIENTONLY" ] && skip "CLIENTONLY mode"
157 remote_servers || skip "Local servers"
161 obdflter_survey_run network
165 run_test 3a "Network survey"
169 check_and_cleanup_lustre