aboutsummaryrefslogtreecommitdiff
path: root/plugin/dns64/dns64_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/dns64/dns64_test.go')
-rw-r--r--plugin/dns64/dns64_test.go45
1 files changed, 22 insertions, 23 deletions
diff --git a/plugin/dns64/dns64_test.go b/plugin/dns64/dns64_test.go
index 54d63439a..a294721dc 100644
--- a/plugin/dns64/dns64_test.go
+++ b/plugin/dns64/dns64_test.go
@@ -74,7 +74,6 @@ func TestRequestShouldIntercept(t *testing.T) {
}
func TestTo6(t *testing.T) {
-
v6, err := To6("64:ff9b::/96", "64.64.64.64")
if err != nil {
t.Error(err)
@@ -216,7 +215,7 @@ func TestDNS64(t *testing.T) {
RecursionDesired: true,
Opcode: dns.OpcodeQuery,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
initResp: &dns.Msg{ //success, no answers
MsgHdr: dns.MsgHdr{
@@ -226,7 +225,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 70 IN SOA foo bar 1 1 1 1 1")},
},
aResp: &dns.Msg{
@@ -237,7 +236,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.A("example.com. 60 IN A 192.0.2.42"),
test.A("example.com. 5000 IN A 192.0.2.43"),
@@ -252,7 +251,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.AAAA("example.com. 60 IN AAAA 64:ff9b::192.0.2.42"),
// override RR ttl to SOA ttl, since it's lower
@@ -269,7 +268,7 @@ func TestDNS64(t *testing.T) {
RecursionDesired: true,
Opcode: dns.OpcodeQuery,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
initResp: &dns.Msg{ //success, no answers
MsgHdr: dns.MsgHdr{
@@ -279,7 +278,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 3600 IN SOA foo bar 1 7200 900 1209600 86400")},
},
aResp: &dns.Msg{
@@ -290,7 +289,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 3600 IN SOA foo bar 1 7200 900 1209600 86400")},
},
@@ -302,7 +301,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 3600 IN SOA foo bar 1 7200 900 1209600 86400")},
Answer: []dns.RR{}, // just to make comparison happy
},
@@ -316,7 +315,7 @@ func TestDNS64(t *testing.T) {
RecursionDesired: true,
Opcode: dns.OpcodeQuery,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
initResp: &dns.Msg{ // failure
MsgHdr: dns.MsgHdr{
@@ -326,7 +325,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeRefused,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
aResp: &dns.Msg{
MsgHdr: dns.MsgHdr{
@@ -336,7 +335,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.A("example.com. 60 IN A 192.0.2.42"),
test.A("example.com. 5000 IN A 192.0.2.43"),
@@ -351,7 +350,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.AAAA("example.com. 60 IN AAAA 64:ff9b::192.0.2.42"),
test.AAAA("example.com. 600 IN AAAA 64:ff9b::192.0.2.43"),
@@ -367,7 +366,7 @@ func TestDNS64(t *testing.T) {
RecursionDesired: true,
Opcode: dns.OpcodeQuery,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
initResp: &dns.Msg{ // failure
MsgHdr: dns.MsgHdr{
@@ -377,7 +376,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeNameError,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 3600 IN SOA foo bar 1 7200 900 1209600 86400")},
},
resp: &dns.Msg{
@@ -388,7 +387,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeNameError,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 3600 IN SOA foo bar 1 7200 900 1209600 86400")},
},
},
@@ -401,7 +400,7 @@ func TestDNS64(t *testing.T) {
RecursionDesired: true,
Opcode: dns.OpcodeQuery,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
initResp: &dns.Msg{
@@ -412,7 +411,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.AAAA("example.com. 60 IN AAAA ::1"),
test.AAAA("example.com. 5000 IN AAAA ::2"),
@@ -427,7 +426,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.AAAA("example.com. 60 IN AAAA ::1"),
test.AAAA("example.com. 5000 IN AAAA ::2"),
@@ -443,7 +442,7 @@ func TestDNS64(t *testing.T) {
RecursionDesired: true,
Opcode: dns.OpcodeQuery,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
},
initResp: &dns.Msg{ //success, no answers
MsgHdr: dns.MsgHdr{
@@ -453,7 +452,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Ns: []dns.RR{test.SOA("example.com. 70 IN SOA foo bar 1 1 1 1 1")},
},
aResp: &dns.Msg{
@@ -465,7 +464,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.A("example.com. 60 IN A 192.0.2.42"),
test.A("example.com. 5000 IN A 192.0.2.43"),
@@ -481,7 +480,7 @@ func TestDNS64(t *testing.T) {
Rcode: dns.RcodeSuccess,
Response: true,
},
- Question: []dns.Question{{"example.com.", dns.TypeAAAA, dns.ClassINET}},
+ Question: []dns.Question{{Name: "example.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET}},
Answer: []dns.RR{
test.AAAA("example.com. 60 IN AAAA 64:ff9b::192.0.2.42"),
// override RR ttl to SOA ttl, since it's lower