VM: simplify slab allocator
[minix.git] / test / blocktest / support.sh
blobeb3dc431c3ace9fbc12176da36ab32fcfd4c0a61
1 # Supporting routines for blocktest. Do not run directly.
3 # usage: devtopair /dev/cXdY..
4 # returns a label, minor pair in the form "label=at_wini_N,minor=M"
5 devtopair() {
6 label=`awk "/^$(stat -f '%Hr' $1) / "'{print $2}' /proc/dmap`
7 if [ ! -z "$label" ]; then echo "label=$label,minor=`stat -f '%Lr' $1`"; fi
10 # usage: block_test /dev/cXdY.. "params,for,blocktest"
11 # runs the blocktest driver on the given device with the given parameters
12 block_test() {
13 if [ ! -x blocktest ]; then echo "compile blocktest first!" >&2; exit 1; fi
14 if [ ! -b "$1" ]; then echo "$1 is not a block device" >&2; exit 1; fi
15 pair=$(devtopair $1)
16 if [ -z "$pair" ]; then echo "driver not found for $1" >&2; exit 1; fi
17 service up `pwd`/blocktest -args "$pair,$2" -config system.conf \
18 -script /etc/rs.single -label blocktest_$(stat -f '%r' $1)