aboutsummaryrefslogtreecommitdiff
path: root/plugin/test/helpers.go
diff options
context:
space:
mode:
authorGravatar slick-nic <nic@njcolledge.net> 2021-02-23 09:12:40 +0000
committerGravatar GitHub <noreply@github.com> 2021-02-23 10:12:40 +0100
commit01039312635d2577ec08f6f426fa395f0ccca392 (patch)
treeadd615081f63ba971230c8d86e517c1d108a08c0 /plugin/test/helpers.go
parentfe2b5f630d969bac5eda7b72e28f740e65778469 (diff)
downloadcoredns-01039312635d2577ec08f6f426fa395f0ccca392.tar.gz
coredns-01039312635d2577ec08f6f426fa395f0ccca392.tar.zst
coredns-01039312635d2577ec08f6f426fa395f0ccca392.zip
Rewrite SRV targets and additional names in response (#4287)
* Rewrite plugin - rewrite SRV targets and names in response answer and additional records Signed-off-by: Nic Colledge <nic@njcolledge.net> * Added README content to describe new behaviour Signed-off-by: Nic Colledge <nic@njcolledge.net> * Added more record types to rewrite handling based on PR/Issue feedback Signed-off-by: Nic Colledge <nic@njcolledge.net> * Updated README.md for plugin Signed-off-by: Nic Colledge <nic@njcolledge.net> * Updated unit tests. Small refactor of getTarget... function. Signed-off-by: Nic Colledge <nic@njcolledge.net> * Refactor to add response value rewrite as answer value option Signed-off-by: Nic Colledge <nic@njcolledge.net> * Removed TODO comment, added test for NAPTR record. Signed-off-by: Nic Colledge <nic@njcolledge.net>
Diffstat (limited to 'plugin/test/helpers.go')
-rw-r--r--plugin/test/helpers.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/test/helpers.go b/plugin/test/helpers.go
index fa89f9218..0c7e85f2a 100644
--- a/plugin/test/helpers.go
+++ b/plugin/test/helpers.go
@@ -99,6 +99,9 @@ func DNSKEY(rr string) *dns.DNSKEY { r, _ := dns.NewRR(rr); return r.(*dns.DNSKE
// DS returns a DS record from rr. It panics on errors.
func DS(rr string) *dns.DS { r, _ := dns.NewRR(rr); return r.(*dns.DS) }
+// NAPTR returns a NAPTR record from rr. It panics on errors.
+func NAPTR(rr string) *dns.NAPTR { r, _ := dns.NewRR(rr); return r.(*dns.NAPTR) }
+
// OPT returns an OPT record with UDP buffer size set to bufsize and the DO bit set to do.
func OPT(bufsize int, do bool) *dns.OPT {
o := new(dns.OPT)