libnet: Fix Coverity ID 1634803 Dereference after null check
[samba4-gss.git] / source3 / script / tests / test_smbclient_machine_auth.sh
blobc89f84892e751e22d98ca5918b84a7249d676e0d
1 #!/bin/sh
3 # this runs the file serving tests that are expected to pass with samba3 against shares with various options
5 if [ $# -lt 2 ]; then
6 cat <<EOF
7 Usage: test_smbclient_machine_auth.sh SERVER SMBCLIENT CONFIGURATION <smbclient arguments>
8 EOF
9 exit 1
12 SERVER="$1"
13 SMBCLIENT="$2"
14 # This is used by test_smbclient()
15 # shellcheck disable=2034
16 CONFIGURATION="${3}"
17 shift 3
18 ADDARGS="$*"
20 # This is used by test_smbclient()
21 # shellcheck disable=2034
22 smbclient="${VALGRIND} ${SMBCLIENT}"
24 incdir="$(dirname "${0}")/../../../testprogs/blackbox"
25 . "${incdir}/subunit.sh"
26 . "${incdir}/common_test_fns.inc"
28 failed=0
30 test_smbclient "smbclient //${SERVER}/tmp" \
31 "quit" "//${SERVER}/tmp" --machine-pass -p 139 "${ADDARGS}" || \
32 failed=$((failed + 1))
34 # Testing these here helps because we know the machine account isn't already
35 # this user/group.
36 test_smbclient "smbclient //${SERVER}/forceuser" \
37 "quit" "//${SERVER}/forceuser" --machine-pass -p 139 "${ADDARGS}" || \
38 failed=$((failed + 1))
40 test_smbclient "smbclient //${SERVER}/forcegroup" \
41 "quit" "//${SERVER}/forcegroup" --machine-pass -p 139 "${ADDARGS}" || \
42 failed=$((failed + 1))
44 exit ${failed}