blob: 4b5309a734e6a3213f6b1d6e4dbf7a6038a74940 [file] [log] [blame]
mridgea64d3222004-02-06 16:00:20 +00001#!/bin/sh
2# This script should be run prior to running executing the filesystem tests.
3# valid devices need to be passed for Device Mapper to work correctly
4# 03/14/03 mridge@us.ibm.com added instance and time command line options
5# 05/16/03 changed script paths
6# 05/20/03 Added instructions on setup and warnings
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 ] [ -b part2 ] [ -c part3 ]
23 [ -d part4 ] [ -n nfsmount ]
24 defaults:
25 part1=$part1
26 part2=$part2
27 part3=$part3
28 part4=$part4
29 nfsmount=$nfsmount
30 ltproot=$TPROOT
31 tmpdir=$TMPBASE
32
33 example: ${0##*/} -a hdc1 -b hdc2 -c hdc3 -d hdc4 -n mytesthost:/testmountdir
34
35 fdisk needs to be run and the 4 HD partitions marked as 0x8e -- Linux LVM
36
37 - If this is run on a 2.4 kernel system then LVM must be configured and the kernel rebuilt. In a 2.5 environment
38 you must configure Device Mapper and install LVM2 from www.systina.com for the testcase to run correctly.
39
40 - These operations are destructive so do NOT point the tests to partitions where the data shouldn't be overwritten.
41 Once these tests are started all data in the partitions you point to will be destroyed.
42
43 END
44exit
45}
46
47while getopts :a:b:c:d:e:n:v: arg
48do case $arg in
49 a) part1=$OPTARG;;
50 b) part2=$OPTARG;;
51 c) part3=$OPTARG;;
52 d) part4=$OPTARG;;
53 n) nfsmount=$OPTARG;;
54 v) verb=$OPTARG;;
55
56 \?) echo "************** Help Info: ********************"
57 usage;;
58 esac
59done
60
61if [ ! -n "$part1" ]; then
62 echo "Missing 1st partition. You must pass 4 partitions for testing"
63 usage;
64 exit
65fi
66
67if [ ! -n "$part2" ]; then
68 echo "Missing 2nd partition. You must pass 4 partitions for testing"
69 usage;
70 exit
71fi
72
73if [ ! -n "$part3" ]; then
74 echo "Missing 3rd partition. You must pass 4 partitions for testing"
75 usage;
76 exit
77fi
78
79if [ ! -n "$part4" ]; then
80 echo "Missing 4th partition. You must pass 4 partitions for testing"
81 usage;
82 exit
83fi
84
85if [ ! -n "$nfsmount" ]; then
86 echo "Missing NFS partition. You must pass an NFS mount point for testing"
87 usage;
88 exit
89fi
90
91export PATH="${PATH}:${LTPROOT}/testcases/bin"
92
93
94mkdir /test >/dev/null 2>&1
95mkdir /test/growfiles >/dev/null 2>&1
96mkdir /test/growfiles/ext2 >/dev/null 2>&1
97mkdir /test/growfiles/ext3 >/dev/null 2>&1
98mkdir /test/growfiles/msdos >/dev/null 2>&1
99mkdir /test/growfiles/reiser >/dev/null 2>&1
100mkdir /test/growfiles/minix >/dev/null 2>&1
101mkdir /test/growfiles/nfs >/dev/null 2>&1
102mkdir /test/growfiles/jfs >/dev/null 2>&1
103mkdir /test/growfiles/ramdisk >/dev/null 2>&1
104
105mkfs -V -t ext2 /dev/$part1
106mkfs -V -t msdos /dev/$part2
107mkreiserfs /dev/$part3
108mkfs -V -t minix /dev/$part4
109
110
111mount -v -t nfs $nfsmount /test/growfiles/nfs
112mount -v /dev/$part1 /test/growfiles/ext2
113mount -v /dev/$part2 /test/growfiles/msdos
114mount -v /dev/$part3 /test/growfiles/reiser
115mount -v /dev/$part4 /test/growfiles/minix
116mount -v /dev/ram /test/growfiles/ramdisk
117
118echo "************ Running tests "
119${LTPROOT}/../tools/rand_lines -g ${LTPROOT}/../runtest/lvm.part1 > ${TMPBASE}/lvm.part1
120
121${LTPROOT}/../pan/pan -e -S -a lvmpart1 -n lvmpart1 -l lvmlogfile -f ${TMPBASE}/lvm.part1 &
122
123wait $!
124
125
126
127umount -v -t nfs $nfsmount
128umount -v /dev/$part1
129umount -v /dev/$part2
130umount -v /dev/$part3
131umount -v /dev/$part4
132umount -v /dev/ram
133
134mkfs -V -t ext3 /dev/$part4
135mkfs -V -t jfs /dev/$part1 <yesenter.txt
136
137mount -v -t ext3 /dev/$part4 /test/growfiles/ext3
138mount -v -t jfs /dev/$part1 /test/growfiles/jfs
139
140echo "************ Running EXT3 & JFS tests... "
141${LTPROOT}/../tools/rand_lines -g ${LTPROOT}/../runtest/lvm.part2 > ${TMPBASE}/lvm.part2
142
143${LTPROOT}/../pan/pan -e -S -a lvmpart2 -n lvmpart2 -l lvmlogfile -f ${TMPBASE}/lvm.part2 &
144
145wait $!
146
147umount -v /dev/$part1
148umount -v /dev/$part4
149
150