2008-09-08 08:18:04 +04:00
#!/bin/sh
2010-10-24 06:27:26 +04:00
# Blackbox tests for samba-tool
2008-09-08 08:18:04 +04:00
SERVER = $1
2011-11-24 00:05:54 +04:00
SERVER_IP = $2
USERNAME = $3
PASSWORD = $4
DOMAIN = $5
2012-05-30 14:04:30 +04:00
smbclient = $6
shift 6
2008-09-08 08:18:04 +04:00
failed = 0
2011-04-15 06:41:22 +04:00
samba4bindir = " $BINDIR "
2012-01-26 02:42:27 +04:00
samba_tool = " $samba4bindir /samba-tool "
2008-09-08 08:18:04 +04:00
2022-02-23 14:04:57 +03:00
testit( )
{
2008-09-08 08:18:04 +04:00
name = " $1 "
shift
cmdline = " $* "
echo " test: $name "
$cmdline
status = $?
if [ x$status = x0 ] ; then
echo " success: $name "
else
echo " failure: $name "
2022-02-23 14:04:57 +03:00
failed = $( expr $failed + 1)
2008-09-08 08:18:04 +04:00
fi
return $status
}
2019-12-09 21:11:41 +03:00
testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER /tmp --machine-pass
2008-09-08 08:18:04 +04:00
2019-12-09 21:11:41 +03:00
testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER /tmp --machine-pass -k
2008-09-08 08:18:04 +04:00
2022-06-13 16:27:58 +03:00
testit "time" $VALGRIND $PYTHON $samba_tool time $SERVER $CONFIGURATION -W " $DOMAIN " -U" $USERNAME % $PASSWORD " " $@ "
2008-09-08 08:18:04 +04:00
2018-11-16 22:32:31 +03:00
testit "domain level.show" $VALGRIND $PYTHON $samba_tool domain level show
2011-11-24 00:05:54 +04:00
2018-11-16 22:32:31 +03:00
testit "domain info" $VALGRIND $PYTHON $samba_tool domain info $SERVER_IP
2008-09-08 08:18:04 +04:00
2018-11-16 22:32:31 +03:00
testit "fsmo show" $VALGRIND $PYTHON $samba_tool fsmo show
2012-02-18 00:24:48 +04:00
2010-04-09 01:41:08 +04:00
exit $failed