@@ -14,6 +14,7 @@ Table of Contents
1414 * [ Build the plugin] ( #build-the-plugin )
1515 * [ Run the plugin as administrator] ( #run-the-plugin-as-administrator )
1616 * [ Verify plugin registration] ( #verify-plugin-registration )
17+ * [ Testing the plugin] ( #testing-the-plugin )
1718
1819## Introduction
1920
@@ -128,3 +129,64 @@ master
128129 dsa.intel.com/wq-user-dedicated: 1
129130 dsa.intel.com/wq-user-shared: 1
130131```
132+
133+ ### Testing the plugin
134+
135+ We can test the plugin is working by deploying the provided example accel-config test image.
136+
137+ 1 . Build a Docker image with an accel-config tests:
138+
139+ ``` bash
140+ $ make dsa-accel-config-demo
141+ ...
142+ Successfully tagged dsa-accel-config-demo:devel
143+ ```
144+
145+ 1. Create a pod running unit tests off the local Docker image:
146+
147+ ` ` ` bash
148+ $ kubectl apply -f ${INTEL_DEVICE_PLUGINS_SRC} /demo/dsa-accel-config-demo-pod.yaml
149+ pod/dsa-accel-config-demo created
150+ ` ` `
151+
152+ 1. Wait until pod is completed:
153+
154+ ` ` ` bash
155+ $ kubectl get pods | grep dsa-accel-config-demo
156+ dsa-accel-config-demo 0/1 Completed 0 31m
157+
158+ 1. Review the job' s logs:
159+
160+ ```bash
161+ $ kubectl logs dsa-accel-config-demo | tail
162+ [debug] PF in sub-task[6], consider as passed
163+ [debug] PF in sub-task[7], consider as passed
164+ [debug] PF in sub-task[8], consider as passed
165+ [debug] PF in sub-task[9], consider as passed
166+ [debug] PF in sub-task[10], consider as passed
167+ [debug] PF in sub-task[11], consider as passed
168+ [debug] PF in sub-task[12], consider as passed
169+ [debug] PF in sub-task[13], consider as passed
170+ [debug] PF in sub-task[14], consider as passed
171+ [debug] PF in sub-task[15], consider as passed
172+ ```
173+
174+ If the pod did not successfully launch, possibly because it could not obtain the DSA
175+ resource, it will be stuck in the `Pending` status:
176+
177+ ```bash
178+ $ kubectl get pods
179+ NAME READY STATUS RESTARTS AGE
180+ dsa-accel-config-demo 0/1 Pending 0 7s
181+ ```
182+
183+ This can be verified by checking the Events of the pod:
184+
185+ ```bash
186+
187+ $ kubectl describe pod dsa-accel-config-demo | grep -A3 Events:
188+ Events:
189+ Type Reason Age From Message
190+ ---- ------ ---- ---- -------
191+ Warning FailedScheduling 2m26s default-scheduler 0/1 nodes are available: 1 Insufficient dsa.intel.com/wq-user-dedicated, 1 Insufficient dsa.intel.com/wq-user-shared.
192+ ```
0 commit comments