@@ -24,12 +24,12 @@ import (
24
24
"open-cluster-management.io/config-policy-controller/test/utils"
25
25
)
26
26
27
- var _ = FDescribe ("Testing OperatorPolicy" , Ordered , Label ("supports-hosted" ), func () {
27
+ var _ = Describe ("Testing OperatorPolicy" , Ordered , Label ("supports-hosted" ), func () {
28
28
const (
29
29
opPolTestNS = "operator-policy-testns"
30
30
parentPolicyYAML = "../resources/case38_operator_install/parent-policy.yaml"
31
31
parentPolicyName = "parent-policy"
32
- eventuallyTimeout = 120
32
+ eventuallyTimeout = 90
33
33
consistentlyDuration = 5
34
34
olmWaitTimeout = 60
35
35
)
@@ -3451,7 +3451,7 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
3451
3451
const (
3452
3452
opPolYAML = "../resources/case38_operator_install/operator-policy-no-group-enforce.yaml"
3453
3453
opPolName = "oppol-no-group-enforce"
3454
- subName = "project-quay "
3454
+ subName = "example-operator "
3455
3455
)
3456
3456
3457
3457
scenarioTriggered := true
@@ -3649,10 +3649,11 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
3649
3649
const (
3650
3650
opPolYAML = "../resources/case38_operator_install/operator-policy-no-group-enforce.yaml"
3651
3651
opPolName = "oppol-no-group-enforce"
3652
- latestQuay310 = "quay -operator.v3.10.7 "
3652
+ latestExample = "example -operator.v0.0.3 "
3653
3653
)
3654
3654
3655
- BeforeEach (func () {
3655
+ // The first 'It' test is a prerequisite for the second 'It' test.
3656
+ BeforeAll (func () {
3656
3657
preFunc ()
3657
3658
3658
3659
createObjWithParent (parentPolicyYAML , parentPolicyName ,
@@ -3662,7 +3663,7 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
3662
3663
It ("Should start compliant" , func (ctx SpecContext ) {
3663
3664
Eventually (func (ctx SpecContext ) (map [string ]interface {}, error ) {
3664
3665
csv , err := targetK8sDynamic .Resource (gvrClusterServiceVersion ).Namespace (opPolTestNS ).
3665
- Get (ctx , latestQuay310 , metav1.GetOptions {})
3666
+ Get (ctx , latestExample , metav1.GetOptions {})
3666
3667
3667
3668
if csv == nil || err != nil {
3668
3669
return map [string ]interface {}{}, err
@@ -3710,17 +3711,17 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
3710
3711
APIVersion : "operators.coreos.com/v1alpha1" ,
3711
3712
Metadata : policyv1.ObjectMetadata {
3712
3713
Namespace : opPolTestNS ,
3713
- Name : latestQuay310 ,
3714
+ Name : latestExample ,
3714
3715
},
3715
3716
},
3716
3717
Compliant : "NonCompliant" ,
3717
- Reason : "ClusterServiceVersion (" + latestQuay310 + ") is not an approved version" ,
3718
+ Reason : "ClusterServiceVersion (" + latestExample + ") is not an approved version" ,
3718
3719
}},
3719
3720
metav1.Condition {
3720
3721
Type : "ClusterServiceVersionCompliant" ,
3721
3722
Status : metav1 .ConditionFalse ,
3722
3723
Reason : "UnapprovedVersion" ,
3723
- Message : "ClusterServiceVersion (" + latestQuay310 + ") is not an approved version" ,
3724
+ Message : "ClusterServiceVersion (" + latestExample + ") is not an approved version" ,
3724
3725
},
3725
3726
"ClusterServiceVersion .* is not an approved version" ,
3726
3727
)
0 commit comments