@@ -20,21 +20,31 @@ ${NAMESPACE} ${EMPTY}
20
20
*** Test Cases ***
21
21
Sanity Test
22
22
[Documentation] Performs a simple test of Generic Device Plugin
23
- [Setup] GDP Test Setup ${GDP_CONFIG_DROPIN }
23
+ [Setup] Run Keywords
24
+ ... Enable And Configure GDP
25
+ ... Enable Serialsim
26
+ ... Copy Script To Host
24
27
28
+ Wait Until Device Is Allocatable
29
+
30
+ Command Should Work crictl pull registry.access.redhat.com/ubi9/ubi:9.6
31
+ Start Script On Host
25
32
Create Test Job
26
- Wait For Job Completion And Check Logs
27
33
28
- [Teardown] GDP Test Teardown
34
+ Wait For Job Completion And Check Logs
29
35
30
- Verify that mountPath correctly renames the device within the container
31
- [Documentation] Performs a test of Generic Device Plugin with custom mountPath configuration
32
- [Setup] GDP Test Setup ${ GDP_CONFIG_DROPIN_WITH_MOUNT }
36
+ [Teardown] Run Keywords
37
+ ... Stop Script On Host
38
+ ... Disable GDP
33
39
34
- Create Test Job With Modified Script
35
- Wait For Job Completion And Check Logs
40
+ Verify GDP handles hot plugging of Devices
41
+ [Documentation] Verify that GDP reacts to devices being added or removed after MicroShift has started
42
+ [Tags] hot-plug
43
+ Enable And Configure GDP
44
+ Wait Until Device Is Allocatable 0
36
45
37
- [Teardown] GDP Test Teardown
46
+ Enable Serialsim
47
+ Wait Until Device Is Allocatable 1
38
48
39
49
40
50
*** Keywords ***
@@ -106,35 +116,23 @@ Create Test Job
106
116
Oc Create -f ${path } -n ${NAMESPACE }
107
117
Oc Create -f ./assets/generic-device-plugin/job.yaml -n ${NAMESPACE }
108
118
109
- Create Test Job With Modified Script
110
- [Documentation] Creates Job that spawns test Pod running to completion with modified script.
111
- ${script } = OperatingSystem.Get File ./assets/generic-device-plugin/fake-serial-communication.py
112
- ${modified_script } = Replace String
113
- ... ${script }
114
- ... DEVICE_POD = "/dev/ttyPipeB0"
115
- ... DEVICE_POD = "/dev/myrenamedserial"
116
- ${configmap } = Append To Preamble ${modified_script }
117
- Log ${configmap }
118
- ${path } = Create Random Temp File ${configmap }
119
- Oc Create -f ${path } -n ${NAMESPACE }
120
- Oc Create -f ./assets/generic-device-plugin/job.yaml -n ${NAMESPACE }
121
-
122
119
Wait Until Device Is Allocatable
123
120
[Documentation] Waits until device device.microshift.io/fakeserial is allocatable
121
+ [Arguments] ${expected_count } =1
124
122
${node } = Run With Kubeconfig oc get node -o=name
125
123
${node_name } = Remove String ${node } node/
126
124
Wait Until Keyword Succeeds 60s 5s
127
- ... Device Should Be Allocatable ${node_name }
125
+ ... Device Should Be Allocatable ${node_name } ${ expected_count }
128
126
129
127
Device Should Be Allocatable
130
128
[Documentation] Checks if device device.microshift.io/fakeserial is allocatable
131
- [Arguments] ${node_name }
129
+ [Arguments] ${node_name } ${ expected_count } = 1
132
130
${device_amount } = Oc Get JsonPath
133
131
... node
134
132
... ${EMPTY }
135
133
... ${node_name }
136
134
... .status.allocatable.device\\.microshift\\.io/fakeserial
137
- Should Be Equal As Integers ${device_amount } 1
135
+ Should Be Equal As Integers ${device_amount } ${ expected_count }
138
136
139
137
Wait For Job Completion And Check Logs
140
138
[Documentation] Waits for Job completion and checks Pod logs looking for 'Test successful' message
0 commit comments