Skip to content

Commit

Permalink
Remove suite.SupportReferenceGrant as the default value of SupportedF…
Browse files Browse the repository at this point in the history
…eatures and remove suite.SupportReferenceGrant from Features list on all tests.

Signed-off-by: Huang Xin <[email protected]>
  • Loading branch information
gyohuangxin committed Sep 28, 2022
1 parent 0bfc24a commit c7c0164
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func init() {
var GatewaySecretInvalidReferenceGrant = suite.ConformanceTest{
ShortName: "GatewaySecretInvalidReferenceGrant",
Description: "A Gateway in the gateway-conformance-infra namespace should fail to become ready if the Gateway has a certificateRef for a Secret in the gateway-conformance-web-backend namespace and a ReferenceGrant exists but does not grant permission to that specific Secret",
Features: []suite.SupportedFeature{suite.SupportReferenceGrant},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/gateway-secret-invalid-reference-grant.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
gwNN := types.NamespacedName{Name: "gateway-secret-invalid-reference-grant", Namespace: "gateway-conformance-infra"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func init() {
var GatewaySecretMissingReferenceGrant = suite.ConformanceTest{
ShortName: "GatewaySecretMissingReferenceGrant",
Description: "A Gateway in the gateway-conformance-infra namespace should fail to become ready if the Gateway has a certificateRef for a Secret in the gateway-conformance-web-backend namespace and a ReferenceGrant granting permission to the Secret does not exist",
Features: []suite.SupportedFeature{suite.SupportReferenceGrant},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/gateway-secret-missing-reference-grant.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
gwNN := types.NamespacedName{Name: "gateway-secret-missing-reference-grant", Namespace: "gateway-conformance-infra"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func init() {
var GatewaySecretReferenceGrantAllInNamespace = suite.ConformanceTest{
ShortName: "GatewaySecretReferenceGrantAllInNamespace",
Description: "A Gateway in the gateway-conformance-infra namespace should become ready if the Gateway has a certificateRef for a Secret in the gateway-conformance-web-backend namespace and a ReferenceGrant granting permission to all Secrets in the namespace exists",
Features: []suite.SupportedFeature{suite.SupportReferenceGrant},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/gateway-secret-reference-grant-all-in-namespace.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
gwNN := types.NamespacedName{Name: "gateway-secret-reference-grant", Namespace: "gateway-conformance-infra"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func init() {
var GatewaySecretReferenceGrantSpecific = suite.ConformanceTest{
ShortName: "GatewaySecretReferenceGrantSpecific",
Description: "A Gateway in the gateway-conformance-infra namespace should become ready if the Gateway has a certificateRef for a Secret in the gateway-conformance-web-backend namespace and a ReferenceGrant granting permission to the specific Secret exists",
Features: []suite.SupportedFeature{suite.SupportReferenceGrant},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/gateway-secret-reference-grant-specific.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
gwNN := types.NamespacedName{Name: "gateway-secret-reference-grant", Namespace: "gateway-conformance-infra"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ func init() {
var HTTPRouteInvalidCrossNamespaceBackendRef = suite.ConformanceTest{
ShortName: "HTTPRouteInvalidCrossNamespaceBackendRef",
Description: "A single HTTPRoute in the gateway-conformance-infra namespace should set a ResolvedRefs status False with reason RefNotPermitted when attempting to bind to a Gateway in the same namespace if the route has a BackendRef Service in the gateway-conformance-web-backend namespace and a ReferenceGrant granting permission to route to that Service does not exist",
Exemptions: []suite.ExemptFeature{
suite.ExemptReferenceGrant,
},
Manifests: []string{"tests/httproute-invalid-cross-namespace-backend-ref.yaml"},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/httproute-invalid-cross-namespace-backend-ref.yaml"},
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
routeNN := types.NamespacedName{Name: "invalid-cross-namespace-backend-ref", Namespace: "gateway-conformance-infra"}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: "gateway-conformance-infra"}
Expand Down
6 changes: 2 additions & 4 deletions conformance/tests/httproute-invalid-reference-grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ func init() {
var HTTPRouteInvalidReferenceGrant = suite.ConformanceTest{
ShortName: "HTTPRouteInvalidReferenceGrant",
Description: "A single HTTPRoute in the gateway-conformance-infra namespace should fail to attach to a Gateway in the same namespace if the route has a backendRef Service in the gateway-conformance-app-backend namespace and a ReferenceGrant exists but does not grant permission to route to that specific Service",
Features: []suite.SupportedFeature{
suite.SupportReferenceGrant,
},
Manifests: []string{"tests/httproute-invalid-reference-grant.yaml"},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/httproute-invalid-reference-grant.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
routeNN := types.NamespacedName{Name: "invalid-reference-grant", Namespace: "gateway-conformance-infra"}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: "gateway-conformance-infra"}
Expand Down
6 changes: 2 additions & 4 deletions conformance/tests/httproute-reference-grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ func init() {
var HTTPRouteReferenceGrant = suite.ConformanceTest{
ShortName: "HTTPRouteReferenceGrant",
Description: "A single HTTPRoute in the gateway-conformance-infra namespace, with a backendRef in the gateway-conformance-web-backend namespace, should attach to Gateway in the gateway-conformance-infra namespace",
Features: []suite.SupportedFeature{
suite.SupportReferenceGrant,
},
Manifests: []string{"tests/httproute-reference-grant.yaml"},
Exemptions: []suite.ExemptFeature{suite.ExemptReferenceGrant},
Manifests: []string{"tests/httproute-reference-grant.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
routeNN := types.NamespacedName{Name: "reference-grant", Namespace: "gateway-conformance-infra"}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: "gateway-conformance-infra"}
Expand Down
2 changes: 1 addition & 1 deletion conformance/utils/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ var (
GatewayClassName = flag.String("gateway-class", "gateway-conformance", "Name of GatewayClass to use for tests")
ShowDebug = flag.Bool("debug", false, "Whether to print debug logs")
CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run")
SupportedFeatures = flag.String("supported-features", "SupportReferenceGrant", "Supported features included in conformance tests suites")
SupportedFeatures = flag.String("supported-features", "", "Supported features included in conformance tests suites")
ExemptFeatures = flag.String("exempt-features", "", "Exempt Features excluded from conformance tests suites")
)
3 changes: 0 additions & 3 deletions conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ const (
type SupportedFeature string

const (
// This option indicates support for the ReferenceGrant object.
SupportReferenceGrant SupportedFeature = "ReferenceGrant"

// This option indicates support for HTTPRoute query param matching (extended conformance).
SupportHTTPRouteQueryParamMatching SupportedFeature = "HTTPRouteQueryParamMatching"

Expand Down

0 comments on commit c7c0164

Please sign in to comment.