libnet: Fix Coverity ID 1634803 Dereference after null check
[samba4-gss.git] / source3 / script / tests / test_usernamemap.sh
blob334070ec478795f928637989240b8e3fff723950
1 #!/bin/sh
3 # Copyright (c) 2022 Pavel Filipenský <pfilipen@redhat.com>
5 # Tests for "username map" smb.conf parameter for UNIX groups
7 if [ $# -lt 2 ]; then
8 cat <<EOF
9 Usage: test_usernamemap.sh SERVER SMBCLIENT
10 EOF
11 exit 1
14 SERVER="$1"
15 SMBCLIENT="$2"
16 SMBCLIENT="${VALGRIND} ${SMBCLIENT}"
18 incdir=$(dirname "$0")/../../../testprogs/blackbox
19 . "${incdir}"/subunit.sh
21 failed=0
23 # jackthemapper is mapped to jacknomapper, so we need jacknomapper password
24 testit "jackthemapper" "${SMBCLIENT}" //"${SERVER}"/tmp -U"${SERVER}/jackthemapper%nOmApsEcrEt" -c ls || failed=$((failed + 1))
25 # jacknomapper is not mapped, so we need jacknomapper password
26 testit "jacknomapper" "${SMBCLIENT}" //"${SERVER}"/tmp -U"${SERVER}/jacknomapper%nOmApsEcrEt" -c ls || failed=$((failed + 1))
28 testok "$0" "${failed}"