mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	up coverage
This commit is contained in:
		| @@ -13,28 +13,18 @@ func TestParseRequest(t *testing.T) { | |||||||
|  |  | ||||||
| 	tests := []struct { | 	tests := []struct { | ||||||
| 		query    string | 		query    string | ||||||
| 		qtype    uint16 |  | ||||||
| 		expected string // output from r.String() | 		expected string // output from r.String() | ||||||
| 	}{ | 	}{ | ||||||
| 		{ | 		// valid SRV request | ||||||
| 			// valid SRV request | 		{"_http._tcp.webs.mynamespace.svc.inter.webs.test.", "http.tcp..webs.mynamespace.svc"}, | ||||||
| 			"_http._tcp.webs.mynamespace.svc.inter.webs.test.", dns.TypeSRV, | 		// wildcard acceptance | ||||||
| 			"http.tcp..webs.mynamespace.svc", | 		{"*.any.*.any.svc.inter.webs.test.", "*.any..*.any.svc"}, | ||||||
| 		}, | 		// A request of endpoint | ||||||
| 		{ | 		{"1-2-3-4.webs.mynamespace.svc.inter.webs.test.", "*.*.1-2-3-4.webs.mynamespace.svc"}, | ||||||
| 			// wildcard acceptance |  | ||||||
| 			"*.any.*.any.svc.inter.webs.test.", dns.TypeSRV, |  | ||||||
| 			"*.any..*.any.svc", |  | ||||||
| 		}, |  | ||||||
| 		{ |  | ||||||
| 			// A request of endpoint |  | ||||||
| 			"1-2-3-4.webs.mynamespace.svc.inter.webs.test.", dns.TypeA, |  | ||||||
| 			"*.*.1-2-3-4.webs.mynamespace.svc", |  | ||||||
| 		}, |  | ||||||
| 	} | 	} | ||||||
| 	for i, tc := range tests { | 	for i, tc := range tests { | ||||||
| 		m := new(dns.Msg) | 		m := new(dns.Msg) | ||||||
| 		m.SetQuestion(tc.query, tc.qtype) | 		m.SetQuestion(tc.query, dns.TypeA) | ||||||
| 		state := request.Request{Zone: zone, Req: m} | 		state := request.Request{Zone: zone, Req: m} | ||||||
|  |  | ||||||
| 		r, e := k.parseRequest(state) | 		r, e := k.parseRequest(state) | ||||||
| @@ -52,8 +42,8 @@ func TestParseInvalidRequest(t *testing.T) { | |||||||
| 	k := New([]string{zone}) | 	k := New([]string{zone}) | ||||||
|  |  | ||||||
| 	invalid := []string{ | 	invalid := []string{ | ||||||
| 		"webs.mynamespace.pood.inter.webs.test.",                // Request must be for pod or svc subdomain. | 		"webs.mynamespace.pood.inter.webs.test.",                 // Request must be for pod or svc subdomain. | ||||||
| 		"too.long.for.what.I.am.trying.to.do.inter.webs.tests.", // Too long. | 		"too.long.for.what.I.am.trying.to.pod.inter.webs.tests.", // Too long. | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	for i, query := range invalid { | 	for i, query := range invalid { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user