Skip to content
Snippets Groups Projects
Commit a6bbeb41 authored by ale's avatar ale
Browse files

use fqdns in test requests

parent 28a91ab0
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,7 @@ func testQueryA(t testing.TB, withNode bool, query, expected string) {
func TestDNSRedirector_AAAA(t *testing.T) {
q := new(dns.Msg)
q.SetQuestion("stream.example.com", dns.TypeAAAA)
q.SetQuestion("stream.example.com.", dns.TypeAAAA)
response := doTestQuery(t, true, q)
answer, ok := response.Answer[0].(*dns.AAAA)
......@@ -128,7 +128,7 @@ func TestDNSRedirector_AAAA(t *testing.T) {
func TestDNSRedirector_NXDOMAIN(t *testing.T) {
q := new(dns.Msg)
q.SetQuestion("nonexisting.example.com", dns.TypeA)
q.SetQuestion("nonexisting.example.com.", dns.TypeA)
response := doTestQuery(t, false, q)
if response.MsgHdr.Rcode != dns.RcodeNameError {
t.Fatalf("expected NXDOMAIN, got: %s", response)
......@@ -137,7 +137,7 @@ func TestDNSRedirector_NXDOMAIN(t *testing.T) {
func TestDNSRedirector_NXDOMAIN_WrongZone(t *testing.T) {
q := new(dns.Msg)
q.SetQuestion("foo.bar.com", dns.TypeA)
q.SetQuestion("foo.bar.com.", dns.TypeA)
response := doTestQuery(t, false, q)
if response.MsgHdr.Rcode != dns.RcodeNameError {
t.Fatalf("expected NXDOMAIN, got: %s", response)
......@@ -146,7 +146,7 @@ func TestDNSRedirector_NXDOMAIN_WrongZone(t *testing.T) {
func TestDNSRedirector_SRV_Etcd(t *testing.T) {
q := new(dns.Msg)
q.SetQuestion("_etcd-server._tcp.example.com", dns.TypeSRV)
q.SetQuestion("_etcd-server._tcp.example.com.", dns.TypeSRV)
response := doTestQuery(t, false, q)
if len(response.Answer) != 1 {
t.Fatalf("expected 1 answer, got: %s", response)
......@@ -165,7 +165,7 @@ func TestDNSRedirector_SRV_Etcd(t *testing.T) {
func TestDNSRedirector_SRV_Etcd_BadScheme(t *testing.T) {
q := new(dns.Msg)
q.SetQuestion("_etcd-server-ssl._tcp.example.com", dns.TypeSRV)
q.SetQuestion("_etcd-server-ssl._tcp.example.com.", dns.TypeSRV)
response := doTestQuery(t, false, q)
if response.MsgHdr.Rcode != dns.RcodeNameError {
t.Fatalf("expected NXDOMAIN, got: %s", response)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment