Fix text failures on travis
authorBrian Brazil <brian.brazil@robustperception.io>
Tue, 27 Feb 2018 11:16:22 +0000 (11:16 +0000)
committerBrian Brazil <brian.brazil@robustperception.io>
Tue, 27 Feb 2018 11:25:35 +0000 (11:25 +0000)
prober/dns_test.go
prober/tcp_test.go

index 3f6c0239904b8e56870f01ababfa4601c04d1ce7..2e66a5d3b4fc53fb985d2068e74fec734c5b7aad 100644 (file)
@@ -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,
                },
        }
index 68da4760199d475da612c6a2a2ce1b43ae963e2a..d1afe060d234f5acedbb62d58de5d91f42c6de37 100644 (file)
@@ -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,