1-#!/bin/sh 2# This script should be run prior to running executing the filesystem tests. 3# valid devices need to be passed for the test to work correctly 4# 10/06/03 mridge@us.ibm.com added instance and time command line options 5# 6# 7 8cd `dirname $0` 9export LTPROOT=${PWD} 10echo $LTPROOT | grep testscripts > /dev/null 2>&1 11if [ $? -eq 0 ]; then 12 cd .. 13 export LTPROOT=${PWD} 14fi 15 16export TMPBASE="/tmp" 17 18 19usage() 20{ 21 cat <<-END >&2 22 usage: ${0##*/} [ -a part1 ] [ -n nfsmount ] 23 defaults: 24 part1=$part1 25 nfsmount=$nfsmount 26 ltproot=$TPROOT 27 tmpdir=$TMPBASE 28 29 example: ${0##*/} -a hdc1 -b hdc2 -c hdc3 -d hdc4 -n mytesthost:/testmountdir 30 31 - This test will ONLY run on a 2.5.66 or higher kernel system. 32 33 - These operations are destructive so do NOT point the tests to partitions where the data shouldn't be overwritten. 34 Once these tests are started all data in the partitions you point to will be destroyed. 35 36 END 37exit 38} 39 40while getopts :a:n:v: arg 41do case $arg in 42 a) part1=$OPTARG;; 43 n) nfsmount=$OPTARG;; 44 v) verb=$OPTARG;; 45 46 \?) echo "************** Help Info: ********************" 47 usage;; 48 esac 49done 50 51if [ ! -n "$part1" ]; then 52 echo "Missing 1st partition. You must pass 4 partitions for testing" 53 usage; 54 exit 55fi 56 57if [ ! -n "$nfsmount" ]; then 58 echo "Missing NFS partition. You must pass an NFS mount point for testing" 59 usage; 60 exit 61fi 62 63export PATH="${PATH}:${LTPROOT}/testcases/bin" 64 65 66mkdir /test >/dev/null 2>&1 67mkdir /test/growfiles >/dev/null 2>&1 68mkdir /test/growfiles/ext2 >/dev/null 2>&1 69mkdir /test/growfiles/msdos >/dev/null 2>&1 70mkdir /test/growfiles/reiser >/dev/null 2>&1 71mkdir /test/growfiles/minix >/dev/null 2>&1 72mkdir /test/growfiles/xfs >/dev/null 2>&1 73mkdir /test/growfiles/nfs >/dev/null 2>&1 74mkdir /test/growfiles/jfs >/dev/null 2>&1 75mkdir /test/growfiles/ext3 >/dev/null 2>&1 76 77 78mkfs -V -t ext2 /dev/$part1 79 80 81mount -v -t nfs $nfsmount /test/growfiles/nfs 82mount -v /dev/$part1 /test/growfiles/ext2 83 84 85echo "************ Running tests " 86sort -R ${LTPROOT}/runtest/ltpfs.part1 -o ${TMPBASE}/ltpfs.part1 87 88${LTPROOT}/pan/pan -e -S -a ltpfspart1 -n ltpfspart1 -l lvmlogfile -f ${TMPBASE}/ltpfs.part1 & 89 90wait $! 91 92umount -v -t nfs $nfsmount 93umount -v /dev/$part1 94mkfs.xfs -f /dev/$part1 95mount -v /dev/$part1 /test/growfiles/xfs 96 97 98sort -R ${LTPROOT}/runtest/ltpfs.part2 -o ${TMPBASE}/ltpfs.part2 99 100${LTPROOT}/pan/pan -e -S -a ltpfspart2 -n ltpfspart2 -l lvmlogfile -f ${TMPBASE}/ltpfs.part2 & 101 102wait $! 103 104mkfs -V -t msdos /dev/$part1 105umount -v /dev/$part1 106mount -v /dev/$part1 /test/growfiles/msdos 107 108sort -R ${LTPROOT}/runtest/ltpfs.part3 -o ${TMPBASE}/ltpfs.part3 109 110${LTPROOT}/pan/pan -e -S -a ltpfspart3 -n ltpfspart3 -l lvmlogfile -f ${TMPBASE}/ltpfs.part3 & 111 112wait $! 113 114umount -v /dev/$part1 115mkreiserfs /dev/$part1 <yesenter.txt 116mount -v /dev/$part1 /test/growfiles/reiser 117 118sort -R ${LTPROOT}/runtest/ltpfs.part4 -o ${TMPBASE}/ltpfs.part4 119 120${LTPROOT}/pan/pan -e -S -a ltpfspart4 -n ltpfspart4 -l lvmlogfile -f ${TMPBASE}/ltpfs.part4 & 121 122wait $! 123 124umount -v /dev/$part1 125mkfs -V -t minix /dev/$part1 126mount -v /dev/$part1 /test/growfiles/minix 127 128sort -R ${LTPROOT}/runtest/ltpfs.part5 -o ${TMPBASE}/ltpfs.part5 129 130${LTPROOT}/pan/pan -e -S -a ltpfspart5 -n ltpfspart5 -l lvmlogfile -f ${TMPBASE}/ltpfs.part5 & 131 132wait $! 133 134umount -v /dev/$part1 135mkfs -V -t ext3 /dev/$part1 136mount -v /dev/$part1 /test/growfiles/ext3 137 138sort -R ${LTPROOT}/runtest/ltpfs.part6 -o ${TMPBASE}/ltpfs.part6 139 140${LTPROOT}/pan/pan -e -S -a ltpfspart6 -n ltpfspart6 -l lvmlogfile -f ${TMPBASE}/ltpfs.part6 & 141 142wait $! 143 144umount -v /dev/$part1 145mkfs -V -t jfs /dev/$part1 <yesenter.txt 146mount -v -t jfs /dev/$part1 /test/growfiles/jfs 147 148sort -R ${LTPROOT}/runtest/ltpfs.part7 -o ${TMPBASE}/ltpfs.part7 149 150${LTPROOT}/pan/pan -e -S -a ltpfspart7 -n ltpfspart7 -l lvmlogfile -f ${TMPBASE}/ltpfs.part7 & 151 152wait $! 153 154 155