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