@@ -21,21 +21,46 @@ ${DEVICE_COUNT} 5
21
21
*** Test Cases ***
22
22
Sanity Test
23
23
[Documentation] Performs a simple test of Generic Device Plugin
24
- [Setup] GDP Test Setup ${GDP_CONFIG_DROPIN }
24
+ [Setup] Run Keywords
25
+ ... Enable And Configure GDP
26
+ ... Enable Serialsim
27
+ ... Copy Script To Host
25
28
29
+ Wait Until Device Is Allocatable
30
+
31
+ Command Should Work crictl pull registry.access.redhat.com/ubi9/ubi:9.6
32
+ Start Script On Host
26
33
Create Test Job
34
+
27
35
Wait For Job Completion And Check Logs
28
36
29
- [Teardown] GDP Test Teardown
37
+ [Teardown] Run Keywords
38
+ ... Stop Script On Host
39
+ ... Disable GDP
30
40
31
- Verify that mountPath correctly renames the device within the container
32
- [Documentation] Performs a test of Generic Device Plugin with custom mountPath configuration
33
- [Setup ] GDP Test Setup ${ GDP_CONFIG_DROPIN_WITH_MOUNT }
41
+ Verify FUSE device allocation and accessibility
42
+ [Documentation] Verifies FUSE device configuration, allocation, and accessibility in pods
43
+ [Tags ] fuse-device
34
44
35
- Create Test Job With Modified Script
36
- Wait For Job Completion And Check Logs
45
+ Enable And Configure GDP ${GDP_CONFIG_FUSE_COUNT }
46
+ Wait Until Device Is Allocatable 10 fuse
47
+ # Create and deploy pod requesting 4 FUSE devices
48
+ ${path } = Create Random Temp File ${POD_FUSE_DEVICE }
49
+ Oc Create -f ${path } -n ${NAMESPACE }
50
+
51
+ # Wait for pod to be ready and verify device accessibility
52
+ Oc Wait -n ${NAMESPACE } pod/fuse-test-pod --for=condition=Ready --timeout=120s
53
+
54
+ # Verify /dev/fuse is accessible in the pod
55
+ ${fuse_device } = Run With Kubeconfig oc exec -n ${NAMESPACE } fuse-test-pod -- ls -l /dev/fuse
56
+ Should Contain ${fuse_device } /dev/fuse
37
57
38
- [Teardown] GDP Test Teardown
58
+ # Verify node allocation shows 4 FUSE devices allocated
59
+ ${node } = Run With Kubeconfig oc get node -o=name
60
+ ${node_name } = Remove String ${node } node/
61
+ ${describe_output } = Run With Kubeconfig oc describe node ${node_name }
62
+ Should Contain ${describe_output } device.microshift.io/fuse: 10
63
+ Should Contain ${describe_output } device.microshift.io/fuse 4 4
39
64
40
65
Verify ttyUSB glob pattern device discovery and allocation
41
66
[Documentation] Tests GDP with glob pattern to discover multiple ttyUSB devices and verify device allocation across multiple pods
@@ -117,35 +142,22 @@ Create Test Job
117
142
Oc Create -f ${path } -n ${NAMESPACE }
118
143
Oc Create -f ./assets/generic-device-plugin/job.yaml -n ${NAMESPACE }
119
144
120
- Create Test Job With Modified Script
121
- [Documentation] Creates Job that spawns test Pod running to completion with modified script.
122
- ${script } = OperatingSystem.Get File ./assets/generic-device-plugin/fake-serial-communication.py
123
- ${modified_script } = Replace String
124
- ... ${script }
125
- ... DEVICE_POD = "/dev/ttyPipeB0"
126
- ... DEVICE_POD = "/dev/myrenamedserial"
127
- ${configmap } = Append To Preamble ${modified_script }
128
- Log ${configmap }
129
- ${path } = Create Random Temp File ${configmap }
130
- Oc Create -f ${path } -n ${NAMESPACE }
131
- Oc Create -f ./assets/generic-device-plugin/job.yaml -n ${NAMESPACE }
132
-
133
145
Wait Until Device Is Allocatable
134
- [Documentation] Waits until device device.microshift.io/fakeserial is allocatable
135
- [Arguments] ${expected_count } =1
146
+ [Documentation] Waits until specified device is allocatable
147
+ [Arguments] ${expected_count } =1 ${ device_type } =fakeserial
136
148
${node } = Run With Kubeconfig oc get node -o=name
137
149
${node_name } = Remove String ${node } node/
138
150
Wait Until Keyword Succeeds 60s 5s
139
- ... Device Should Be Allocatable ${node_name } ${expected_count }
151
+ ... Device Should Be Allocatable ${node_name } ${expected_count } ${ device_type }
140
152
141
153
Device Should Be Allocatable
142
- [Documentation] Checks if device device.microshift.io/fakeserial is allocatable
143
- [Arguments] ${node_name } ${expected_count } =1
154
+ [Documentation] Checks if specified device is allocatable
155
+ [Arguments] ${node_name } ${expected_count } =1 ${ device_type } =fakeserial
144
156
${device_amount } = Oc Get JsonPath
145
157
... node
146
158
... ${EMPTY }
147
159
... ${node_name }
148
- ... .status.allocatable.device\\.microshift\\.io/fakeserial
160
+ ... .status.allocatable.device\\.microshift\\.io/${ device_type }
149
161
Should Be Equal As Integers ${device_amount } ${expected_count }
150
162
151
163
Wait For Job Completion And Check Logs
0 commit comments