@@ -34,6 +34,8 @@ import (
3434)
3535
3636const (
37+ ns = "inteldeviceplugins-system"
38+ timeout = time .Second * 120
3739 kustomizationWebhook = "deployments/sgx_admissionwebhook/overlays/default-with-certmanager/kustomization.yaml"
3840 kustomizationPlugin = "deployments/sgx_plugin/overlays/epc-hook-initcontainer/kustomization.yaml"
3941)
@@ -112,5 +114,37 @@ func describe() {
112114
113115 ginkgo .By ("waiting the pod to finish successfully" )
114116 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" )
115149 })
116150}
0 commit comments