1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/testprogs/blackbox/test_net_ads_search_server.sh
Stefan Metzmacher 3b585f9e8c testprogs/blackbox: add test_net_ads_search_server.sh
This reproduces a regression with
'net ads search -P --server server.of.trusted.domain'

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15323

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2023-04-06 12:51:30 +00:00

38 lines
743 B
Bash
Executable File

#!/bin/sh
if [ $# -lt 2 ]; then
cat <<EOF
Usage: $0 SERVER REALM
EOF
exit 1;
fi
SERVER=$1
REALM=$2
shift 2
failed=0
. `dirname $0`/subunit.sh
samba_net="$BINDIR/net"
DN=$(echo "${REALM}" | tr '[:upper:]' '[:lower:]' | sed -e 's!^!DC=!' -e 's!\.!,DC=!g')
testit_grep_count \
"net_ads_search.ntlmssp" \
"distinguishedName: ${DN}" \
1 \
$samba_net ads search --use-kerberos=off -P \
--server "${SERVER}.${REALM}" \
'(objectClass=domain)' distinguishedName || \
failed=$((failed + 1))
testit_grep_count \
"net_ads_search.krb5" \
"distinguishedName: ${DN}" \
1 \
$samba_net ads search --use-kerberos=required -P \
--server "${SERVER}.${REALM}" \
'(objectClass=domain)' distinguishedName || \
failed=$((failed + 1))
exit $failed