2 ###############################################################################
3 # Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
4 # Copyright (C) 2007 The Regents of the University of California.
5 # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
6 # Written by Brian Behlendorf <behlendorf1@llnl.gov>.
9 # This file is part of the SPL, Solaris Porting Layer.
10 # For details, see <http://zfsonlinux.org/>.
12 # The SPL is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # option) any later version.
17 # The SPL is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License along
23 # with the SPL. If not, see <http://www.gnu.org/licenses/>.
24 ###############################################################################
25 # This script runs the full set of regression tests.
26 ###############################################################################
29 spl_module=../module/spl/spl.ko
30 splat_module=../module/splat/splat.ko
31 splat_cmd=../cmd/splat
35 echo "${prog}: $1" >&2
40 echo "${prog}: $1" >&2
47 if [ -n "$TESTS" ]; then
53 if [ $(id -u) != 0 ]; then
54 die "Must run as root"
57 if /sbin/lsmod | egrep -q "^spl|^splat"; then
58 die "Must start with spl modules unloaded"
61 if [ ! -f ${spl_module} ] || [ ! -f ${splat_module} ]; then
62 die "Source tree must be built, run 'make'"
65 /sbin/modprobe zlib_inflate &>/dev/null
66 /sbin/modprobe zlib_deflate &>/dev/null
68 echo "Loading ${spl_module}"
69 /sbin/insmod ${spl_module} || die "Failed to load ${spl_module}"
71 echo "Loading ${splat_module}"
72 /sbin/insmod ${splat_module} || die "Unable to load ${splat_module}"
74 # Wait a maximum of 3 seconds for udev to detect the new splatctl
75 # device, if we do not see the character device file created assume
76 # udev is not running and manually create the character device.
77 for i in `seq 1 50`; do
80 if [ -c /dev/splatctl ]; then
84 if [ $i -eq 50 ]; then
85 mknod /dev/splatctl c 229 0
89 $splat_cmd $tests $verbose
91 echo "Unloading ${splat_module}"
92 /sbin/rmmod ${splat_module} || die "Failed to unload ${splat_module}"
94 echo "Unloading ${spl_module}"
95 /sbin/rmmod ${spl_module} || die "Unable to unload ${spl_module}"