1 #!/usr/bin/ksh
2
3 #
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
8 #
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
12 #
13
14 #
15 # Copyright (c) 2012 by Delphix. All rights reserved.
16 #
17
18 #
19 # Define necessary environments and config variables here
20 # prior to invoking the test runner
21 #
22
23 export STF_SUITE="/opt/smbclient-tests"
24 export STF_TOOLS="/opt/test-runner/stf"
25 runner="/opt/test-runner/bin/run"
26
27 runfile=$STF_SUITE/runfiles/default.run
28
29 PATH=/usr/bin:/usr/sbin:/sbin:$STF_SUITE/bin:$PATH
30 export PATH
31
32 while getopts 'c:fqs:' c; do
33 case $c in
34 'c')
35 runfile=$OPTARG
36 ;;
37 'f')
38 export STC_QUICK=1
39 ;;
40 'q')
41 quiet='-q'
42 ;;
43 's')
44 export SRV=$OPTARG
45 ;;
46 esac
47 done
48 shift $((OPTIND - 1))
49
50 . $STF_SUITE/include/default_cfg.ksh
51
52 [[ -n "$SRV" ]] || { echo "$0 -s SERVER required"; exit 1; }
53
54 # Allow relative runfiles for convenience.
55 if [[ ! -r "$runfile" && -r "$STF_SUITE/runfiles/$runfile" ]]
56 then
57 runfile="$STF_SUITE/runfiles/$runfile"
58 fi
59 [[ -r $runfile ]] || { echo "$0 Cannot read file: $runfile"; exit 1; }
60
61 $runner $quiet -c $runfile
62
63 exit $?