Skip to content

Commit 2dcba9a

Browse files
committed
Add e2e test for CDI
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent 87eab91 commit 2dcba9a

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

tests/scripts/enable-cdi.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2+
source ${SCRIPT_DIR}/.definitions.sh
3+
4+
# Import the check definitions
5+
source ${SCRIPT_DIR}/checks.sh
6+
7+
kubectl patch clusterpolicy/cluster-policy --type='json' -p='[{"op": "replace", "path": "/spec/cdi/enabled", "value": "true"}]'
8+
if [ "$?" -ne 0 ]; then
9+
echo "failed to enable CDI in clusterpolicy"
10+
exit 1
11+
fi
12+
sleep 5

tests/scripts/end-to-end.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ echo "--------------------------------------------------------------------------
1919
# Install a workload and verify that this works as expected
2020
"${SCRIPT_DIR}"/install-workload.sh
2121
"${SCRIPT_DIR}"/verify-workload.sh
22+
"${SCRIPT_DIR}"/uninstall-workload.sh
2223

2324
echo ""
2425
echo ""
@@ -27,6 +28,16 @@ echo "--------------------------------------------------------------------------
2728
# Test updates through ClusterPolicy
2829
"${SCRIPT_DIR}"/update-clusterpolicy.sh
2930

31+
echo ""
32+
echo ""
33+
echo "--------------CDI Tests--------------------------------------------"
34+
echo "------------------------------------------------------------------------------------"
35+
"${SCRIPT_DIR}"/enable-cdi.sh
36+
"${SCRIPT_DIR}"/verify-operator.sh
37+
"${SCRIPT_DIR}"/install-workload.sh
38+
"${SCRIPT_DIR}"/verify-workload.sh
39+
"${SCRIPT_DIR}"/uninstall-workload.sh
40+
3041
echo ""
3142
echo ""
3243
echo "--------------GPU Operator Restart Test---------------------------------------------"
@@ -43,8 +54,7 @@ test_restart_operator ${TEST_NAMESPACE} ${CONTAINER_RUNTIME}
4354
"${SCRIPT_DIR}"/enable-operands.sh
4455
"${SCRIPT_DIR}"/verify-operator.sh
4556

46-
# Uninstall the workload and operator
47-
"${SCRIPT_DIR}"/uninstall-workload.sh
57+
# Uninstall the operator
4858
"${SCRIPT_DIR}"/uninstall-operator.sh
4959

5060
echo ""

0 commit comments

Comments
 (0)