infiniband: Add the integration tests

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2022-04-11 17:20:50 -04:00 committed by Fernando Fernández Mancera
parent cb3e23ac5d
commit 6927dc39f7
4 changed files with 108 additions and 0 deletions

6
.github/run_test.sh vendored
View file

@ -11,11 +11,13 @@ PODMAN_OPTS="--systemd=true --privileged"
# exclude bond tests since missing the bonding kernel module
# exclude tests/tests_wireless_nm.yml since failing to load mac80211_hwsim kernel
# module to mock a wifi network
# exclude tests/tests_infiniband_nm.yml since missing the infiniband device
EXCLUDE_TESTS_C7='
-e tests/tests_auto_gateway_initscripts.yml
-e tests/tests_bond_deprecated_initscripts.yml
-e tests/tests_bond_initscripts.yml
-e tests/tests_bond_removal_initscripts.yml
-e tests/tests_infiniband_nm.yml
-e tests/tests_team_nm.yml
-e tests/tests_unit.yml
-e tests/tests_wireless_nm.yml
@ -24,11 +26,13 @@ EXCLUDE_TESTS_C7='
# exclude bond tests since missing the bonding kernel module
# exclude tests/tests_wireless_wpa3_owe_nm.yml and tests/tests_wireless_wpa3_sae_nm.yml
# since failing to install mac80211_hwsim kernel module
# exclude tests/tests_infiniband_nm.yml since missing the infiniband device
EXCLUDE_TESTS_C8S='
-e tests/tests_auto_gateway_initscripts.yml
-e tests/tests_bond_deprecated_initscripts.yml
-e tests/tests_bond_initscripts.yml
-e tests/tests_bond_removal_initscripts.yml
-e tests/tests_infiniband_nm.yml
-e tests/tests_integration_pytest.yml
-e tests/tests_team_nm.yml
-e tests/tests_unit.yml
@ -40,7 +44,9 @@ EXCLUDE_TESTS_C8S='
# network-scripts available
# exclude tests/tests_wireless_wpa3_owe_nm.yml and tests/tests_wireless_wpa3_sae_nm.yml
# since failing to install mac80211_hwsim kernel module
# exclude tests/tests_infiniband_nm.yml since missing the infiniband device
EXCLUDE_TESTS_C9S='
-e tests/tests_infiniband_nm.yml
-e tests/tests_provider_nm.yml
-e tests/tests_regression_nm.yml
-e tests/tests_team_nm.yml

View file

@ -70,6 +70,7 @@ ibution_major_version | int < 9",
"playbooks/tests_bond_options.yml": {},
"playbooks/tests_eth_dns_support.yml": {},
"playbooks/tests_dummy.yml": {},
"playbooks/tests_infiniband.yml": {},
"playbooks/tests_ipv6_disabled.yml": {},
"playbooks/tests_ipv6_dns_search.yml": {},
"playbooks/tests_provider.yml": {

View file

@ -0,0 +1,81 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
tasks:
- block:
- name: TEST Configuring infiniband devices
debug:
msg: "##################################################"
- name: Setup the IP over the infiniband device
import_role:
name: linux-system-roles.network
vars:
network_connections:
- name: ib0
type: infiniband
interface_name: ib0
- name: ib0-10
type: infiniband
autoconnect: yes
infiniband:
p_key: 10
transport_mode: datagram
parent: ib0
state: up
ip:
dhcp4: no
auto6: no
address:
- 198.51.100.133/30
- 2001:db8::2/32
- name: Get the details for the virtual device ib0.000a
command: ip -d a s ib0.000a
register: virtual_device_setting
ignore_errors: yes
changed_when: false
- name: Assert that the settings in the virtual device
ib0.000a match the specified settings
assert:
that:
- virtual_device_setting.stdout is search("ipoib pkey 0x800a mode
datagram")
msg: the settings in the virtual device ib0.000a
match the specified settings
- command: ip -4 a s ib0.000a
name: "** TEST check IPv4"
register: result
until: "'198.51.100.133/30' in result.stdout"
retries: 20
delay: 2
- command: ip -6 a s ib0.000a
name: "** TEST check IPv6"
register: result
until: "'2001:db8::2/32' in result.stdout"
retries: 20
delay: 2
always:
- block:
- name: Import network role
import_role:
name: linux-system-roles.network
vars:
network_connections:
- name: ib0
persistent_state: absent
state: down
- name: ib0-10
persistent_state: absent
state: down
ignore_errors: true
- command: ip link del ib0.000a
ignore_errors: true
tags:
- "tests::cleanup"
tags:
- "tests::infiniband"

View file

@ -0,0 +1,20 @@
# SPDX-License-Identifier: BSD-3-Clause
# This file was generated by ensure_provider_tests.py
---
# set network provider and gather facts
- hosts: all
name: Run playbook 'playbooks/tests_infiniband.yml' with nm as provider
tasks:
- include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
tags:
- always
# The test requires or should run with NetworkManager, therefore it cannot run
# on RHEL/CentOS 6
- import_playbook: playbooks/tests_infiniband.yml
when:
- ansible_distribution_major_version != '6'