-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ETHTOOL Ring option is not supported by NetworkManager until NM 1.25.2. Currently, ETHTOOL Ring option is not suppored by Network role, so enable the support for ETHTOOL Ring option. Configure ethtool ring option via: ```yaml network_connections: - name: testnic1 type: ethernet state: up ip: dhcp4: no auto6: no ethtool: ring: rx: 128 rx_jumbo: 128 rx_mini: 128 tx: 128 ``` Signed-off-by: Wen Liang <[email protected]>
- Loading branch information
1 parent
13e7f8a
commit 6e36cc0
Showing
10 changed files
with
354 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
--- | ||
- hosts: all | ||
tasks: | ||
- include_role: | ||
name: linux-system-roles.network | ||
vars: | ||
network_connections: | ||
- name: "{{ network_interface_name1 }}" | ||
state: up | ||
type: ethernet | ||
ip: | ||
dhcp4: no | ||
auto6: no | ||
ethtool: | ||
ring: | ||
rx: 128 | ||
rx_jumbo: 128 | ||
rx_mini: 128 | ||
tx: 128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
--- | ||
- hosts: all | ||
vars: | ||
interface: testnic1 | ||
type: veth | ||
tasks: | ||
- debug: | ||
msg: "this is: playbooks/tests_ethtool_ring.yml" | ||
tags: | ||
- always | ||
|
||
- name: "INIT: Ethtool ring tests" | ||
debug: | ||
msg: "##################################################" | ||
- include_tasks: tasks/show_interfaces.yml | ||
- include_tasks: tasks/manage_test_interface.yml | ||
vars: | ||
state: present | ||
- include_tasks: tasks/assert_device_present.yml | ||
- name: Install ethtool (test dependency) | ||
package: | ||
name: ethtool | ||
state: present | ||
|
||
- block: | ||
- name: >- | ||
TEST: I can create a profile without any ring option. | ||
debug: | ||
msg: "##################################################" | ||
- import_role: | ||
name: linux-system-roles.network | ||
vars: | ||
network_connections: | ||
- name: "{{ interface }}" | ||
type: ethernet | ||
state: up | ||
ip: | ||
dhcp4: no | ||
auto6: no | ||
|
||
- name: Get profile's ring options | ||
command: nmcli -g ethtool.ring-rx c show {{ interface }} | ||
register: no_ring_nm | ||
when: | ||
- network_provider == "nm" | ||
- name: "ASSERT: The profile does not contain ring options" | ||
assert: | ||
that: no_ring_nm.stdout | length == 0 | ||
when: | ||
- network_provider == "nm" | ||
- name: Get profile's ring options | ||
command: | ||
grep ETHTOOL /etc/sysconfig/network-scripts/ifcfg-{{ interface }} | ||
register: no_ring_initscripts | ||
ignore_errors: true | ||
when: | ||
- network_provider == "initscripts" | ||
- name: "ASSERT: The profile does not contain ring options" | ||
assert: | ||
that: no_ring_initscripts.stdout | length == 0 | ||
when: | ||
- network_provider == "initscripts" | ||
|
||
- name: >- | ||
TEST: I can set rx. | ||
debug: | ||
msg: "##################################################" | ||
- import_role: | ||
name: linux-system-roles.network | ||
vars: | ||
network_connections: | ||
- name: "{{ interface }}" | ||
type: ethernet | ||
state: up | ||
ip: | ||
dhcp4: no | ||
auto6: no | ||
ethtool: | ||
ring: | ||
rx: 128 | ||
rx_jumbo: 128 | ||
rx_mini: 128 | ||
tx: 128 | ||
|
||
- name: Get profile's ethtool.ring-rx options | ||
command: nmcli -g ethtool.ring-rx c show {{ interface }} | ||
register: with_ring_rx | ||
when: | ||
- network_provider == "nm" | ||
- name: Assert ethtool.ring-rx option set in profile | ||
assert: | ||
that: with_ring_rx.stdout == '128' | ||
when: | ||
- network_provider == "nm" | ||
- name: Get profile's ethtool.ring-rx-jumbo options | ||
command: nmcli -g ethtool.ring-rx-jumbo c show {{ interface }} | ||
register: with_ring_rx_jumbo | ||
when: | ||
- network_provider == "nm" | ||
- name: Assert ethtool.ring-rx-jumbo option set in profile | ||
assert: | ||
that: with_ring_rx_jumbo.stdout == '128' | ||
when: | ||
- network_provider == "nm" | ||
- name: Get profile's ethtool.ring-rx-mini options | ||
command: nmcli -g ethtool.ring-rx-mini c show {{ interface }} | ||
register: with_ring_rx_mini | ||
when: | ||
- network_provider == "nm" | ||
- name: Assert ethtool.ring-rx-mini option set in profile | ||
assert: | ||
that: with_ring_rx_mini.stdout == '128' | ||
when: | ||
- network_provider == "nm" | ||
- name: Get profile's ethtool.ring-tx options | ||
command: nmcli -g ethtool.ring-tx c show {{ interface }} | ||
register: with_ring_tx | ||
when: | ||
- network_provider == "nm" | ||
- name: Assert ethtool.ring-tx option set in profile | ||
assert: | ||
that: with_ring_tx.stdout == '128' | ||
when: | ||
- network_provider == "nm" | ||
|
||
- name: Get profile's ethtool.ring options | ||
command: | ||
grep ETHTOOL /etc/sysconfig/network-scripts/ifcfg-{{ interface }} | ||
register: with_ring | ||
ignore_errors: true | ||
when: | ||
- network_provider == "initscripts" | ||
- name: Assert ethtool.ring option set in profile | ||
assert: | ||
that: | ||
- '"rx 128" in with_ring.stdout' | ||
- '"rx-jumbo 128" in with_ring.stdout' | ||
- '"rx-mini 128" in with_ring.stdout' | ||
- '"tx 128" in with_ring.stdout' | ||
when: | ||
- network_provider == "initscripts" | ||
|
||
- name: "TEST: I can clear ring options" | ||
debug: | ||
msg: "##################################################" | ||
- import_role: | ||
name: linux-system-roles.network | ||
vars: | ||
network_connections: | ||
- name: "{{ interface }}" | ||
type: ethernet | ||
state: up | ||
ip: | ||
dhcp4: no | ||
auto6: no | ||
|
||
- name: Get profile's ring options | ||
command: nmcli -g ethtool.ring-rx c show {{ interface }} | ||
register: clear_ring_nm | ||
when: | ||
- network_provider == "nm" | ||
- name: "ASSERT: The profile does reset ring options" | ||
assert: | ||
that: clear_ring_nm.stdout | length == 0 | ||
when: | ||
- network_provider == "nm" | ||
- name: Get profile's ring options | ||
command: | ||
grep ETHTOOL /etc/sysconfig/network-scripts/ifcfg-{{ interface }} | ||
register: clear_ring_initscripts | ||
ignore_errors: true | ||
when: | ||
- network_provider == "initscripts" | ||
- name: "ASSERT: The profile does reset ring options" | ||
assert: | ||
that: clear_ring_initscripts.stdout | length == 0 | ||
when: | ||
- network_provider == "initscripts" | ||
|
||
always: | ||
- block: | ||
- import_role: | ||
name: linux-system-roles.network | ||
vars: | ||
network_connections: | ||
- name: "{{ interface }}" | ||
persistent_state: absent | ||
ignore_errors: true | ||
- include_tasks: tasks/manage_test_interface.yml | ||
vars: | ||
state: absent | ||
tags: | ||
- "tests::cleanup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# This file was generated by ensure_provider_tests.py | ||
--- | ||
- hosts: all | ||
name: Run playbook 'playbooks/tests_ethtool_ring.yml' with initscripts as provider | ||
tasks: | ||
- name: Set network provider to 'initscripts' | ||
set_fact: | ||
network_provider: initscripts | ||
tags: | ||
- always | ||
|
||
- import_playbook: playbooks/tests_ethtool_ring.yml |
Oops, something went wrong.