1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/nsswitch/tests/test_wbinfo_name_lookup.sh
Andreas Schneider 0aceca6a94 nsswitch: Add a test looking up domain sid
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13369

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2018-05-11 09:07:36 +02:00

50 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# Blackbox test for wbinfo name lookup
if [ $# -lt 2 ]; then
cat <<EOF
Usage: test_wbinfo.sh DOMAIN DC_USERNAME
EOF
exit 1;
fi
DOMAIN=$1
REALM=$2
DC_USERNAME=$3
shift 3
failed=0
sambabindir="$BINDIR"
wbinfo="$VALGRIND $sambabindir/wbinfo"
. `dirname $0`/../../testprogs/blackbox/subunit.sh
# Correct query is expected to work
testit "name-to-sid.single-separator" \
$wbinfo -n $DOMAIN/$DC_USERNAME || \
failed=$(expr $failed + 1)
testit "name-to-sid.at_domain" \
$wbinfo -n $DOMAIN/ || \
failed=$(expr $failed + 1)
testit "name-to-sid.upn" \
$wbinfo -n $DC_USERNAME@$REALM || \
failed=$(expr $failed + 1)
# Two separator characters should fail
testit_expect_failure "name-to-sid.double-separator" \
$wbinfo -n $DOMAIN//$DC_USERNAME || \
failed=$(expr $failed + 1)
# Invalid domain is expected to fail
testit_expect_failure "name-to-sid.invalid-domain" \
$wbinfo -n INVALID/$DC_USERNAME || \
failed=$(expr $failed + 1)
# Invalid domain with two separator characters is expected to fail
testit_expect_failure "name-to-sid.double-separator-invalid-domain" \
$wbinfo -n INVALID//$DC_USERNAME || \
failed=$(expr $failed + 1)
exit $failed