@@ -22,6 +22,7 @@ import (
2222
2323 "github.com/intel/intel-device-plugins-for-kubernetes/test/e2e/utils"
2424 "github.com/onsi/ginkgo/v2"
25+ "github.com/onsi/gomega"
2526 v1 "k8s.io/api/core/v1"
2627 "k8s.io/apimachinery/pkg/api/resource"
2728 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -38,6 +39,7 @@ const (
3839 compressTestYaml = "deployments/qat_dpdk_app/test-compress1/kustomization.yaml"
3940 cryptoTestYaml = "deployments/qat_dpdk_app/test-crypto1/kustomization.yaml"
4041 cryptoTestGen4Yaml = "deployments/qat_dpdk_app/test-crypto1-gen4/kustomization.yaml"
42+ demoPodContainerName = "crypto-perf"
4143)
4244
4345const (
@@ -135,12 +137,8 @@ func describeQatDpdkPlugin() {
135137 e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "apply" , "-k" , filepath .Dir (cryptoTestGen4YamlPath ))
136138
137139 ginkgo .By ("waiting the crypto pod to finish successfully" )
138-
139- e2epod .NewPodClient (f ).WaitForSuccess (ctx , "qat-dpdk-test-crypto-perf-tc1-gen4" , 300 * time .Second )
140-
141- output , _ := e2epod .GetPodLogs (ctx , f .ClientSet , f .Namespace .Name , "qat-dpdk-test-crypto-perf-tc1-gen4" , "crypto-perf" )
142-
143- framework .Logf ("crypto-perf output:\n %s" , output )
140+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , "qat-dpdk-test-crypto-perf-tc1-gen4" , f .Namespace .Name , 300 * time .Second )
141+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , "qat-dpdk-test-crypto-perf-tc1-gen4" , "crypto-perf" ))
144142 })
145143 })
146144
@@ -169,15 +167,19 @@ func describeQatDpdkPlugin() {
169167 e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "apply" , "-k" , filepath .Dir (cryptoTestYamlPath ))
170168
171169 ginkgo .By ("waiting the crypto pod to finish successfully" )
172- e2epod .NewPodClient (f ).WaitForSuccess (ctx , "qat-dpdk-test-crypto-perf-tc1" , 60 * time .Second )
170+ demoPodName := "qat-dpdk-test-crypto-perf-tc1"
171+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , demoPodName , f .Namespace .Name , 60 * time .Second )
172+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , demoPodName , demoPodContainerName ))
173173 })
174174
175175 ginkgo .It ("deploys a compress pod requesting QAT resources" , func (ctx context.Context ) {
176176 ginkgo .By ("submitting a compress pod requesting QAT resources" )
177177 e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "apply" , "-k" , filepath .Dir (compressTestYamlPath ))
178178
179179 ginkgo .By ("waiting the compress pod to finish successfully" )
180- e2epod .NewPodClient (f ).WaitForSuccess (ctx , "qat-dpdk-test-compress-perf-tc1" , 60 * time .Second )
180+ demoPodName := "qat-dpdk-test-compress-perf-tc1"
181+ err := e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , demoPodName , f .Namespace .Name , 60 * time .Second )
182+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , demoPodName , demoPodContainerName ))
181183 })
182184 })
183185}
@@ -210,9 +212,7 @@ func runCpaSampleCode(ctx context.Context, f *framework.Framework, runTests int,
210212 framework .ExpectNoError (err , "pod Create API error" )
211213
212214 ginkgo .By ("waiting the cpa_sample_code pod for the resource" + resourceName .String () + "to finish successfully" )
213- e2epod .NewPodClient (f ).WaitForSuccess (ctx , pod .ObjectMeta .Name , 300 * time .Second )
214-
215- output , _ := e2epod .GetPodLogs (ctx , f .ClientSet , f .Namespace .Name , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name )
216215
217- framework .Logf ("cpa_sample_code output:\n %s" , output )
216+ err = e2epod .WaitForPodSuccessInNamespaceTimeout (ctx , f .ClientSet , pod .ObjectMeta .Name , f .Namespace .Name , 300 * time .Second )
217+ gomega .Expect (err ).To (gomega .BeNil (), utils .GetPodLogs (ctx , f , pod .ObjectMeta .Name , pod .Spec .Containers [0 ].Name ))
218218}
0 commit comments