Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/healthcheck/microshift_optional_workloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ var optionalWorkloadPaths = map[string]optionalWorkloads{
Namespace: "redhat-ods-applications",
Workloads: NamespaceWorkloads{Deployments: []string{"kserve-controller-manager"}},
},
"/usr/lib/microshift/manifests.d/070-microshift-sriov": {
Namespace: "sriov-network-operator",
Workloads: NamespaceWorkloads{Deployments: []string{"sriov-network-operator"}},
},
}

// fillOptionalMicroShiftWorkloads assembles list of optional MicroShift workloads
Expand Down
18 changes: 18 additions & 0 deletions test/assets/sriov/sriov-network-policy-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
name: policy-1
namespace: sriov-network-operator
spec:
nodeSelector:
node.kubernetes.io/instance-type=rhde
resourceName: intelnics
priority: 99
mtu: 9000
numVfs: 2
nicSelector:
deviceID: "10c9"
rootDevices:
- PLACEHOLDER_PCI_ADDRESS
vendor: "8086"
deviceType: netdevice
2 changes: 2 additions & 0 deletions test/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ MICROSHIFT_Y1_OPTIONAL_RPMS_LIST=(
)
MICROSHIFT_OPTIONAL_RPMS_LIST=(
"${MICROSHIFT_Y1_OPTIONAL_RPMS_LIST[@]}"
microshift-sriov
microshift-sriov-release-info
)
MICROSHIFT_Y2_X86_64_RPMS_LIST=(
microshift-ai-model-serving
Expand Down
7 changes: 6 additions & 1 deletion test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,12 @@ launch_vm() {
for n in ${network}; do
# For simplicity we assume that network filters are named the same as the networks
# If there is a filter with the same name as the network, attach it to the NIC
vm_network_args+="--network network=${n},model=virtio"
if [ "${n}" = "sriov" ] ; then
vm_network_args+="--network network=default,model=igb"
else
vm_network_args+="--network network=${n},model=virtio"
fi

if sudo virsh nwfilter-list | awk '{print $2}' | grep -qx "${n}"; then
vm_network_args+=",filterref=${n}"
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/scenarios-bootc/presubmits/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WEB_SERVER_URL="http://${VM_BRIDGE_IP}:${WEB_SERVER_PORT}"
scenario_create_vms() {
prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-source-optionals
# Two nics - one for macvlan, another for ipvlan (they cannot enslave the same interface)
launch_vm --boot_blueprint rhel96-bootc --network "${VM_MULTUS_NETWORK},${VM_MULTUS_NETWORK}"
launch_vm --boot_blueprint rhel96-bootc --network "sriov,${VM_MULTUS_NETWORK},${VM_MULTUS_NETWORK}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use a variable for sriov network name?


# Open the firewall ports. Other scenarios get this behavior by
# embedding settings in the blueprint, but there is no blueprint
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
58 changes: 58 additions & 0 deletions test/suites/optional/sriov.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
*** Settings ***
Documentation MicroShift SR-IOV tests

Resource ../../resources/microshift-process.resource

Suite Setup Setup Suite
Suite Teardown Teardown Suite


*** Variables ***
${TEMPLATE_PATH} ${CURDIR}/../../assets/sriov/sriov-network-policy-template.yaml


*** Test Cases ***
Create VFs And Verify
[Documentation] Deploys sriovnetworknodepolicy and verifies the VF configuration

VAR ${cmd}=
... oc get sriovnetworknodestate -n sriov-network-operator -o json | jq -r '.items[].status.interfaces[0].pciAddress'
${pci_address}= Run With Kubeconfig ${cmd}

${template_content}= OperatingSystem.Get File ${TEMPLATE_PATH}
${final_yaml}= Replace String ${template_content} PLACEHOLDER_PCI_ADDRESS ${pci_address}

Create File ${OUTPUT DIR}/final-sriov-policy.yaml ${final_yaml}

Oc Apply -f ${OUTPUT_DIR}/final-sriov-policy.yaml -n sriov-network-operator

Wait Until Resource Exists sriovnetworknodepolicy policy-1 sriov-network-operator

Wait Until Keyword Succeeds 2min 10s
... Verify VF Count 2

Wait Until Keyword Succeeds 2min 10s
... All Pods Should Be Running sriov-network-operator

[Teardown] Cleanup SR-IOV Policy


*** Keywords ***
Cleanup SR-IOV Policy
[Documentation] Deletes the policy

Oc Delete sriovnetworknodepolicy policy-1 -n sriov-network-operator

Verify VF Count
[Documentation] Checks if the number of VFs matches the expected count
[Arguments] ${expected_vfs}

${node_name}= Oc Get JsonPath nodes ${EMPTY} ${EMPTY} .items[0].metadata.name

${current_vfs}= Oc Get JsonPath
... node
... ${EMPTY}
... ${node_name}
... .status.allocatable.openshift\\.io/intelnics

Should Be Equal As Integers ${expected_vfs} ${current_vfs}