summaryrefslogtreecommitdiffstats
path: root/source3/script/tests/test_usernamemap.sh
blob: 334070ec478795f928637989240b8e3fff723950 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
#
# Copyright (c) 2022 Pavel Filipenský <pfilipen@redhat.com>
#
# Tests for "username map" smb.conf parameter for UNIX groups

if [ $# -lt 2 ]; then
	cat <<EOF
Usage: test_usernamemap.sh SERVER SMBCLIENT
EOF
	exit 1
fi

SERVER="$1"
SMBCLIENT="$2"
SMBCLIENT="${VALGRIND} ${SMBCLIENT}"

incdir=$(dirname "$0")/../../../testprogs/blackbox
. "${incdir}"/subunit.sh

failed=0

# jackthemapper is mapped to jacknomapper, so we need jacknomapper password
testit "jackthemapper" "${SMBCLIENT}" //"${SERVER}"/tmp -U"${SERVER}/jackthemapper%nOmApsEcrEt" -c ls || failed=$((failed + 1))
# jacknomapper is not mapped, so we need jacknomapper password
testit "jacknomapper" "${SMBCLIENT}" //"${SERVER}"/tmp -U"${SERVER}/jacknomapper%nOmApsEcrEt" -c ls || failed=$((failed + 1))

testok "$0" "${failed}"