-
Notifications
You must be signed in to change notification settings - Fork 923
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple tests for pdnsutil add-record behaviour.
- Loading branch information
1 parent
9c91e07
commit 9902887
Showing
9 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
# This one is redirected to /dev/null to hide the "local files have been | ||
# created" message if using lmdb as backend. | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
create-zone bug.less > /dev/null 2>&1 | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
add-record bug.less cname CNAME host 2>&1 | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
add-record bug.less host A 127.0.0.1 2>&1 | ||
# Duplicate records should be omitted | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
add-record bug.less host2 A 127.0.0.2 127.0.0.2 2>&1 | ||
# Can't add non-CNAME record to a CNAME record | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
add-record bug.less cname A 127.0.0.1 2>&1 | ||
# Can't add CNAME record if other records exist | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
add-record bug.less host CNAME host2 2>&1 | ||
# Adding existing record should ignore duplicates | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
add-record bug.less host2 A 127.0.0.2 127.0.0.3 2>&1 | ||
|
||
# Display zone contents for final verification | ||
$PDNSUTIL --config-dir=. --config-name=$backend \ | ||
list-zone bug.less 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This test checks various pdnsutil behaviour when editing zone contents. |
18 changes: 18 additions & 0 deletions
18
regression-tests/tests/pdnsutil-zone-handling/expected_result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
New rrset: | ||
cname.bug.less. 3600 IN CNAME host | ||
New rrset: | ||
host.bug.less. 3600 IN A 127.0.0.1 | ||
Ignoring duplicate record content "127.0.0.2" | ||
New rrset: | ||
host2.bug.less. 3600 IN A 127.0.0.2 | ||
Attempting to add record to cname.bug.less which already has a CNAME record | ||
Attempting to add CNAME to host.bug.less which already has existing records | ||
New rrset: | ||
host2.bug.less. 3600 IN A 127.0.0.2 | ||
host2.bug.less. 3600 IN A 127.0.0.3 | ||
$ORIGIN . | ||
bug.less 3600 IN SOA a.misconfigured.dns.server.invalid hostmaster.bug.less 0 10800 3600 604800 3600 | ||
cname.bug.less 3600 IN CNAME host. | ||
host.bug.less 3600 IN A 127.0.0.1 | ||
host2.bug.less 3600 IN A 127.0.0.2 | ||
host2.bug.less 3600 IN A 127.0.0.3 |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.