Skip to content

Commit afce0ed

Browse files
authored
Merge pull request #1196 from ozhuraki/e2e-operator
operator: Add e2e tests for DSA, IAA
2 parents 95697e2 + ef7954c commit afce0ed

File tree

6 files changed

+52
-4
lines changed

6 files changed

+52
-4
lines changed

.github/workflows/e2e-dsa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- 'release-*'
1414

1515
env:
16-
IMAGES: 'intel-dsa-plugin intel-idxd-config-initcontainer accel-config-demo'
16+
IMAGES: 'intel-dsa-plugin intel-idxd-config-initcontainer accel-config-demo intel-deviceplugin-operator'
1717

1818
permissions:
1919
contents: read

.github/workflows/e2e-iaa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- 'release-*'
1414

1515
env:
16-
IMAGES: 'intel-iaa-plugin intel-idxd-config-initcontainer accel-config-demo'
16+
IMAGES: 'intel-iaa-plugin intel-idxd-config-initcontainer accel-config-demo intel-deviceplugin-operator'
1717

1818
permissions:
1919
contents: read

cmd/operator/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func main() {
199199
os.Exit(1)
200200
}
201201

202-
if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
202+
if err := mgr.AddReadyzCheck("readyz", mgr.GetWebhookServer().StartedChecker()); err != nil {
203203
setupLog.Error(err, "unable to set up ready check")
204204
os.Exit(1)
205205
}

deployments/operator/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ spec:
6262
fieldRef:
6363
fieldPath: metadata.namespace
6464
serviceAccountName: default
65-
terminationGracePeriodSeconds: 10
65+
terminationGracePeriodSeconds: 120

test/e2e/dsa/dsa.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import (
2828
)
2929

3030
const (
31+
ns = "inteldeviceplugins-system"
32+
timeout = time.Second * 120
3133
kustomizationYaml = "deployments/dsa_plugin/overlays/dsa_initcontainer/dsa_initcontainer.yaml"
3234
configmapYaml = "demo/dsa.conf"
3335
demoYaml = "demo/dsa-accel-config-demo-pod.yaml"
@@ -96,4 +98,26 @@ func describe() {
9698

9799
framework.Logf("log output: %s", log)
98100
})
101+
102+
ginkgo.It("deploys DSA plugin with operator", func() {
103+
utils.Kubectl("", "apply", "-k", "deployments/operator/default/kustomization.yaml")
104+
105+
if _, err := e2epod.WaitForPodsWithLabelRunningReady(f.ClientSet, ns, labels.Set{"control-plane": "controller-manager"}.AsSelector(), 1, timeout); err != nil {
106+
framework.Failf("unable to wait for all pods to be running and ready: %v", err)
107+
}
108+
109+
utils.Kubectl("", "apply", "-f", "deployments/operator/samples/deviceplugin_v1_dsadeviceplugin.yaml")
110+
111+
if _, err := e2epod.WaitForPodsWithLabelRunningReady(f.ClientSet, ns, labels.Set{"app": "intel-dsa-plugin"}.AsSelector(), 1, timeout); err != nil {
112+
framework.Failf("unable to wait for all pods to be running and ready: %v", err)
113+
}
114+
115+
if err := utils.WaitForNodesWithResource(f.ClientSet, "dsa.intel.com/wq-user-dedicated", timeout); err != nil {
116+
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
117+
}
118+
119+
utils.Kubectl("", "delete", "-f", "deployments/operator/samples/deviceplugin_v1_dsadeviceplugin.yaml")
120+
121+
utils.Kubectl("", "delete", "-k", "deployments/operator/default/kustomization.yaml")
122+
})
99123
}

test/e2e/iaa/iaa.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import (
2828
)
2929

3030
const (
31+
ns = "inteldeviceplugins-system"
32+
timeout = time.Second * 120
3133
kustomizationYaml = "deployments/iaa_plugin/overlays/iaa_initcontainer/iaa_initcontainer.yaml"
3234
configmapYaml = "demo/iaa.conf"
3335
demoYaml = "demo/iaa-accel-config-demo-pod.yaml"
@@ -96,4 +98,26 @@ func describe() {
9698

9799
framework.Logf("log output: %s", log)
98100
})
101+
102+
ginkgo.It("deploys IAA plugin with operator", func() {
103+
utils.Kubectl("", "apply", "-k", "deployments/operator/default/kustomization.yaml")
104+
105+
if _, err := e2epod.WaitForPodsWithLabelRunningReady(f.ClientSet, ns, labels.Set{"control-plane": "controller-manager"}.AsSelector(), 1, timeout); err != nil {
106+
framework.Failf("unable to wait for all pods to be running and ready: %v", err)
107+
}
108+
109+
utils.Kubectl("", "apply", "-f", "deployments/operator/samples/deviceplugin_v1_iaadeviceplugin.yaml")
110+
111+
if _, err := e2epod.WaitForPodsWithLabelRunningReady(f.ClientSet, ns, labels.Set{"app": "intel-iaa-plugin"}.AsSelector(), 1, timeout); err != nil {
112+
framework.Failf("unable to wait for all pods to be running and ready: %v", err)
113+
}
114+
115+
if err := utils.WaitForNodesWithResource(f.ClientSet, "iaa.intel.com/wq-user-dedicated", timeout); err != nil {
116+
framework.Failf("unable to wait for nodes to have positive allocatable resource: %v", err)
117+
}
118+
119+
utils.Kubectl("", "delete", "-f", "deployments/operator/samples/deviceplugin_v1_iaadeviceplugin.yaml")
120+
121+
utils.Kubectl("", "delete", "-k", "deployments/operator/default/kustomization.yaml")
122+
})
99123
}

0 commit comments

Comments
 (0)