1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
samba-mirror/source3/script/tests/test_net_lookup.sh
Andreas Schneider 4c02eb4df3 s3:script: Fix shellcheck errors in test_net_lookup.sh
source3/script/tests/test_net_lookup.sh:37:9: error: Remove spaces
around = to assign (or use [ ] to compare, or quote '=' if literal).
[SC2283]

Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-08-22 14:20:36 +00:00

55 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
if [ $# != 6 ]; then
echo "Usage: $0 SERVER USERNAME PASSWORD NET SAMBA-TOOL DNS-ZONE"
exit 1
fi
SERVER="$1"
shift 1
USERNAME="$1"
shift 1
PASSWORD="$1"
shift 1
NET="$1"
shift 1
SAMBATOOL="$1"
shift 1
DNSZONE="$1"
shift 1
SITE="mysite"
incdir=$(dirname $0)/../../../testprogs/blackbox
. $incdir/subunit.sh
failed=0
$SAMBATOOL dns add "$SERVER" -U "$USERNAME"%"$PASSWORD" \
_msdcs."$DNSZONE" _ldap._tcp."$SITE"._sites.dc \
SRV "mydc.$DNSZONE 389 100 100"
$SAMBATOOL dns add "$SERVER" -U "$USERNAME"%"$PASSWORD" \
"$DNSZONE" mydc \
A "1.2.3.4"
# global lookup
testit_grep global 10.53.57.30:389 $NET lookup ldap "$DNSZONE" ||
failed=$(expr $failed + 1)
# correct site-aware lookup
testit_grep site-aware 1.2.3.4:389 $NET lookup ldap "$DNSZONE" "$SITE" ||
failed=$(expr $failed + 1)
# lookup with nonexisting site -- global fallback
testit_grep global 10.53.57.30:389 $NET lookup ldap "$DNSZONE" nosite ||
failed=$(expr $failed + 1)
$SAMBATOOL dns delete "$SERVER" -U "$USERNAME"%"$PASSWORD" \
"$DNSZONE" mydc \
A "1.2.3.4"
$SAMBATOOL dns delete "$SERVER" -U "$USERNAME"%"$PASSWORD" \
_msdcs."$DNSZONE" _ldap._tcp."$SITE"._sites.dc \
SRV "mydc.$DNSZONE 389 100 100"
testok $0 $failed