From 624a7e4501005857ae025efbc42ced46e524e948 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Tue, 27 Feb 2018 11:16:22 +0000 Subject: [PATCH] Fix text failures on travis --- prober/dns_test.go | 58 +++++++++++++++++++++++++++++----------------- prober/tcp_test.go | 3 ++- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/prober/dns_test.go b/prober/dns_test.go index 3f6c023..2e66a5d 100644 --- a/prober/dns_test.go +++ b/prober/dns_test.go @@ -78,18 +78,21 @@ func TestRecursiveDNSResponse(t *testing.T) { }{ { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", }, true, }, { config.DNSProbe{ - QueryName: "example.com", - ValidRcodes: []string{"SERVFAIL", "NXDOMAIN"}, + PreferredIPProtocol: "ipv4", + QueryName: "example.com", + ValidRcodes: []string{"SERVFAIL", "NXDOMAIN"}, }, false, }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAnswer: config.DNSRRValidator{ FailIfMatchesRegexp: []string{".*7200.*"}, FailIfNotMatchesRegexp: []string{".*3600.*"}, @@ -98,7 +101,8 @@ func TestRecursiveDNSResponse(t *testing.T) { }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAuthority: config.DNSRRValidator{ FailIfMatchesRegexp: []string{".*7200.*"}, }, @@ -106,7 +110,8 @@ func TestRecursiveDNSResponse(t *testing.T) { }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAdditional: config.DNSRRValidator{ FailIfNotMatchesRegexp: []string{".*3600.*"}, }, @@ -190,18 +195,21 @@ func TestAuthoritativeDNSResponse(t *testing.T) { }{ { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", }, true, }, { config.DNSProbe{ - QueryName: "example.com", - ValidRcodes: []string{"SERVFAIL", "NXDOMAIN"}, + PreferredIPProtocol: "ipv4", + QueryName: "example.com", + ValidRcodes: []string{"SERVFAIL", "NXDOMAIN"}, }, false, }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAnswer: config.DNSRRValidator{ FailIfMatchesRegexp: []string{".*3600.*"}, FailIfNotMatchesRegexp: []string{".*3600.*"}, @@ -210,7 +218,8 @@ func TestAuthoritativeDNSResponse(t *testing.T) { }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAnswer: config.DNSRRValidator{ FailIfMatchesRegexp: []string{".*7200.*"}, FailIfNotMatchesRegexp: []string{".*7200.*"}, @@ -219,7 +228,8 @@ func TestAuthoritativeDNSResponse(t *testing.T) { }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAuthority: config.DNSRRValidator{ FailIfNotMatchesRegexp: []string{"ns.*.isp.net"}, }, @@ -227,7 +237,8 @@ func TestAuthoritativeDNSResponse(t *testing.T) { }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAdditional: config.DNSRRValidator{ FailIfNotMatchesRegexp: []string{"^ns.*.isp"}, }, @@ -235,7 +246,8 @@ func TestAuthoritativeDNSResponse(t *testing.T) { }, { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", ValidateAdditional: config.DNSRRValidator{ FailIfMatchesRegexp: []string{"^ns.*.isp"}, }, @@ -277,25 +289,29 @@ func TestServfailDNSResponse(t *testing.T) { }{ { config.DNSProbe{ - QueryName: "example.com", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", }, false, }, { config.DNSProbe{ - QueryName: "example.com", - ValidRcodes: []string{"SERVFAIL", "NXDOMAIN"}, + PreferredIPProtocol: "ipv4", + QueryName: "example.com", + ValidRcodes: []string{"SERVFAIL", "NXDOMAIN"}, }, true, }, { config.DNSProbe{ - QueryName: "example.com", - QueryType: "NOT_A_VALID_QUERY_TYPE", + PreferredIPProtocol: "ipv4", + QueryName: "example.com", + QueryType: "NOT_A_VALID_QUERY_TYPE", }, false, }, { config.DNSProbe{ - QueryName: "example.com", - ValidRcodes: []string{"NOT_A_VALID_RCODE"}, + PreferredIPProtocol: "ipv4", + QueryName: "example.com", + ValidRcodes: []string{"NOT_A_VALID_RCODE"}, }, false, }, } diff --git a/prober/tcp_test.go b/prober/tcp_test.go index 68da476..d1afe06 100644 --- a/prober/tcp_test.go +++ b/prober/tcp_test.go @@ -129,7 +129,8 @@ func TestTCPConnectionWithTLS(t *testing.T) { // Expect name-verified TLS connection. module := config.Module{ TCP: config.TCPProbe{ - TLS: true, + PreferredIPProtocol: "ipv4", + TLS: true, TLSConfig: pconfig.TLSConfig{ CAFile: tmpCaFile.Name(), InsecureSkipVerify: false, -- 2.25.1