mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
66443fe934
Adding a test for the net share list command. Currently this command will fail because of a bug in the net command when it tries to see if rpc is supported. This change adds a known fail to swallow this error. A future commit will fix the net command and remove the known fail Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
82 lines
1.4 KiB
Bash
Executable File
82 lines
1.4 KiB
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"
|
|
|
|
# optional protocl, default to NT1
|
|
if [ $# -gt 4 ]; then
|
|
PROTOCOL="$5"
|
|
else
|
|
PROTOCOL="NT1"
|
|
fi
|
|
|
|
NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
|
|
NETTIME="${NET} --option=clientmaxprotocol=${PROTOCOL} time"
|
|
NETLOOKUP="${NET} --option=clientmaxprotocol=${PROTOCOL} lookup"
|
|
NETSHARE="${NET} -U${USERNAME}%${PASSWORD} --option=clientmaxprotocol=${PROTOCOL} -S ${SERVER} share"
|
|
|
|
incdir=`dirname $0`/../../../testprogs/blackbox
|
|
. $incdir/subunit.sh
|
|
|
|
failed=0
|
|
|
|
test_time()
|
|
{
|
|
PARAM="$1"
|
|
|
|
${NETTIME} -S ${SERVER} ${PARAM}
|
|
}
|
|
|
|
test_lookup()
|
|
{
|
|
PARAM="$1"
|
|
|
|
${NETLOOKUP} ${PARAM}
|
|
}
|
|
|
|
test_share()
|
|
{
|
|
PARAM="$1"
|
|
|
|
${NETSHARE} ${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`
|
|
|
|
# This test attempts to lookup shares
|
|
testit "lookup share list" \
|
|
test_share list || \
|
|
failed=`expr $failed + 1`
|
|
|
|
testok $0 $failed
|
|
|