• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# This script should be run to execute the filesystem tests on SCSI vitual devices.
3# 10/21/03 mridge@us.ibm.com Initial creation of testcases
4#
5#
6
7cd `dirname $0`
8export LTPROOT=${PWD}
9echo $LTPROOT | grep testscripts > /dev/null 2>&1
10if [ $? -eq 0 ]; then
11 cd ..
12 export LTPROOT=${PWD}
13fi
14
15export TMPBASE="/tmp"
16
17
18usage()
19{
20	cat <<-END >&2
21	usage: ${0##*/} [ -a part1 ] [ -b part2 ] [ -k Kernel Path - fully qualified kernel path ]
22	defaults:
23
24        There are no defaults, all items MUST be passed
25
26	example: ${0##*/} -a sda -b sdb -k /usr/src/linux
27
28        - These tests must be run after ssi_debug has been configured and built as a module so it can be loaded with
29          the correct parameters.
30
31        - These operations are destructive so do NOT point the tests to partitions where the data shouldn't be overwritten.
32        Once these tests are started all data in the partitions you point to will be destroyed.
33
34	END
35exit
36}
37
38while getopts :a:b:c:k: arg
39do      case $arg in
40		a)	part1=$OPTARG;;
41                b)      part2=$OPTARG;;
42                c)      part3=$OPTARG;;
43                k)      kernpath=$OPTARG;;
44
45                \?)     echo "************** Help Info: ********************"
46                        usage;;
47        esac
48done
49
50if [ ! -n "$part1"  ]; then
51  echo "Missing 1st partition. You must pass 2 partitions for testing"
52  usage;
53  exit
54fi
55
56if [ ! -n "$part2" ]; then
57  echo "Missing 2nd partition. You must pass 2 partitions for testing"
58  usage;
59  exit
60fi
61
62if [ ! -n "$part3" ]; then
63  echo "Missing 3rd partition. You must pass 3 partitions for testing"
64  usage;
65  exit
66fi
67
68if [ ! -n "$kernpath" ]; then
69  echo "Missing kernel path. You must pass kernel path for testing"
70  usage;
71  exit
72fi
73
74export PATH="${PATH}:${LTPROOT}/testcases/bin"
75
76
77mkdir /test                   >/dev/null 2>&1
78mkdir /test/growfiles         >/dev/null 2>&1
79mkdir /test/growfiles/scsi    >/dev/null 2>&1
80mkdir /test/growfiles/scsi/ext2    >/dev/null 2>&1
81mkdir /test/growfiles/scsi/ext3    >/dev/null 2>&1
82mkdir /test/growfiles/scsi/reiser  >/dev/null 2>&1
83
84
85mkfs -V -t ext2     /dev/$part1 <yesenter.txt
86mkfs -V -t ext3     /dev/$part2 <yesenter.txt
87mkreiserfs -f       /dev/$part3 <yesenter.txt
88
89
90mount -v -t ext2 /dev/$part1       /test/growfiles/scsi/ext2
91mount -v -t ext3 /dev/$part2       /test/growfiles/scsi/ext3
92mount -v /dev/$part3               /test/growfiles/scsi/reiser
93
94cd $kernpath/drivers/scsi
95modprobe scsi_debug max_luns=2 num_tgts=7 add_host=10
96cd ${LTPROOT}
97
98echo "************ Running tests "
99sort -R ${LTPROOT}/runtest/scsi.part1 -o ${TMPBASE}/scsi.part1
100
101${LTPROOT}/pan/pan -e -S -a scsipart1 -n scsipart1 -l scsilogfile -f ${TMPBASE}/scsi.part1 &
102
103wait $!
104
105umount -v /dev/$part1
106umount -v /dev/$part2
107umount -v /dev/$part3
108rmmod scsi_debug
109
110
111
112