diff options
author | Björn Baumbach <bb@sernet.de> | 2023-02-21 18:00:41 +0100 |
---|---|---|
committer | Björn Baumbach <bb@sernet.de> | 2023-03-03 11:58:34 +0000 |
commit | 529ef99d7c546de5a655de83a87b6de98459cc07 (patch) | |
tree | 8867e54cdf29f9f54815f3acfc530fa8fca6b464 /testprogs | |
parent | 0ea2784906241468dc5b01f0b452dd8821cd1a2f (diff) | |
download | samba-529ef99d7c546de5a655de83a87b6de98459cc07.tar.gz |
testprogs: add test for new net ads dns register --dns-ttl option
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/test_net_ads_dns.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_net_ads_dns.sh b/testprogs/blackbox/test_net_ads_dns.sh index a8a14fe234b..8a85913c68a 100755 --- a/testprogs/blackbox/test_net_ads_dns.sh +++ b/testprogs/blackbox/test_net_ads_dns.sh @@ -159,4 +159,40 @@ testit_grep_count \ dig @$SERVER +short -t aaaa $MACHINENAME.$REALM || failed=$(expr $failed + 1) +# Tests with --dns-ttl option +testit "net ads dns register with default TTL" \ + $net_tool ads dns register $MACHINENAME.$REALM $IPADDRMAC -P || + failed=$(expr $failed + 1) +TTL=$(dig @$SERVER.$REALM +noall +ttlid +answer -t A $MACHINENAME.$REALM | + awk '{ print $2 }') +testit "Verify default TTL of 3600 seconds" \ + test "$TTL" = "3600" || + failed=$(expr $failed + 1) + +testit "Update record with TTL of 60 seconds" \ + $net_tool ads dns register --dns-ttl 60 --force $MACHINENAME.$REALM $IPADDRMAC -P || + failed=$(expr $failed + 1) +TTL=$(dig @$SERVER.$REALM +noall +ttlid +answer -t A $MACHINENAME.$REALM | + awk '{ print $2 }') +testit "Verify new TTL of 60 seconds" \ + test "$TTL" = "60" || + failed=$(expr $failed + 1) + +testit "We should be able to unregister the name $MACHINENAME.$REALM $IPADDRESS" \ + $VALGRIND $net_tool ads dns unregister $MACHINENAME.$REALM -P || + failed=$(expr $failed + 1) + +testit_grep_count \ + "The name $MACHINENAME.$REALM ($IPADDRESS) should not be there any longer" \ + "$IPADDRESS" \ + 0 \ + dig @$SERVER.$REALM +short -t A $MACHINENAME.$REALM || + failed=$(expr $failed + 1) +testit_grep_count \ + "The name $MACHINENAME.$REALM ($IP6ADDRESS) should not be there any longer" \ + "$IP6ADDRESS" \ + 0 \ + dig @$SERVER.$REALM +short -t AAAA $MACHINENAME.$REALM || + failed=$(expr $failed + 1) + testok $0 $failed |