xref: /illumos-gate/usr/src/test/smbclient-tests/cmd/scripts/smbclienttest.ksh (revision 6e6545bfaed3bab9ce836ee82d1abd8f2edba89a)
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
23export STF_SUITE="/opt/smbclient-tests"
24export STF_TOOLS="/opt/test-runner/stf"
25runner="/opt/test-runner/bin/run"
26
27runfile=$STF_SUITE/runfiles/default.run
28
29PATH=/usr/bin:/usr/sbin:/sbin:$STF_SUITE/bin:$PATH
30export PATH
31
32while 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
47done
48shift $((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.
55if [[ ! -r "$runfile" && -r "$STF_SUITE/runfiles/$runfile" ]]
56then
57    runfile="$STF_SUITE/runfiles/$runfile"
58fi
59[[ -r $runfile ]] || { echo "$0 Cannot read file: $runfile"; exit 1; }
60
61$runner $quiet -c $runfile
62
63exit $?
64