@@ -20,6 +20,7 @@ import (
20
20
21
21
"github.com/intel/intel-device-plugins-for-kubernetes/test/e2e/utils"
22
22
"github.com/onsi/ginkgo/v2"
23
+ v1 "k8s.io/api/core/v1"
23
24
"k8s.io/apimachinery/pkg/labels"
24
25
"k8s.io/kubernetes/test/e2e/framework"
25
26
e2edebug "k8s.io/kubernetes/test/e2e/framework/debug"
@@ -65,7 +66,9 @@ func describeQatDpdkPlugin() {
65
66
66
67
var dpPodName string
67
68
68
- ginkgo .BeforeEach (func () {
69
+ var resourceName v1.ResourceName
70
+
71
+ ginkgo .JustBeforeEach (func () {
69
72
ginkgo .By ("deploying QAT plugin in DPDK mode" )
70
73
e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "apply" , "-k" , filepath .Dir (kustomizationPath ))
71
74
@@ -83,6 +86,11 @@ func describeQatDpdkPlugin() {
83
86
if err := utils .TestPodsFileSystemInfo (podList .Items ); err != nil {
84
87
framework .Failf ("container filesystem info checks failed: %v" , err )
85
88
}
89
+
90
+ ginkgo .By ("checking if the resource is allocatable" )
91
+ if err := utils .WaitForNodesWithResource (f .ClientSet , resourceName , 30 * time .Second ); err != nil {
92
+ framework .Failf ("unable to wait for nodes to have positive allocatable resource: %v" , err )
93
+ }
86
94
})
87
95
88
96
ginkgo .AfterEach (func () {
@@ -93,12 +101,14 @@ func describeQatDpdkPlugin() {
93
101
}
94
102
})
95
103
96
- ginkgo .Context ("When QAT Gen4 resources are available" , func () {
104
+ ginkgo .Context ("When QAT Gen4 resources are available with crypto (cy) services enabled" , func () {
105
+ // This BeforeEach runs even before the JustBeforeEach above.
97
106
ginkgo .BeforeEach (func () {
98
- ginkgo .By ("checking if the resource is allocatable" )
99
- if err := utils .WaitForNodesWithResource (f .ClientSet , "qat.intel.com/cy" , 30 * time .Second ); err != nil {
100
- framework .Failf ("unable to wait for nodes to have positive allocatable resource: %v" , err )
101
- }
107
+ ginkgo .By ("creating a configMap before plugin gets deployed" )
108
+ e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "create" , "configmap" , "--from-literal" , "qat.conf=ServicesEnabled=sym;asym" , "qat-config" )
109
+
110
+ ginkgo .By ("setting resourceName for cy services" )
111
+ resourceName = "qat.intel.com/cy"
102
112
})
103
113
104
114
ginkgo .It ("deploys a crypto pod requesting QAT resources" , func () {
@@ -116,10 +126,8 @@ func describeQatDpdkPlugin() {
116
126
117
127
ginkgo .Context ("When QAT Gen2 resources are available" , func () {
118
128
ginkgo .BeforeEach (func () {
119
- ginkgo .By ("checking if the resource is allocatable" )
120
- if err := utils .WaitForNodesWithResource (f .ClientSet , "qat.intel.com/generic" , 30 * time .Second ); err != nil {
121
- framework .Failf ("unable to wait for nodes to have positive allocatable resource: %v" , err )
122
- }
129
+ ginkgo .By ("setting resourceName for Gen2 resources" )
130
+ resourceName = "qat.intel.com/generic"
123
131
})
124
132
125
133
ginkgo .It ("deploys a crypto pod requesting QAT resources" , func () {
0 commit comments