1 #export PATH=`dirname $0`/../utils:/r/sbin/:/r/usr/bin/:$PATH
2 export PATH=./../utils:/r/sbin/:/r/usr/bin/:$PATH
6 TARBALL=${TARBALL:-doc.tgz}
7 DEBUGFS=${DEBUGFS:-debugfs}
8 MNTPATH=${MNTPATH:-"/mnt/lustre"}
9 TARCMD=${TARCMD:-"tar"}
10 UNTARCMD=${UNTARCMD:-"tar -zxvf"}
11 CPCMD=${CPCMD:-"cp -f"}
12 CACHEMDS=${CACHEMDS:-$TMP/mds1-uml}
13 REALMDS=${REALMDS:-$TMP/mds2-uml}
15 CACHEOST=${CACHEOST:-$TMP/ost1-uml}
16 REALOST=${REALOST:-$TMP/ost2-uml}
18 MDS_CMOBD_INDEX=${MDS_CMOBD_INDEX:-12}
19 OST_CMOBD_INDEX=${OST_CMOBD_INDEX:-14}
21 MDS_COBD_INDEX=${MDS_COBD_INDEX:-22}
22 OST_COBD_INDEX=${OST_COBD_INDEX:-19}
25 if ! [ -e "$TMP/$TARBALL" ]; then
26 echo "$TARBALL did not exist, please give a tar ball for test in your $TMP"
33 echo "sleep 20 secs sync fs for show the usages of fs"
38 string=`${DEBUGFS} -R stats $cache_mds | tail -n 2`
41 string=`${DEBUGFS} -R stats $cache_ost | tail -n 2`
47 device $OST_CMOBD_INDEX
49 device $MDS_CMOBD_INDEX
56 device $OST_COBD_INDEX
58 device $MDS_COBD_INDEX
66 device $OST_COBD_INDEX
68 device $MDS_COBD_INDEX
74 echo "before test ...."
75 show_filesystem $CACHEMDS $CACHEOST
77 #first step cp the tar to cache dev and untar it
78 echo "cp $TARBALL to lustre dir and untar ..."
79 ${CPCMD} $TMP/${TARBALL} ${MNTPATH} || exit 1
80 ${UNTARCMD} ${MNTPATH}/${TARBALL} -C ${MNTPATH} > /dev/null || exit 2
81 #show status of the filesystem
82 echo after cp show the filsystem....
83 show_filesystem $CACHEMDS $CACHEOST
86 #second step flush and cache off these file to the real dev
89 echo "flush these tar and files....."
90 show_filesystem $CACHEMDS $CACHEOST
93 #third step and write files to real dev
95 $CPCMD -f $TMP/$TARBALL $MNTPATH/new || exit 1
96 $UNTARCMD $MNTPATH/new/$TARBALL -C $MNTPATH/new > /dev/null || exit 2
97 show_filesystem $CACHEMDS $CACHEOST