2 # Blackbox tests for 'net rpc'
4 # Copyright (c) 2017 Andreas Schneider <asn@samba.org>
8 Usage: net_rpc.sh SERVER ADMIN_ACCOUNT ADMIN_PASSWORD ADMIN_DOMAIN
20 samba_bindir
="$BINDIR"
22 samba_tool
="$samba_bindir/samba-tool"
23 net_tool
="$samba_bindir/net"
25 TEST_USERNAME
="$(mktemp -u samson-XXXXXX)"
26 TEST_PASSWORD
="Passw0rd~01"
28 newuser
="$samba_tool user create"
30 .
`dirname $0`/subunit.sh
31 .
`dirname $0`/common_test_fns.inc
33 ###########################################################
35 ###########################################################
37 testit
"net rpc user add" \
38 $VALGRIND $net_tool rpc user add
$TEST_USERNAME $TEST_PASSWORD -U$ADMIN_ACCOUNT%$ADMIN_PASSWORD -S $SERVER || failed
=$
(expr $failed + 1)
40 ###########################################################
42 ###########################################################
44 TEST_PASSWORD_NEW
="Passw0rd~02"
46 testit
"net rpc user password" \
47 $VALGRIND $net_tool rpc user password
$TEST_USERNAME $TEST_PASSWORD_NEW -U$ADMIN_ACCOUNT%$ADMIN_PASSWORD -S $SERVER || failed
=$
(expr $failed + 1)
49 ###########################################################
51 ###########################################################
53 testit
"net rpc user delete" \
54 $VALGRIND $net_tool rpc user delete
$TEST_USERNAME -U$ADMIN_ACCOUNT%$ADMIN_PASSWORD -S $SERVER || failed
=$
(expr $failed + 1)