mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
testprogs: Add 'net rpc user' test against AD DC
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
fc4dfd73d4
commit
1e5797d19c
@ -385,6 +385,7 @@ for env in ["ad_member", "s4member", "ad_dc_ntvfs", "chgdcpass"]:
|
||||
plantestsuite("samba4.blackbox.smbclient(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "utils/tests/test_smbclient.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
|
||||
|
||||
plantestsuite("samba4.blackbox.samba_tool(ad_dc_ntvfs:local)", "ad_dc_ntvfs:local", [os.path.join(samba4srcdir, "utils/tests/test_samba_tool.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient4])
|
||||
plantestsuite("samba4.blackbox.net_rpc_user(ad_dc)", "ad_dc", [os.path.join(bbdir, "test_net_rpc_user.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN'])
|
||||
|
||||
if have_heimdal_support:
|
||||
for env in ["ad_dc_ntvfs", "ad_dc"]:
|
||||
|
56
testprogs/blackbox/test_net_rpc_user.sh
Executable file
56
testprogs/blackbox/test_net_rpc_user.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
# Blackbox tests for 'net rpc'
|
||||
#
|
||||
# Copyright (c) 2017 Andreas Schneider <asn@samba.org>
|
||||
|
||||
if [ $# -lt 4 ]; then
|
||||
cat << EOF
|
||||
Usage: net_rpc.sh SERVER ADMIN_ACCOUNT ADMIN_PASSWORD ADMIN_DOMAIN
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SERVER=$1
|
||||
ADMIN_ACCOUNT=$2
|
||||
ADMIN_PASSWORD=$3
|
||||
ADMIN_DOMAIN=$4
|
||||
shift 4
|
||||
|
||||
failed=0
|
||||
samba_bindir="$BINDIR"
|
||||
|
||||
samba_tool="$samba_bindir/samba-tool"
|
||||
net_tool="$samba_bindir/net"
|
||||
|
||||
TEST_USERNAME="$(mktemp -u samson-XXXXXX)"
|
||||
TEST_PASSWORD="Passw0rd~01"
|
||||
|
||||
newuser="$samba_tool user create"
|
||||
|
||||
. `dirname $0`/subunit.sh
|
||||
. `dirname $0`/common_test_fns.inc
|
||||
|
||||
###########################################################
|
||||
### Setup
|
||||
###########################################################
|
||||
|
||||
testit "net rpc user add" \
|
||||
$VALGRIND $net_tool rpc user add $TEST_USERNAME $TEST_PASSWORD -U$ADMIN_ACCOUNT%$ADMIN_PASSWORD -S $SERVER || failed=$(expr $failed + 1)
|
||||
|
||||
###########################################################
|
||||
### Tests
|
||||
###########################################################
|
||||
|
||||
TEST_PASSWORD_NEW="Passw0rd~02"
|
||||
|
||||
testit "net rpc user password" \
|
||||
$VALGRIND $net_tool rpc user password $TEST_USERNAME $TEST_PASSWORD_NEW -U$ADMIN_ACCOUNT%$ADMIN_PASSWORD -S $SERVER || failed=$(expr $failed + 1)
|
||||
|
||||
###########################################################
|
||||
### Teardown
|
||||
###########################################################
|
||||
|
||||
testit "net rpc user delete" \
|
||||
$VALGRIND $net_tool rpc user delete $TEST_USERNAME -U$ADMIN_ACCOUNT%$ADMIN_PASSWORD -S $SERVER || failed=$(expr $failed + 1)
|
||||
|
||||
exit $failed
|
Loading…
Reference in New Issue
Block a user