1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
samba-mirror/source3/script/tests/test_net_misc.sh
Andrew Bartlett 28ad50e5fd s3-selftest: Set path to bin/net and bin/wbinfo in command line to test scripts
This makes it easier to reproduce these tests outside the test
environment, as we rely less on environment variables.

Andrew Bartlett
2011-09-12 20:42:22 +10:00

63 lines
942 B
Bash
Executable File

#!/bin/sh
# various tests for the "net" command
if [ $# -lt 3 ]; then
cat <<EOF
Usage: test_net_misc.sh SCRIPTDIR SERVERCONFFILE NET CONFIGURATION
EOF
exit 1;
fi
SCRIPTDIR="$1"
SERVERCONFFILE="$2"
NET="$3"
CONFIGURATION="$4"
NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
NETTIME="${NET} time"
NETLOOKUP="${NET} lookup"
incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
failed=0
test_time()
{
PARAM="$1"
${NETTIME} -S ${SERVER} ${PARAM}
}
test_lookup()
{
PARAM="$1"
${NETLOOKUP} ${PARAM}
}
testit "get the time" \
test_time || \
failed=`expr $failed + 1`
testit "get the system time" \
test_time system || \
failed=`expr $failed + 1`
testit "get the time zone" \
test_time zone || \
failed=`expr $failed + 1`
testit "lookup the PDC" \
test_lookup pdc || \
failed=`expr $failed + 1`
testit "lookup the master browser" \
test_lookup master || \
failed=`expr $failed + 1`
testok $0 $failed