@@ -34,6 +34,8 @@ import (
34
34
)
35
35
36
36
const (
37
+ ns = "inteldeviceplugins-system"
38
+ timeout = time .Second * 120
37
39
kustomizationWebhook = "deployments/sgx_admissionwebhook/overlays/default-with-certmanager/kustomization.yaml"
38
40
kustomizationPlugin = "deployments/sgx_plugin/overlays/epc-hook-initcontainer/kustomization.yaml"
39
41
)
@@ -112,5 +114,37 @@ func describe() {
112
114
113
115
ginkgo .By ("waiting the pod to finish successfully" )
114
116
e2epod .NewPodClient (f ).WaitForSuccess (pod .ObjectMeta .Name , 60 * time .Second )
117
+
118
+ e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "delete" , "-k" , filepath .Dir (deploymentPluginPath ))
119
+ })
120
+
121
+ ginkgo .It ("deploys SGX plugin with operator" , func () {
122
+ utils .Kubectl ("" , "apply" , "-k" , "deployments/operator/default/kustomization.yaml" )
123
+
124
+ if _ , err := e2epod .WaitForPodsWithLabelRunningReady (f .ClientSet , ns , labels.Set {"control-plane" : "controller-manager" }.AsSelector (), 1 , timeout ); err != nil {
125
+ framework .Failf ("unable to wait for all pods to be running and ready: %v" , err )
126
+ }
127
+
128
+ utils .Kubectl ("" , "apply" , "-f" , "deployments/operator/samples/deviceplugin_v1_sgxdeviceplugin.yaml" )
129
+
130
+ if _ , err := e2epod .WaitForPodsWithLabelRunningReady (f .ClientSet , ns , labels.Set {"app" : "intel-sgx-plugin" }.AsSelector (), 1 , timeout ); err != nil {
131
+ framework .Failf ("unable to wait for all pods to be running and ready: %v" , err )
132
+ }
133
+
134
+ if err := utils .WaitForNodesWithResource (f .ClientSet , "sgx.intel.com/epc" , 150 * time .Second ); err != nil {
135
+ framework .Failf ("unable to wait for nodes to have positive allocatable epc resource: %v" , err )
136
+ }
137
+
138
+ if err := utils .WaitForNodesWithResource (f .ClientSet , "sgx.intel.com/enclave" , 30 * time .Second ); err != nil {
139
+ framework .Failf ("unable to wait for nodes to have positive allocatable enclave resource: %v" , err )
140
+ }
141
+
142
+ if err := utils .WaitForNodesWithResource (f .ClientSet , "sgx.intel.com/provision" , 30 * time .Second ); err != nil {
143
+ framework .Failf ("unable to wait for nodes to have positive allocatable provision resource: %v" , err )
144
+ }
145
+
146
+ utils .Kubectl ("" , "delete" , "-f" , "deployments/operator/samples/deviceplugin_v1_sgxdeviceplugin.yaml" )
147
+
148
+ utils .Kubectl ("" , "delete" , "-k" , "deployments/operator/default/kustomization.yaml" )
115
149
})
116
150
}
0 commit comments