Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / test / smbclient-tests / cmd / scripts / smbclienttest.ksh
blob68f3ce371cf08e38e68968ab3dc43808218bd091
1 #!/usr/bin/ksh
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.
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.
15 # Copyright (c) 2012 by Delphix. All rights reserved.
19 # Define necessary environments and config variables here
20 # prior to invoking the test runner
23 export STF_SUITE="/opt/smbclient-tests"
24 export STF_TOOLS="/opt/test-runner/stf"
25 runner="/opt/test-runner/bin/run"
27 runfile=$STF_SUITE/runfiles/default.run
29 PATH=/usr/bin:/usr/sbin:/sbin:$STF_SUITE/bin:$PATH
30 export PATH
32 while getopts 'c:fqs:' c; do
33 case $c in
34 'c')
35 runfile=$OPTARG
37 'f')
38 export STC_QUICK=1
40 'q')
41 quiet='-q'
43 's')
44 export SRV=$OPTARG
46 esac
47 done
48 shift $((OPTIND - 1))
50 . $STF_SUITE/include/default_cfg.ksh
52 [[ -n "$SRV" ]] || { echo "$0 -s SERVER required"; exit 1; }
54 # Allow relative runfiles for convenience.
55 if [[ ! -r "$runfile" && -r "$STF_SUITE/runfiles/$runfile" ]]
56 then
57 runfile="$STF_SUITE/runfiles/$runfile"
59 [[ -r $runfile ]] || { echo "$0 Cannot read file: $runfile"; exit 1; }
61 $runner $quiet -c $runfile
63 exit $?