Skip to content

Commit 741072e

Browse files
Merge pull request #623 from kuiwang02/enhancewn
OCPQE-31553:adjust watchnamespace qe case based on change
2 parents 5345f83 + de7b6b4 commit 741072e

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

openshift/tests-extension/test/qe/specs/olmv1_ce_watchns.go

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
249249
ceNoConfig.Delete(oc)
250250
e2e.Logf("Scenario 2-1 cleanup: ClusterExtension deleted")
251251

252-
g.By("Scenario 2-2: Empty string watchNamespace - expect AllNamespaces mode success")
252+
g.By("Scenario 2-2: Empty string watchNamespace - expect minLength validation error")
253253
e2e.Logf("Testing ClusterExtension with {All,Own,Single} InstallModes and empty watchNamespace")
254-
e2e.Logf("Expected behavior: Empty watchNamespace defaults to AllNamespaces mode")
254+
e2e.Logf("Expected behavior: Empty watchNamespace violates minLength constraint and fails validation")
255255
ceEmptyString := olmv1util.ClusterExtensionDescription{
256256
Name: "ce-" + caseID + "-empty",
257257
PackageName: "nginx-ok-v85543",
@@ -264,12 +264,13 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
264264
Template: clusterextensionConfigTemplate,
265265
}
266266
defer ceEmptyString.Delete(oc)
267-
// For {All,Own,Single} InstallModes, empty string defaults to AllNamespaces mode
268-
ceEmptyString.Create(oc)
267+
_ = ceEmptyString.CreateWithoutCheck(oc)
268+
// Empty string violates minLength: 1 validation
269+
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "minimum length of 1", 3, 60, 0)
269270
// Print full ClusterExtension resource for manual test documentation
270271
e2e.Logf("=== ClusterExtension EmptyString resource ===")
271272
_ = oc.AsAdmin().WithoutNamespace().Run("get").Args("clusterextension", ceEmptyString.Name, "-o", "yaml").Execute()
272-
e2e.Logf("PASS: Scenario 2-2 passed: ClusterExtension with empty watchNamespace installed successfully in AllNamespaces mode")
273+
e2e.Logf("PASS: Scenario 2-2 passed: ClusterExtension with empty watchNamespace correctly rejected with minLength validation error")
273274
ceEmptyString.Delete(oc)
274275
e2e.Logf("Scenario 2-2 cleanup: ClusterExtension deleted")
275276

@@ -407,7 +408,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
407408
ceNoConfig.Delete(oc)
408409
e2e.Logf("Scenario 3-1 cleanup: ClusterExtension deleted")
409410

410-
g.By("Scenario 3-2: Empty string watchNamespace - expect validation error")
411+
g.By("Scenario 3-2: Empty string watchNamespace - expect minLength validation error")
411412
e2e.Logf("Testing ClusterExtension with {Own,Single} InstallModes and empty watchNamespace")
412413
ceEmptyString := olmv1util.ClusterExtensionDescription{
413414
Name: "ce-" + caseID + "-empty",
@@ -422,12 +423,12 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
422423
}
423424
defer ceEmptyString.Delete(oc)
424425
_ = ceEmptyString.CreateWithoutCheck(oc)
425-
// Empty string is a supported field but invalid value (DNS format validation)
426-
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "invalid", 3, 60, 0)
426+
// Empty string violates minLength: 1 validation
427+
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "minimum length of 1", 3, 60, 0)
427428
// Print full ClusterExtension resource for manual test documentation
428429
e2e.Logf("=== ClusterExtension EmptyString resource ===")
429430
_ = oc.AsAdmin().WithoutNamespace().Run("get").Args("clusterextension", ceEmptyString.Name, "-o", "yaml").Execute()
430-
e2e.Logf("PASS: Scenario 3-2 passed: ClusterExtension with empty watchNamespace correctly rejected with validation error")
431+
e2e.Logf("PASS: Scenario 3-2 passed: ClusterExtension with empty watchNamespace correctly rejected with minLength validation error")
431432
ceEmptyString.Delete(oc)
432433
e2e.Logf("Scenario 3-2 cleanup: ClusterExtension deleted")
433434

@@ -568,7 +569,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
568569
ceNoConfig.Delete(oc)
569570
e2e.Logf("Scenario 5-1 cleanup: ClusterExtension deleted")
570571

571-
g.By("Scenario 5-2: watchNamespace is empty string - expect DNS validation error")
572+
g.By("Scenario 5-2: watchNamespace is empty string - expect minLength validation error")
572573
e2e.Logf("Testing ClusterExtension with {Single} InstallMode and watchNamespace=''")
573574
ceEmptyString := olmv1util.ClusterExtensionDescription{
574575
Name: "ce-" + caseID + "-empty",
@@ -583,11 +584,12 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
583584
}
584585
defer ceEmptyString.Delete(oc)
585586
_ = ceEmptyString.CreateWithoutCheck(oc)
586-
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "invalid", 3, 60, 0)
587+
// Empty string violates minLength: 1 validation
588+
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "minimum length of 1", 3, 60, 0)
587589
// Print full ClusterExtension resource for manual test documentation
588590
e2e.Logf("=== ClusterExtension EmptyString resource ===")
589591
_ = oc.AsAdmin().WithoutNamespace().Run("get").Args("clusterextension", ceEmptyString.Name, "-o", "yaml").Execute()
590-
e2e.Logf("PASS: Scenario 5-2 passed: Got expected DNS validation error for empty string")
592+
e2e.Logf("PASS: Scenario 5-2 passed: Got expected minLength validation error for empty string")
591593
ceEmptyString.Delete(oc)
592594
e2e.Logf("Scenario 5-2 cleanup: ClusterExtension deleted")
593595

@@ -733,9 +735,9 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
733735
ceNoConfig.Delete(oc)
734736
e2e.Logf("Scenario 4-1 cleanup: ClusterExtension deleted")
735737

736-
g.By("Scenario 4-2: watchNamespace is empty string - expect DNS validation error")
738+
g.By("Scenario 4-2: watchNamespace is empty string - expect OwnNamespace mode validation error")
737739
e2e.Logf("Testing ClusterExtension with {Own} InstallMode and watchNamespace=''")
738-
e2e.Logf("Expected behavior: watchNamespace field should be supported with DNS validation")
740+
e2e.Logf("Expected behavior: Empty watchNamespace violates OwnNamespace mode requirement (must equal install namespace)")
739741
ceEmptyString := olmv1util.ClusterExtensionDescription{
740742
Name: "ce-" + caseID + "-empty",
741743
PackageName: "nginx-ok-v85549",
@@ -749,12 +751,12 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension watchNamespace config
749751
}
750752
defer ceEmptyString.Delete(oc)
751753
_ = ceEmptyString.CreateWithoutCheck(oc)
752-
// Empty string should fail with DNS validation error
753-
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "invalid", 3, 60, 0)
754+
// For OwnNamespace-only bundles, empty string violates the business logic that watchNamespace must equal install namespace
755+
ceEmptyString.CheckClusterExtensionCondition(oc, "Progressing", "message", "is not valid ownNamespaceInstallMode", 3, 60, 0)
754756
// Print full ClusterExtension resource for manual test documentation
755757
e2e.Logf("=== ClusterExtension EmptyString resource ===")
756758
_ = oc.AsAdmin().WithoutNamespace().Run("get").Args("clusterextension", ceEmptyString.Name, "-o", "yaml").Execute()
757-
e2e.Logf("PASS: Scenario 4-2 passed: ClusterExtension with empty watchNamespace correctly rejected with validation error")
759+
e2e.Logf("PASS: Scenario 4-2 passed: ClusterExtension with empty watchNamespace correctly rejected with OwnNamespace mode validation error")
758760
ceEmptyString.Delete(oc)
759761
e2e.Logf("Scenario 4-2 cleanup: ClusterExtension deleted")
760762

0 commit comments

Comments
 (0)