Skip to content

Commit

Permalink
Merge pull request #297 from prometheus/fix-travis
Browse files Browse the repository at this point in the history
Fix text failures on travis
  • Loading branch information
brian-brazil authored Feb 27, 2018
2 parents 4ed7f83 + 624a7e4 commit af83465
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
58 changes: 37 additions & 21 deletions prober/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"},
Expand All @@ -98,15 +101,17 @@ func TestRecursiveDNSResponse(t *testing.T) {
},
{
config.DNSProbe{
QueryName: "example.com",
PreferredIPProtocol: "ipv4",
QueryName: "example.com",
ValidateAuthority: config.DNSRRValidator{
FailIfMatchesRegexp: []string{".*7200.*"},
},
}, true,
},
{
config.DNSProbe{
QueryName: "example.com",
PreferredIPProtocol: "ipv4",
QueryName: "example.com",
ValidateAdditional: config.DNSRRValidator{
FailIfNotMatchesRegexp: []string{".*3600.*"},
},
Expand Down Expand Up @@ -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.*"},
Expand All @@ -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.*"},
Expand All @@ -219,23 +228,26 @@ func TestAuthoritativeDNSResponse(t *testing.T) {
},
{
config.DNSProbe{
QueryName: "example.com",
PreferredIPProtocol: "ipv4",
QueryName: "example.com",
ValidateAuthority: config.DNSRRValidator{
FailIfNotMatchesRegexp: []string{"ns.*.isp.net"},
},
}, true,
},
{
config.DNSProbe{
QueryName: "example.com",
PreferredIPProtocol: "ipv4",
QueryName: "example.com",
ValidateAdditional: config.DNSRRValidator{
FailIfNotMatchesRegexp: []string{"^ns.*.isp"},
},
}, true,
},
{
config.DNSProbe{
QueryName: "example.com",
PreferredIPProtocol: "ipv4",
QueryName: "example.com",
ValidateAdditional: config.DNSRRValidator{
FailIfMatchesRegexp: []string{"^ns.*.isp"},
},
Expand Down Expand Up @@ -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,
},
}
Expand Down
3 changes: 2 additions & 1 deletion prober/tcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit af83465

Please sign in to comment.