Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USHIFT-3489: multi-nic change for QE env #4031

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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 test/scenarios-bootc/presubmits/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ scenario_run_tests() {
local -r vmname=$(full_vm_name host1)
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1)
local -r nic1_name=$(run_command_on_vm host1 nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort | head -1)
local -r nic2_name=$(run_command_on_vm host1 nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
--variable "NIC1_NAME:${nic1_name}" \
--variable "NIC2_NAME:${nic2_name}" \
suites/network/multi-nic.robot
}
4 changes: 4 additions & 0 deletions test/scenarios-bootc/presubmits/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ scenario_run_tests() {
local -r vmname=$(full_vm_name host1)
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1)
local -r nic1_name=$(run_command_on_vm host1 nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort | head -1)
local -r nic2_name=$(run_command_on_vm host1 nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
--variable "NIC1_NAME:${nic1_name}" \
--variable "NIC2_NAME:${nic2_name}" \
suites/network/multi-nic.robot
}
4 changes: 4 additions & 0 deletions test/scenarios/presubmits/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ scenario_run_tests() {
local -r vmname=$(full_vm_name host1)
local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1)
local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1)
local -r nic1_name=$(run_command_on_vm host1 nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort | head -1)
local -r nic2_name=$(run_command_on_vm host1 nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort | tail -1)

run_tests host1 \
--variable "USHIFT_HOST_IP1:${vm_ip1}" \
--variable "USHIFT_HOST_IP2:${vm_ip2}" \
--variable "NIC1_NAME:${nic1_name}" \
--variable "NIC2_NAME:${nic2_name}" \
suites/network/multi-nic.robot
}
24 changes: 5 additions & 19 deletions test/suites/network/multi-nic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ${USHIFT_HOST_IP2} ${EMPTY}
${NIC1_NAME} ${EMPTY}
${NIC2_NAME} ${EMPTY}
${NICS_COUNT} 2
${NMCLI_CMD} nmcli -f name,type connection | awk '$2 == "ethernet" {print $1}' | sort
${NMCLI_CMD} nmcli connection | grep ethernet
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you change the command?

${OSSL_CMD} openssl x509 -text -noout -in
${CERT_FILE} /var/lib/microshift/certs/kube-apiserver-external-signer/kube-external-serving/server.crt
${GREP_SUBJ_IPS} grep -A1 'Subject Alternative Name:' | tail -1
Expand Down Expand Up @@ -105,37 +105,23 @@ Verify Multiple NICs
... ${NMCLI_CMD} | wc -l
... return_stdout=True return_stderr=True return_rc=True
Should Be Equal As Integers ${rc} 0
Should Be Equal As Strings ${stdout} ${NICS_COUNT}
Should Be True '${stdout}'>='${NICS_COUNT}'

Initialize Global Variables
[Documentation] Initializes global variables.

Log Host: ${USHIFT_HOST_IP1} ${USHIFT_HOST_IP2}
Should Not Be Empty ${USHIFT_HOST_IP1} USHIFT_HOST_IP1 variable is required
Should Not Be Empty ${USHIFT_HOST_IP2} USHIFT_HOST_IP2 variable is required
Initialize Nmcli Variables

Initialize Nmcli Variables
[Documentation] Initialize the variables on the host

${stdout} ${stderr} ${rc}= Execute Command
... ${NMCLI_CMD} | head -1
... return_stdout=True return_stderr=True return_rc=True
Should Be Equal As Integers ${rc} 0
Set Suite Variable \${NIC1_NAME} ${stdout}

${stdout} ${stderr} ${rc}= Execute Command
... ${NMCLI_CMD} | tail -1
... return_stdout=True return_stderr=True return_rc=True
Should Be Equal As Integers ${rc} 0
Set Suite Variable \${NIC2_NAME} ${stdout}
Should Not Be Empty ${NIC1_NAME} NIC1_NAME variable is required
Should Not Be Empty ${NIC2_NAME} NIC2_NAME variable is required

Disable Interface
[Documentation] Disable NIC given in ${conn_name}. Change is not persistent. On
... the next reboot the interface will have its original status again.
[Arguments] ${conn_name}
${stderr} ${rc}= Execute Command
... nmcli connection down ${conn_name}
... nmcli connection down "${conn_name}"
... sudo=True return_stdout=False return_stderr=True return_rc=True
Should Be Equal As Integers ${rc} 0

Expand Down