File: disktest

package info (click to toggle)
pcopy 1.5-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 160 kB
  • ctags: 74
  • sloc: ansic: 402; sh: 186; makefile: 77
file content (55 lines) | stat: -rwxr-xr-x 937 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/ksh
#
# Start parallell streaming read tests on multiple disks
# When used with the "-a" option, autodetect all disks on a specific
# controller, for example: disktest -a c0
#
# Author: Peter Eriksson <pen@lysator.liu.se>, 2003-12-02
#

# Modify the path below...
PCOPY=/usr/local/bin/pcopy

if [ "$1" = "-a" ]; then
    shift

    if [ "$1" = "" ]; then
	MATCH="c"
    else
	MATCH="$1"
    fi
    DISKS="`( echo 0 ; echo quit ) | (format 2>/dev/null) | fgrep \". ${MATCH}\" | awk '{printf \"%ss2 \", $2}'`"

elif [ "$1" != "" ]; then
    DISKS="$*"

else
    echo "Usage: disktest [-a] disks"
    exit 1
fi

n=0

onintr() {
	echo "\n*** INTERRUPT recevied - aborting...\c"
	pkill -P $$
	wait
	echo " Done."
	exit 1
}

trap onintr INT

echo "Starting concurrent test on: $DISKS"

while true; do
	(( n = n + 1 ))
	for D in $DISKS; do
		$PCOPY -s /dev/rdsk/$D /dev/null &
	done
	echo "Pass $n started at `date`"
	wait
done

exit 0