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 if [[ -x "$OBDSURVEY" ]]; then
22 echo "OBDSURVEY=$OBDSURVEY"
23 elif [[ -x $LUSTRE/../lustre-iokit/obdfilter-survey/obdfilter-survey ]]; then
25 OBDSURVEY="$LUSTRE/../lustre-iokit/obdfilter-survey/obdfilter-survey"
27 OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)}
28 echo "OBDSURVEY==$OBDSURVEY"
31 check_and_setup_lustre
33 # FIXME: the summary file a bit smaller than OSTSIZE, add estimation
34 minsize=$(min_ost_size)
35 if [ $(( size * 1024 )) -ge $minsize ]; then
36 size=$((minsize * 10 / 1024 / 12 ))
37 echo min kbytesavail: $minsize using size=${size} MBytes per obd instance
47 for osc in $($LCTL get_param -N osc.${FSNAME}-*osc-*); do
48 nid=$($LCTL get_param $osc.import |
49 awk '/current_connection:/ {sub(/@.*/,""); \
50 sub(/"/,""); print $2}')
51 dev=$(echo $osc | sed -e 's/^osc\.//' -e 's/-osc.*//')
54 # For local disk obdfilter-survey requires target devs w/o nid.
56 # case 1 (local disk):
57 # $ nobjhi=2 thrhi=2 size=1024
58 # targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..."
60 ! local_node && [ "$1" == "disk" ] || target=$nid:$target
61 targets="$targets $target"
66 obdflter_survey_targets () {
71 disk) targets=$(get_targets $case);;
72 network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
73 *) error "unknown obdflter-survey case!" ;;
78 obdflter_survey_run () {
81 rm -f ${TMP}/obdfilter_survey*
83 local targets=$(obdflter_survey_targets $case)
84 local cmd="NETTYPE=$NETTYPE LCTL=$LCTL thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" $OBDSURVEY"
89 cat ${TMP}/obdfilter_survey*
90 [ $rc = 0 ] || error "$OBDSURVEY failed: $rc"
94 obdflter_survey_run disk
96 run_test 1a "Object Storage Targets survey"
99 local param_file=$TMP/$tfile-params
101 do_nodesv $(comma_list $(osts_nodes)) \
102 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
103 save_lustre_params $(get_facets OST) \
104 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
105 do_nodesv $(comma_list $(osts_nodes)) \
106 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
108 local stime=$(date +%s)
109 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run disk
110 local etime=$(date +%s)
111 # run time of obd survey
112 local rtime=$((etime - stime))
114 echo "obd survey finished in $rtime seconds"
115 restore_lustre_params < $param_file
119 run_test 1b "Object Storage Targets survey, async journal"
122 nobjlo=1 nobjhi=1 thrlo=32 thrhi=32 rszlo=1024 rszhi=1024 size=8192\
123 obdflter_survey_run disk
125 run_test 1c "Object Storage Targets survey, big batch"
128 skip "netdisk was removed"
130 run_test 2a "Stripe F/S over the Network"
133 skip "netdisk was removed"
135 run_test 2b "Stripe F/S over the Network, async journal"
138 # README.obdfilter-survey: In network test only automated run is supported.
140 # obdfilter-survey Prerequisite:
141 # For "network" case you need to have all
142 # modules (those llmount.sh loads) loaded in kernel. And the
143 # 'lctl dl' output must be blank.
144 # Skipping test for CLIENTONLY mode because of
145 # cleanupall()->stopall() does not cleanup the servers on this mode.
146 [ "$CLIENTONLY" ] && skip "CLIENTONLY mode"
148 remote_servers || skip "Local servers"
152 obdflter_survey_run network
156 run_test 3a "Network survey"
158 complete_test $SECONDS
160 check_and_cleanup_lustre