From: Todd Malsbary Date: Thu, 3 Dec 2020 00:09:14 +0000 (-0800) Subject: Fix sriov test in baremetal deploy X-Git-Tag: 0.8.0~13^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F116090%2F2;p=multicloud%2Fk8s.git Fix sriov test in baremetal deploy The test incorrectly checked the node running the test for sriov feature support. This fix now checks the cluster for it. Issue-ID: MULTICLOUD-1260 Signed-off-by: Todd Malsbary Change-Id: I869823cc062968c8ac7b9fa037d425244a03799c --- diff --git a/kud/tests/sriov.sh b/kud/tests/sriov.sh index 2dea576e..e617ea62 100755 --- a/kud/tests/sriov.sh +++ b/kud/tests/sriov.sh @@ -10,17 +10,12 @@ set -o pipefail -ethernet_adpator_version=$( lspci | grep "Ethernet Controller XL710" | head -n 1 | cut -d " " -f 8 ) -if [ -z "$ethernet_adpator_version" ]; then - echo " Ethernet adapator version is not set. SRIOV test case cannot run on this machine" +sriov_capable_nodes=$(kubectl get nodes -o json | jq -r '.items[] | select(.status.capacity."intel.com/intel_sriov_700">="2") | .metadata.name') +if [ -z "$sriov_capable_nodes" ]; then + echo "SRIOV test case cannot run on the cluster." exit 0 -fi -#checking for the right hardware version of NIC on the machine -if [ $ethernet_adpator_version == "XL710" ]; then - echo "NIC card specs match. SRIOV option avaiable for this version." else - echo -e "Failed. The version supplied does not match.\nTest cannot be executed." - exit 0 + echo "SRIOV option avaiable in the cluster." fi pod_name=pod-case-01