3 # add uml1 uml2 uml3 in your /etc/hosts
8 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
10 LUSTRE=${LUSTRE:-`dirname $0`/..}
11 RLUSTRE=${RLUSTRE:-$LUSTRE}
13 . $LUSTRE/tests/test-framework.sh
17 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
19 FORCE=${FORCE:-" --force"}
24 add_mds mds --dev $MDSDEV --size $MDSSIZE
25 add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
26 --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
27 add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE
28 add_client client mds --lov lov1 --path $MOUNT
34 add_mds mds2 --dev $MDSDEV --size $MDSSIZE
35 add_lov lov2 mds2 --stripe_sz $STRIPE_BYTES\
36 --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
37 add_ost ost2 --lov lov2 --dev $OSTDEV --size $OSTSIZE
38 add_client client mds2 --lov lov2 --path $MOUNT2
42 echo "start mds service on `facet_active_host mds`"
43 start mds --reformat $MDSLCONFARGS > /dev/null || return 94
46 echo "stop mds service on `facet_active_host mds`"
47 stop mds $@ > /dev/null || return 97
51 echo "start ost service on `facet_active_host ost`"
52 start ost --reformat $OSTLCONFARGS > /dev/null || return 95
56 echo "stop ost service on `facet_active_host ost`"
57 stop ost $@ > /dev/null || return 98
62 echo "mount lustre on ${MOUNTPATH}....."
63 zconf_mount $MOUNTPATH > /dev/null || return 96
68 echo "umount lustre on ${MOUNTPATH}....."
69 zconf_umount $MOUNTPATH > /dev/null || return 97
72 manual_umount_client(){
73 echo "manual umount lustre on ${MOUNTPATH}...."
74 do_facet client "umount $MOUNT"
84 umount_client $MOUNT || return -200
85 stop_mds || return -201
86 stop_ost || return -202
90 do_facet client "touch $DIR/a" || return 71
91 do_facet client "rm $DIR/a" || return 72
92 echo "setup single mount lustre success"
96 do_facet client "touch $DIR/a" || return 71
97 do_facet client "rm $DIR/a" || return 72
98 do_facet client "touch $DIR2/a" || return 73
99 do_facet client "rm $DIR2/a" || return 74
100 echo "setup double mount lustre success"
105 #create single point mountpoint
114 check_mount || return 41
117 run_test 0 "single mount setup"
121 echo "start ost second time..."
122 start ost --reformat $OSTLCONFARGS > /dev/null
125 check_mount || return 42
128 run_test 1 "start up ost twice"
133 echo "start mds second time.."
134 start mds --reformat $MDSLCONFARGS > /dev/null
137 check_mount || return 43
140 run_test 2 "start up mds twice"
146 check_mount || return 44
151 run_test 3 "mount client twice"
155 touch $DIR/$tfile || return 85
158 # cleanup may return an error from the failed
159 # disconnects; for now I'll consider this successful
160 # if all the modules have unloaded.
162 lsmod | grep -q portals && return 1
166 run_test 4 "force cleanup ost, then cleanup"
170 touch $DIR/$tfile || return 86
171 stop_mds ${FORCE} || return 98
173 # cleanup may return an error from the failed
174 # disconnects; for now I'll consider this successful
175 # if all the modules have unloaded.
177 lsmod | grep -q portals && return 1
181 run_test 5 "force cleanup mds, then cleanup"
186 mount_client ${MOUNT} || return 87
187 touch $DIR/a || return 86
190 run_test 6 "manual umount, then mount again"
197 run_test 7 "manual umount, then cleanup"
206 check_mount2 || return 45
208 umount_client $MOUNT2
213 run_test 8 "double mount setup"
216 # backup the old values of PTLDEBUG and SUBSYSTEM
217 OLDPTLDEBUG=$PTLDEBUG
218 OLDSUBSYSTEM=$SUBSYSTEM
220 # generate new configuration file with lmc --ptldebug and --subsystem
225 # check the result of lmc --ptldebug/subsystem
229 [ "`cat /proc/sys/portals/debug`" = "1" ] && \
230 echo "lmc --debug success" || return 1
231 [ "`cat /proc/sys/portals/subsystem_debug`" = "16777216" ] && \
232 echo "lmc --subsystem success" || return 1
233 check_mount || return 41
236 # the new PTLDEBUG/SUBSYSTEM used for lconf --ptldebug/subsystem
240 # check lconf --ptldebug/subsystem overriding lmc --ptldebug/subsystem
244 [ "`cat /proc/sys/portals/debug`" = "2" ] && \
245 echo "lconf --debug overriding success" || return 1
246 [ "`cat /proc/sys/portals/subsystem_debug`" = "33554432" ] && \
247 echo "lconf --subsystem overriding success" || return 1
248 check_mount || return 41
251 # resume the old configuration
252 PTLDEBUG=$OLDPTLDEBUG
253 SUBSYSTEM=$OLDSUBSYSTEM
256 run_test 9 "test --ptldebug and --subsystem for lmc"