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 network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
64 *) error "unknown obdflter-survey case!" ;;
69 obdflter_survey_run () {
72 rm -f ${TMP}/obdfilter_survey*
74 local targets=$(obdflter_survey_targets $case)
75 local cmd="NETTYPE=$NETTYPE thrlo=$thrlo nobjhi=$nobjhi thrhi=$thrhi size=$size case=$case rslt_loc=${TMP} targets=\"$targets\" $OBDSURVEY"
80 cat ${TMP}/obdfilter_survey*
81 [ $rc = 0 ] || error "$OBDSURVEY failed: $rc"
85 obdflter_survey_run disk
87 run_test 1a "Object Storage Targets survey"
90 local param_file=$TMP/$tfile-params
92 do_nodesv $(comma_list $(osts_nodes)) \
93 $LCTL get_param obdfilter.${FSNAME}-*.sync_journal
94 save_lustre_params $(get_facets OST) \
95 "obdfilter.${FSNAME}-*.sync_journal" > $param_file
96 do_nodesv $(comma_list $(osts_nodes)) \
97 $LCTL set_param obdfilter.${FSNAME}-*.sync_journal=0
99 local stime=$(date +%s)
100 thrlo=4 nobjhi=1 thrhi=4 obdflter_survey_run disk
101 local etime=$(date +%s)
102 # run time of obd survey
103 local rtime=$((etime - stime))
105 echo "obd survey finished in $rtime seconds"
106 restore_lustre_params < $param_file
110 run_test 1b "Object Storage Targets survey, async journal"
113 nobjlo=1 nobjhi=1 thrlo=32 thrhi=32 rszlo=1024 rszhi=1024 size=8192\
114 obdflter_survey_run disk
116 run_test 1c "Object Storage Targets survey, big batch"
119 skip "netdisk was removed"
121 run_test 2a "Stripe F/S over the Network"
124 skip "netdisk was removed"
126 run_test 2b "Stripe F/S over the Network, async journal"
129 # README.obdfilter-survey: In network test only automated run is supported.
131 # obdfilter-survey Prerequisite:
132 # For "network" case you need to have all
133 # modules (those llmount.sh loads) loaded in kernel. And the
134 # 'lctl dl' output must be blank.
135 # Skipping test for CLIENTONLY mode because of
136 # cleanupall()->stopall() does not cleanup the servers on this mode.
137 [ "$CLIENTONLY" ] && skip "CLIENTONLY mode"
139 remote_servers || skip "Local servers"
143 obdflter_survey_run network
147 run_test 3a "Network survey"
151 check_and_cleanup_lustre