update test descriptions to make more sense

pull/21950/head
John Murret 5 days ago
parent 16e024100a
commit a1d9d43849

@ -474,7 +474,7 @@ func TestAgent_Services_ACLFilter(t *testing.T) {
require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs")) require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs"))
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req, _ := http.NewRequest("GET", "/v1/agent/services?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil) req, _ := http.NewRequest("GET", "/v1/agent/services?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil)
resp := httptest.NewRecorder() resp := httptest.NewRecorder()
a.srv.h.ServeHTTP(resp, req) a.srv.h.ServeHTTP(resp, req)
@ -1525,7 +1525,7 @@ func TestAgent_Checks_ACLFilter(t *testing.T) {
require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs")) require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs"))
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req, _ := http.NewRequest("GET", "/v1/agent/checks?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil) req, _ := http.NewRequest("GET", "/v1/agent/checks?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil)
resp := httptest.NewRecorder() resp := httptest.NewRecorder()
a.srv.h.ServeHTTP(resp, req) a.srv.h.ServeHTTP(resp, req)
@ -2254,7 +2254,7 @@ func TestAgent_Members_ACLFilter(t *testing.T) {
require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs")) require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs"))
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req, _ := http.NewRequest("GET", "/v1/agent/members?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil) req, _ := http.NewRequest("GET", "/v1/agent/members?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil)
resp := httptest.NewRecorder() resp := httptest.NewRecorder()
a.srv.h.ServeHTTP(resp, req) a.srv.h.ServeHTTP(resp, req)

@ -1450,7 +1450,7 @@ func TestCatalog_ListNodes_ACLFilter(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
var reply structs.IndexedNodes var reply structs.IndexedNodes
args = structs.DCSpecificRequest{ args = structs.DCSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
@ -3081,7 +3081,7 @@ func TestCatalog_ListServices_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req := structs.DCSpecificRequest{ req := structs.DCSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
QueryOptions: structs.QueryOptions{ QueryOptions: structs.QueryOptions{
@ -3204,7 +3204,7 @@ func TestCatalog_ServiceNodes_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
opt = structs.ServiceSpecificRequest{ opt = structs.ServiceSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
ServiceName: "foo", ServiceName: "foo",
@ -3346,7 +3346,7 @@ func TestCatalog_NodeServices_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req := structs.NodeSpecificRequest{ req := structs.NodeSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
Node: srv.config.NodeName, Node: srv.config.NodeName,
@ -3425,7 +3425,7 @@ func TestCatalog_NodeServicesList_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req := structs.NodeSpecificRequest{ req := structs.NodeSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
Node: srv.config.NodeName, Node: srv.config.NodeName,

@ -865,7 +865,7 @@ operator = "read"
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
args = structs.ConfigEntryQuery{ args = structs.ConfigEntryQuery{
Kind: structs.ServiceDefaults, Kind: structs.ServiceDefaults,
Datacenter: s1.config.Datacenter, Datacenter: s1.config.Datacenter,

@ -1566,7 +1566,7 @@ func TestHealth_NodeChecks_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
opt := structs.NodeSpecificRequest{ opt := structs.NodeSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
Node: srv.config.NodeName, Node: srv.config.NodeName,
@ -1678,7 +1678,7 @@ func TestHealth_ServiceChecks_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
opt := structs.ServiceSpecificRequest{ opt := structs.ServiceSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
ServiceName: "foo", ServiceName: "foo",
@ -1780,7 +1780,7 @@ func TestHealth_ServiceNodes_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
opt := structs.ServiceSpecificRequest{ opt := structs.ServiceSpecificRequest{
Datacenter: "dc1", Datacenter: "dc1",
ServiceName: "foo", ServiceName: "foo",
@ -1867,7 +1867,7 @@ func TestHealth_ChecksInState_FilterACL(t *testing.T) {
require.True(t, reply.ResultsFilteredByACLs) require.True(t, reply.ResultsFilteredByACLs)
}) })
t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) {
req := structs.ChecksInStateRequest{ req := structs.ChecksInStateRequest{
Datacenter: "dc1", Datacenter: "dc1",
State: api.HealthPassing, State: api.HealthPassing,

Loading…
Cancel
Save