Skip to content

Commit

Permalink
Update GPU add-on testing for new SKU (#412)
Browse files Browse the repository at this point in the history
* Update GPU add-on testing for new SKU

Signed-off-by: Luca Giorgi <[email protected]>

* bump CUDA version

Signed-off-by: Luca Giorgi <[email protected]>

* Cleanup post-install TC

Signed-off-by: Luca Giorgi <[email protected]>

* shift to openshiftlibrary

Signed-off-by: Luca Giorgi <[email protected]>

* update variable capitalization

Signed-off-by: Luca Giorgi <[email protected]>

* update argument capitalization

Signed-off-by: Luca Giorgi <[email protected]>
  • Loading branch information
lugi0 authored Jun 23, 2022
1 parent 3830ae8 commit f0619ff
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 39 deletions.
46 changes: 28 additions & 18 deletions tests/Resources/OCP.resource
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
*** Settings ***
Documentation Set of Keywords for OCP checks
Library OpenShiftCLI
Library OpenShiftLibrary


*** Keywords ***
Verify DaemonSet Status
[Documentation] Verifies that a DaemonSet exists, and that the number
... of available pods matches the number of desired pods
[Arguments] ${label} ${DSName}
@{DS_obj} = OpenShiftCLI.Get kind=DaemonSet label_selector=${label}
&{DS_obj_dictionary} = Set Variable ${DS_obj}[0]
Should Match ${DS_obj_dictionary.metadata.name} ${DSName}
Should Be Equal ${DS_obj_dictionary.status.desiredNumberScheduled} ${DS_obj_dictionary.status.numberAvailable}
[Arguments] ${label} ${dsname}
@{ds_obj} = OpenShiftLibrary.Oc Get kind=DaemonSet label_selector=${label}
&{ds_obj_dictionary} = Set Variable ${ds_obj}[0]
Should Match ${ds_obj_dictionary.metadata.name} ${dsname}
Should Be Equal ${ds_obj_dictionary.status.desiredNumberScheduled} ${ds_obj_dictionary.status.numberAvailable}

Verify Deployment Status
[Documentation] Verifies that a Deployment exists, and that its status
... is "Available"
[Arguments] ${label} ${DName}
@{D_obj} = OpenShiftCLI.Get kind=Deployment label_selector=${label}
&{D_obj_dictionary} = Set Variable ${D_obj}[0]
Should Match ${D_obj_dictionary.metadata.name} ${DName}
Should Be Equal ${D_obj_dictionary.status.conditions[0].type} Available
[Arguments] ${label} ${dname}
@{d_obj} = OpenShiftLibrary.Oc Get kind=Deployment label_selector=${label}
&{d_obj_dictionary} = Set Variable ${d_obj}[0]
Should Match ${d_obj_dictionary.metadata.name} ${dname}
Should Be Equal ${d_obj_dictionary.status.conditions[0].type} Available

Verify Operator Status
[Documentation] Verifies that an Operator exists, that its status
... is "Succeeded" and that the name matches
[Arguments] ${label} ${operator_name}
@{Op_obj} = OpenShiftCLI.Get kind=ClusterServiceVersion label_selector=${label}
&{Op_obj_dictionary} = Set Variable ${Op_obj}[0]
Should Match ${Op_obj_dictionary.metadata.name} ${operator_name}
Should Be Equal ${Op_obj_dictionary.status.phase} Succeeded
@{op_obj} = OpenShiftLibrary.Oc Get kind=ClusterServiceVersion label_selector=${label}
&{op_obj_dictionary} = Set Variable ${op_obj}[0]
Should Match ${op_obj_dictionary.metadata.name} ${operator_name}
Should Be Equal ${op_obj_dictionary.status.phase} Succeeded

Verify Namespace Status
[Documentation] Verifies that a Namespace exists, and that its status
... is "Active"
[Arguments] ${label}
@{NS_obj} = OpenShiftCLI.Get kind=Namespace label_selector=${label}
&{NS_obj_dictionary} = Set Variable ${NS_obj}[0]
Should Be Equal ${NS_obj_dictionary.status.phase} Active
@{ns_obj} = OpenShiftLibrary.Oc Get kind=Namespace label_selector=${label}
&{ns_obj_dictionary} = Set Variable ${ns_obj}[0]
Should Be Equal ${ns_obj_dictionary.status.phase} Active

Verify CR Status
[Documentation] Verifies that a CR exists, that it's available
... and that the name matches
[Arguments] ${crd} ${cr_name}
@{cr_obj} = OpenShiftLibrary.Oc Get kind=${crd}
&{cr_obj_dictionary} = Set Variable ${cr_obj}[0]
Should Match ${cr_obj_dictionary.metadata.name} ${cr_name}
Should Be Equal ${cr_obj_dictionary.status.conditions[0].type} Available
Should Be Equal ${cr_obj_dictionary.status.conditions[0].status} True
37 changes: 19 additions & 18 deletions tests/Tests/100__deploy/100__installation/102__post_install.robot
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,32 @@ Verify GPU Operator Deployment # robocop: disable
# Before GPU Node is added to the cluster
# NS
Verify Namespace Status label=kubernetes.io/metadata.name=redhat-gpu-operator
Verify Namespace Status label=kubernetes.io/metadata.name=redhat-nvidia-gpu-addon
# Node-Feature-Discovery Operator
Verify Operator Status label=operators.coreos.com/node-feature-discovery-operator.redhat-gpu-operator
... operator_name=node-feature-discovery-operator.v*
Verify Operator Status label=operators.coreos.com/nfd.redhat-nvidia-gpu-addon
... operator_name=nfd.v*
# GPU Operator
Verify Operator Status label=operators.coreos.com/gpu-operator-certified-addon.redhat-gpu-operator
... operator_name=gpu-operator-certified-addon.v*
Verify Operator Status label=operators.coreos.com/gpu-operator-certified.redhat-nvidia-gpu-addon
... operator_name=gpu-operator-certified.v*
# nfd-controller-manager
Verify Deployment Status label=operators.coreos.com/node-feature-discovery-operator.redhat-gpu-operator
... DName=nfd-controller-manager
Verify Deployment Status label=operators.coreos.com/nfd.redhat-nvidia-gpu-addon
... dname=nfd-controller-manager
# nfd-master
Verify DaemonSet Status label=app=nfd-master DSName=nfd-master
Verify DaemonSet Status label=app=nfd-master dsname=nfd-master
# nfd-worker
Verify DaemonSet Status label=app=nfd-worker DSName=nfd-worker
Verify DaemonSet Status label=app=nfd-worker dsname=nfd-worker

# After GPU Node is added to the cluster
# TODO: gpu-feature-discovery DS
# ... nvidia-container-toolkit-daemonset DS
# ... gpu-cluster-policy CP
# ... nvidia-dcgm-exporter DS
# ... nvidia-dcgm DS
# ... nvidia-device-plugin-daemonset DS
# ... nvidia-driver-daemonset-49.84.202201212103-0 DS
# ... nvidia-node-status-exporter DS
# ... nvidia-operator-validator DS
Verify DaemonSet Status label=app=gpu-feature-discovery dsname=gpu-feature-discovery
Verify DaemonSet Status label=app=nvidia-container-toolkit-daemonset dsname=nvidia-container-toolkit-daemonset
Verify DaemonSet Status label=app=nvidia-dcgm-exporter dsname=nvidia-dcgm-exporter
Verify DaemonSet Status label=app=nvidia-dcgm dsname=nvidia-dcgm
Verify DaemonSet Status label=app=nvidia-device-plugin-daemonset dsname=nvidia-device-plugin-daemonset
#app=nvidia-driver-daemonset-410.84.202205191234-0
#Verify DaemonSet Status label=app=nvidia-driver-daemonset-* dsname=nvidia-driver-daemonset-*
Verify DaemonSet Status label=app=nvidia-node-status-exporter dsname=nvidia-node-status-exporter
Verify DaemonSet Status label=app=nvidia-operator-validator dsname=nvidia-operator-validator
Verify CR Status crd=NodeFeatureDiscovery cr_name=ocp-gpu-addon

Verify That Prometheus Image Is A CPaaS Built Image
[Documentation] Verifies the images used for prometheus
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/500__jupyterhub/minimal-cuda-test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Force Tags JupyterHub

*** Variables ***
${NOTEBOOK_IMAGE} = minimal-gpu
${EXPECTED_CUDA_VERSION} = 11.4
${EXPECTED_CUDA_VERSION} = 11.6


*** Test Cases ***
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/500__jupyterhub/minimal-pytorch-test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Force Tags JupyterHub

*** Variables ***
${NOTEBOOK_IMAGE} = pytorch
${EXPECTED_CUDA_VERSION} = 11.4
${EXPECTED_CUDA_VERSION} = 11.6


*** Test Cases ***
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/500__jupyterhub/minimal-tensorflow-test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Force Tags JupyterHub

*** Variables ***
${NOTEBOOK_IMAGE} = tensorflow
${EXPECTED_CUDA_VERSION} = 11.4
${EXPECTED_CUDA_VERSION} = 11.6


*** Test Cases ***
Expand Down

0 comments on commit f0619ff

Please sign in to comment.