s4:kdc: Implement KDC plugin hardware authentication policy
[samba.git] / source3 / script / tests / test_rpcclient_lookup.sh
1 #!/bin/sh
2 #
3 # Blackbox tests for the rpcclient LSA lookup commands
4 #
5 # Copyright (C) 2020 Christof Schmitt
6
7 if [ $# -lt 4 ]; then
8         cat <<EOF
9 Usage: test_rpcclient_lookup.sh USERNAME PASSWORD SERVER RPCCLIENT
10 EOF
11         exit 1
12 fi
13
14 USERNAME="$1"
15 PASSWORD="$2"
16 SERVER="$3"
17 RPCCLIENT="$4"
18
19 RPCCLIENTCMD="$RPCCLIENT $SERVER -U$USERNAME%$PASSWORD"
20
21 incdir=$(dirname $0)/../../../testprogs/blackbox
22 . $incdir/subunit.sh
23
24 failed=0
25
26 $RPCCLIENTCMD -c "lookupsids S-1-1-0"
27 RC=$?
28 testit "lookupsids" test $RC -eq 0 || failed=$(expr $failed + 1)
29
30 $RPCCLIENTCMD -c "lookupsids_level 1 S-1-1-0"
31 RC=$?
32 testit "lookupsids_level" test $RC -eq 0 || failed=$(expr $failed + 1)
33
34 $RPCCLIENTCMD -c "lookupnames Everyone"
35 RC=$?
36 testit "lookupnames" test $RC -eq 0 || failed=$(expr $failed + 1)
37
38 $RPCCLIENTCMD -c "lookupnames_level 1 Everyone"
39 RC=$?
40 testit "lookupnames_level" test $RC -eq 0 || failed=$(expr $failed + 1)
41
42 testok $0 $failed