@@ -7,17 +7,17 @@ import (
7
7
8
8
"github.com/onsi/gomega/gcustom"
9
9
types2 "github.com/onsi/gomega/types"
10
- tunedutils "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/tuned"
10
+ // tunedutils "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/tuned"
11
11
12
12
. "github.com/onsi/ginkgo/v2"
13
13
. "github.com/onsi/gomega"
14
14
corev1 "k8s.io/api/core/v1"
15
- nodev1 "k8s.io/api/node/v1"
15
+ // nodev1 "k8s.io/api/node/v1"
16
16
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
17
17
"k8s.io/apimachinery/pkg/runtime"
18
18
"k8s.io/apimachinery/pkg/types"
19
19
utilrand "k8s.io/apimachinery/pkg/util/rand"
20
- "sigs.k8s.io/controller-runtime/pkg/client"
20
+ // "sigs.k8s.io/controller-runtime/pkg/client"
21
21
22
22
ign2types "github.com/coreos/ignition/config/v2_2/types"
23
23
machineconfigv1 "github.com/openshift/api/machineconfiguration/v1"
@@ -28,11 +28,12 @@ import (
28
28
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/discovery"
29
29
hypershiftutils "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/hypershift"
30
30
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/label"
31
- "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/mcps"
31
+ // "github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/mcps"
32
32
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/nodepools"
33
33
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/nodes"
34
34
"github.com/openshift/cluster-node-tuning-operator/test/e2e/performanceprofile/functests/utils/profiles"
35
35
v1 "github.com/openshift/custom-resource-status/conditions/v1"
36
+ "github.com/openshift/cluster-node-tuning-operator/test/e2e/util"
36
37
)
37
38
38
39
var _ = Describe ("Status testing of performance profile" , Ordered , func () {
@@ -53,68 +54,68 @@ var _ = Describe("Status testing of performance profile", Ordered, func() {
53
54
})
54
55
55
56
Context ("[rfe_id:28881][performance] Performance Addons detailed status" , Label (string (label .Tier1 )), func () {
56
- It ("[test_id:30894] Tuned status name tied to Performance Profile" , func () {
57
- profile , err := profiles .GetByNodeLabels (testutils .NodeSelectorLabels )
58
- Expect (err ).ToNot (HaveOccurred ())
59
- tunedList := & tunedv1.TunedList {}
60
- tunedName , err := tunedutils .GetName (context .TODO (), testclient .ControlPlaneClient , profile .Name )
61
- Expect (err ).ToNot (HaveOccurred ())
62
- tunedNamespacedName := types.NamespacedName {
63
- Name : tunedName ,
64
- Namespace : components .NamespaceNodeTuningOperator ,
65
- }
66
- // on hypershift platform, we're getting the tuned object that was mirrored by NTO to the hosted cluster,
67
- // hence we're using the DataPlaneClient here.
68
- Eventually (func (g Gomega ) {
69
- g .Expect (testclient .DataPlaneClient .List (context .TODO (), tunedList , & client.ListOptions {
70
- Namespace : tunedNamespacedName .Namespace ,
71
- })).To (Succeed ())
72
- Expect (tunedList .Items ).To (MatchTunedName (tunedName ))
73
- }).WithTimeout (time .Minute ).WithPolling (time .Second * 10 ).Should (Succeed ())
74
- Expect (* profile .Status .Tuned ).ToNot (BeNil ())
75
- Expect (* profile .Status .Tuned ).To (Equal (tunedNamespacedName .String ()))
76
- })
77
-
78
- It ("[test_id:33791] Should include the generated runtime class name" , func () {
79
- profile , err := profiles .GetByNodeLabels (testutils .NodeSelectorLabels )
80
- Expect (err ).ToNot (HaveOccurred ())
81
-
82
- key := types.NamespacedName {
83
- Name : components .GetComponentName (profile .Name , components .ComponentNamePrefix ),
84
- Namespace : metav1 .NamespaceAll ,
85
- }
86
- runtimeClass := & nodev1.RuntimeClass {}
87
- err = testclient .GetWithRetry (context .TODO (), testclient .DataPlaneClient , key , runtimeClass )
88
- Expect (err ).ToNot (HaveOccurred (), "cannot find the RuntimeClass object " + key .String ())
89
-
90
- Expect (profile .Status .RuntimeClass ).NotTo (BeNil ())
91
- Expect (* profile .Status .RuntimeClass ).To (Equal (runtimeClass .Name ))
92
- })
93
-
94
- It ("[test_id:29673] Machine config pools status tied to Performance Profile" , Label (string (label .OpenShift )), func () {
95
- // Creating bad MC that leads to degraded state
96
- By ("Creating bad MachineConfig" )
97
- badMC := createBadMachineConfig ("bad-mc" )
98
- err = testclient .ControlPlaneClient .Create (context .TODO (), badMC )
99
- Expect (err ).ToNot (HaveOccurred ())
100
-
101
- By ("Wait for MCP condition to be Degraded" )
102
- profile , err := profiles .GetByNodeLabels (testutils .NodeSelectorLabels )
103
- Expect (err ).ToNot (HaveOccurred ())
104
- performanceMCP , err := mcps .GetByProfile (profile )
105
- Expect (err ).ToNot (HaveOccurred ())
106
- mcps .WaitForCondition (performanceMCP , machineconfigv1 .MachineConfigPoolDegraded , corev1 .ConditionTrue )
107
- mcpConditionReason := mcps .GetConditionReason (performanceMCP , machineconfigv1 .MachineConfigPoolDegraded )
108
- profileConditionMessage := profiles .GetConditionMessage (testutils .NodeSelectorLabels , v1 .ConditionDegraded )
109
- // Verify the status reason of performance profile
110
- Expect (profileConditionMessage ).To (ContainSubstring (mcpConditionReason ))
111
-
112
- By ("Deleting bad MachineConfig and waiting when Degraded state is removed" )
113
- err = testclient .ControlPlaneClient .Delete (context .TODO (), badMC )
114
- Expect (err ).ToNot (HaveOccurred ())
115
-
116
- mcps .WaitForCondition (performanceMCP , machineconfigv1 .MachineConfigPoolUpdated , corev1 .ConditionTrue )
117
- })
57
+ // It("[test_id:30894] Tuned status name tied to Performance Profile", func() {
58
+ // profile, err := profiles.GetByNodeLabels(testutils.NodeSelectorLabels)
59
+ // Expect(err).ToNot(HaveOccurred())
60
+ // tunedList := &tunedv1.TunedList{}
61
+ // tunedName, err := tunedutils.GetName(context.TODO(), testclient.ControlPlaneClient, profile.Name)
62
+ // Expect(err).ToNot(HaveOccurred())
63
+ // tunedNamespacedName := types.NamespacedName{
64
+ // Name: tunedName,
65
+ // Namespace: components.NamespaceNodeTuningOperator,
66
+ // }
67
+ // // on hypershift platform, we're getting the tuned object that was mirrored by NTO to the hosted cluster,
68
+ // // hence we're using the DataPlaneClient here.
69
+ // Eventually(func(g Gomega) {
70
+ // g.Expect(testclient.DataPlaneClient.List(context.TODO(), tunedList, &client.ListOptions{
71
+ // Namespace: tunedNamespacedName.Namespace,
72
+ // })).To(Succeed())
73
+ // Expect(tunedList.Items).To(MatchTunedName(tunedName))
74
+ // }).WithTimeout(time.Minute).WithPolling(time.Second * 10).Should(Succeed())
75
+ // Expect(*profile.Status.Tuned).ToNot(BeNil())
76
+ // Expect(*profile.Status.Tuned).To(Equal(tunedNamespacedName.String()))
77
+ // })
78
+ //
79
+ // It("[test_id:33791] Should include the generated runtime class name", func() {
80
+ // profile, err := profiles.GetByNodeLabels(testutils.NodeSelectorLabels)
81
+ // Expect(err).ToNot(HaveOccurred())
82
+ //
83
+ // key := types.NamespacedName{
84
+ // Name: components.GetComponentName(profile.Name, components.ComponentNamePrefix),
85
+ // Namespace: metav1.NamespaceAll,
86
+ // }
87
+ // runtimeClass := &nodev1.RuntimeClass{}
88
+ // err = testclient.GetWithRetry(context.TODO(), testclient.DataPlaneClient, key, runtimeClass)
89
+ // Expect(err).ToNot(HaveOccurred(), "cannot find the RuntimeClass object "+key.String())
90
+ //
91
+ // Expect(profile.Status.RuntimeClass).NotTo(BeNil())
92
+ // Expect(*profile.Status.RuntimeClass).To(Equal(runtimeClass.Name))
93
+ // })
94
+ //
95
+ // It("[test_id:29673] Machine config pools status tied to Performance Profile", Label(string(label.OpenShift)), func() {
96
+ // // Creating bad MC that leads to degraded state
97
+ // By("Creating bad MachineConfig")
98
+ // badMC := createBadMachineConfig("bad-mc")
99
+ // err = testclient.ControlPlaneClient.Create(context.TODO(), badMC)
100
+ // Expect(err).ToNot(HaveOccurred())
101
+ //
102
+ // By("Wait for MCP condition to be Degraded")
103
+ // profile, err := profiles.GetByNodeLabels(testutils.NodeSelectorLabels)
104
+ // Expect(err).ToNot(HaveOccurred())
105
+ // performanceMCP, err := mcps.GetByProfile(profile)
106
+ // Expect(err).ToNot(HaveOccurred())
107
+ // mcps.WaitForCondition(performanceMCP, machineconfigv1.MachineConfigPoolDegraded, corev1.ConditionTrue)
108
+ // mcpConditionReason := mcps.GetConditionReason(performanceMCP, machineconfigv1.MachineConfigPoolDegraded)
109
+ // profileConditionMessage := profiles.GetConditionMessage(testutils.NodeSelectorLabels, v1.ConditionDegraded)
110
+ // // Verify the status reason of performance profile
111
+ // Expect(profileConditionMessage).To(ContainSubstring(mcpConditionReason))
112
+ //
113
+ // By("Deleting bad MachineConfig and waiting when Degraded state is removed")
114
+ // err = testclient.ControlPlaneClient.Delete(context.TODO(), badMC)
115
+ // Expect(err).ToNot(HaveOccurred())
116
+ //
117
+ // mcps.WaitForCondition(performanceMCP, machineconfigv1.MachineConfigPoolUpdated, corev1.ConditionTrue)
118
+ // })
118
119
119
120
It ("[test_id:40402] Tuned profile status tied to Performance Profile" , func () {
120
121
// During this test we're creating additional synthetic tuned CR by invoking the createrBadTuned function.
@@ -127,16 +128,32 @@ var _ = Describe("Status testing of performance profile", Ordered, func() {
127
128
// on openshift this is the namespace where NTO/PAO creates tuned objects
128
129
ns := components .NamespaceNodeTuningOperator
129
130
131
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "tuned" , "-n" , ns )
132
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "profile" , "-n" , ns )
133
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "performanceprofile/performance" , "-n" , ns , "-o" , "yaml" )
134
+
130
135
// Creating a bad Tuned object that leads to degraded state
131
136
cleanupFunc := createBadTuned (tunedName , ns )
132
137
defer func () {
133
138
By ("Deleting bad Tuned and waiting when Degraded state is removed" )
134
139
cleanupFunc ()
140
+
141
+ By ("3) Sleeping 30" )
142
+ time .Sleep (30 * time .Second )
143
+
144
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "tuned" , "-n" , ns )
145
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "profile" , "-n" , ns )
146
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "performanceprofile/performance" , "-n" , ns , "-o" , "yaml" )
147
+
135
148
profiles .WaitForCondition (testutils .NodeSelectorLabels , v1 .ConditionAvailable , corev1 .ConditionTrue )
136
149
}()
137
150
138
151
By ("Waiting for performance profile condition to be Degraded" )
139
152
profiles .WaitForCondition (testutils .NodeSelectorLabels , v1 .ConditionDegraded , corev1 .ConditionTrue )
153
+
154
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "tuned" , "-n" , ns )
155
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "profile" , "-n" , ns )
156
+ _ , _ , err = util .ExecAndLogCommand ("oc" , "get" , "performanceprofile/performance" , "-n" , ns , "-o" , "yaml" )
140
157
})
141
158
})
142
159
})
0 commit comments