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 (at] us.ibm.com added instance and time command line options 5 # 6 # 7 8 cd `dirname $0` 9 export LTPROOT=${PWD} 10 echo $LTPROOT | grep testscripts > /dev/null 2>&1 11 if [ $? -eq 0 ]; then 12 cd .. 13 export LTPROOT=${PWD} 14 fi 15 16 export TMPBASE="/tmp" 17 18 19 usage() 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 37 exit 38 } 39 40 while getopts :a:n:v: arg 41 do case $arg in 42 a) part1=$OPTARG;; 43 n) nfsmount=$OPTARG;; 44 v) verb=$OPTARG;; 45 46 \?) echo "************** Help Info: ********************" 47 usage;; 48 esac 49 done 50 51 if [ ! -n "$part1" ]; then 52 echo "Missing 1st partition. You must pass 4 partitions for testing" 53 usage; 54 exit 55 fi 56 57 if [ ! -n "$nfsmount" ]; then 58 echo "Missing NFS partition. You must pass an NFS mount point for testing" 59 usage; 60 exit 61 fi 62 63 export PATH="${PATH}:${LTPROOT}/testcases/bin" 64 65 66 mkdir /test >/dev/null 2>&1 67 mkdir /test/growfiles >/dev/null 2>&1 68 mkdir /test/growfiles/ext2 >/dev/null 2>&1 69 mkdir /test/growfiles/msdos >/dev/null 2>&1 70 mkdir /test/growfiles/reiser >/dev/null 2>&1 71 mkdir /test/growfiles/minix >/dev/null 2>&1 72 mkdir /test/growfiles/xfs >/dev/null 2>&1 73 mkdir /test/growfiles/nfs >/dev/null 2>&1 74 mkdir /test/growfiles/jfs >/dev/null 2>&1 75 mkdir /test/growfiles/ext3 >/dev/null 2>&1 76 77 78 mkfs -V -t ext2 /dev/$part1 79 80 81 mount -v -t nfs $nfsmount /test/growfiles/nfs 82 mount -v /dev/$part1 /test/growfiles/ext2 83 84 85 echo "************ Running tests " 86 sort -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 90 wait $! 91 92 umount -v -t nfs $nfsmount 93 umount -v /dev/$part1 94 mkfs.xfs -f /dev/$part1 95 mount -v /dev/$part1 /test/growfiles/xfs 96 97 98 sort -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 102 wait $! 103 104 mkfs -V -t msdos /dev/$part1 105 umount -v /dev/$part1 106 mount -v /dev/$part1 /test/growfiles/msdos 107 108 sort -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 112 wait $! 113 114 umount -v /dev/$part1 115 mkreiserfs /dev/$part1 <yesenter.txt 116 mount -v /dev/$part1 /test/growfiles/reiser 117 118 sort -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 122 wait $! 123 124 umount -v /dev/$part1 125 mkfs -V -t minix /dev/$part1 126 mount -v /dev/$part1 /test/growfiles/minix 127 128 sort -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 132 wait $! 133 134 umount -v /dev/$part1 135 mkfs -V -t ext3 /dev/$part1 136 mount -v /dev/$part1 /test/growfiles/ext3 137 138 sort -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 142 wait $! 143 144 umount -v /dev/$part1 145 mkfs -V -t jfs /dev/$part1 <yesenter.txt 146 mount -v -t jfs /dev/$part1 /test/growfiles/jfs 147 148 sort -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 152 wait $! 153 154 155