Created
September 9, 2020 23:52
-
-
Save richm/7c8b99bb9015ccb515eb625b4ad28c90 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
./examples/bond_simple.yml.lsrout | |
./examples/wireless_wpa_psk.yml.lsrout | |
./examples/eth_with_802_1x.yml.lsrout | |
--- ./examples/macvlan.yml 2020-09-03 18:14:44.302820045 -0600 | |
+++ ./examples/macvlan.yml.lsrout 2020-09-09 17:48:30.434693683 -0600 | |
@@ -18,10 +18,10 @@ | |
state: up | |
parent: eth0 | |
macvlan: | |
mode: bridge | |
- promiscuous: True | |
- tap: False | |
+ promiscuous: true | |
+ tap: false | |
ip: | |
address: | |
- 192.168.1.1/24 | |
./examples/macvlan.yml.lsrout | |
./examples/bond_with_vlan.yml.lsrout | |
./examples/ethtool_features_default.yml.lsrout | |
./examples/bridge_with_vlan.yml.lsrout | |
./examples/infiniband.yml.lsrout | |
./examples/ethtool_features.yml.lsrout | |
./examples/down_profile.yml.lsrout | |
./examples/remove_profile.yml.lsrout | |
./examples/eth_with_vlan.yml.lsrout | |
./examples/remove+down_profile.yml.lsrout | |
./examples/eth_simple_auto.yml.lsrout | |
./tests/tests_provider_nm.yml.lsrout | |
--- ./tests/tests_unit.yml 2020-09-03 18:14:44.306820069 -0600 | |
+++ ./tests/tests_unit.yml.lsrout 2020-09-09 17:48:31.317698996 -0600 | |
@@ -4,9 +4,10 @@ | |
name: Setup for test running | |
tasks: | |
- name: Install EPEL on enterprise Linux for python2-mock | |
# yamllint disable-line rule:line-length | |
- command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm | |
+ command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ | |
+ ansible_distribution_major_version }}.noarch.rpm | |
args: | |
warn: false | |
creates: /etc/yum.repos.d/epel.repo | |
when: | |
@@ -86,6 +87,5 @@ | |
- name: Ensure that at least one python unit test ran | |
fail: | |
msg: Tests did not run with python2 or python3 | |
- when: not python2_available is succeeded and | |
- not python3_available is succeeded | |
+ when: not python2_available is succeeded and not python3_available is succeeded | |
./tests/tests_unit.yml.lsrout | |
./tests/tests_802_1x_nm.yml.lsrout | |
./tests/tests_ethtool_features_nm.yml.lsrout | |
./tests/tests_bridge_initscripts.yml.lsrout | |
./tests/tests_vlan_mtu_nm.yml.lsrout | |
./tests/tests_bond_initscripts.yml.lsrout | |
./tests/tests_vlan_mtu_initscripts.yml.lsrout | |
./tests/tests_default.yml.lsrout | |
./tests/tests_regression_nm.yml.lsrout | |
./tests/tests_bridge_nm.yml.lsrout | |
./tests/tests_ethernet_nm.yml.lsrout | |
./tests/tests_states_initscripts.yml.lsrout | |
./tests/tests_helpers_and_asserts.yml.lsrout | |
./tests/tests_ethernet_initscripts.yml.lsrout | |
./tests/tests_ethtool_features_initscripts.yml.lsrout | |
./tests/tasks/assert_output_in_stderr_without_warnings.yml.lsrout | |
./tests/tasks/create_and_remove_interface.yml.lsrout | |
--- ./tests/tasks/setup_802_1x_server.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/tasks/setup_802_1x_server.yml.lsrout 2020-09-09 17:48:32.437705734 -0600 | |
@@ -1,9 +1,10 @@ | |
# SPDX-License-Identifier: BSD-3-Clause | |
--- | |
- name: Install EPEL on enterprise Linux for hostapd | |
# yamllint disable-line rule:line-length | |
- command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm | |
+ command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ | |
+ ansible_distribution_major_version }}.noarch.rpm | |
args: | |
warn: false | |
creates: /etc/yum.repos.d/epel.repo | |
when: | |
@@ -50,9 +51,9 @@ | |
ip netns exec ns1 ip link set veth1 up | |
ip link set veth2 up | |
- # Enable forwarding of EAP 802.1x messages through software bridge "br1". | |
+ # Enable forwarding of EAP 802.1x messages through software bridge "br1". | |
echo 8 > /sys/class/net/br1/bridge/group_fwd_mask | |
- name: Create hostapd config | |
copy: | |
./tests/tasks/setup_802_1x_server.yml.lsrout | |
./tests/tasks/cleanup_profile+device.yml.lsrout | |
./tests/tasks/assert_profile_present.yml.lsrout | |
--- ./tests/tasks/create_test_interfaces_with_dhcp.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/tasks/create_test_interfaces_with_dhcp.yml.lsrout 2020-09-09 17:48:31.526700253 -0600 | |
@@ -7,64 +7,64 @@ | |
- name: Create test interfaces | |
shell: | | |
- # NM to see veth devices starting with test* as managed after ip add.. | |
+ # NM to see veth devices starting with test* as managed after ip add.. | |
echo 'ENV{ID_NET_DRIVER}=="veth",\ | |
ENV{INTERFACE}=="test*", \ | |
ENV{NM_UNMANAGED}="0"' >/etc/udev/rules.d/88-veth.rules | |
udevadm control --reload-rules | |
udevadm settle --timeout=5 | |
- # Setuptwo devices with IPv4/IPv6 auto support | |
+ # Setuptwo devices with IPv4/IPv6 auto support | |
ip link add {{dhcp_interface1}} type veth peer name {{dhcp_interface1}}p | |
ip link set {{dhcp_interface1}}p up | |
ip link add {{dhcp_interface2}} type veth peer name {{dhcp_interface2}}p | |
ip link set {{dhcp_interface2}}p up | |
- # Create the 'testbr' - providing both 10.x ipv4 and 2620:52:0 ipv6 dhcp | |
+ # Create the 'testbr' - providing both 10.x ipv4 and 2620:52:0 ipv6 dhcp | |
ip link add name testbr type bridge forward_delay 0 | |
ip link set testbr up | |
ip addr add 192.0.2.1/24 dev testbr | |
ip -6 addr add 2001:DB8::1/32 dev testbr | |
if grep 'release 6' /etc/redhat-release; then | |
- # We need bridge-utils and radvd only in rhel6 | |
+ # We need bridge-utils and radvd only in rhel6 | |
if ! rpm -q --quiet radvd; then yum -y install radvd; fi | |
if ! rpm -q --quiet bridge-utils; then yum -y install bridge-utils; fi | |
- # We need to add iptables rule to allow dhcp request | |
+ # We need to add iptables rule to allow dhcp request | |
iptables -I INPUT -i testbr -p udp --dport 67:68 --sport 67:68 -j ACCEPT | |
- # Add {{dhcp_interface1}}, {{dhcp_interface2}} peers into the testbr | |
+ # Add {{dhcp_interface1}}, {{dhcp_interface2}} peers into the testbr | |
brctl addif testbr {{dhcp_interface1}}p | |
brctl addif testbr {{dhcp_interface2}}p | |
- # in RHEL6 /run is not present | |
+ # in RHEL6 /run is not present | |
mkdir -p /run | |
- # and dnsmasq does not support ipv6 | |
+ # and dnsmasq does not support ipv6 | |
dnsmasq \ | |
--pid-file=/run/dhcp_testbr.pid \ | |
--dhcp-leasefile=/run/dhcp_testbr.lease \ | |
--dhcp-range=192.0.2.1,192.0.2.254,240 \ | |
--interface=testbr --bind-interfaces | |
- # start radvd for ipv6 | |
+ # start radvd for ipv6 | |
echo 'interface testbr {' > /etc/radvd.conf | |
echo ' AdvSendAdvert on;' >> /etc/radvd.conf | |
echo ' prefix 2001:DB8::/64 { ' >> /etc/radvd.conf | |
echo ' AdvOnLink on; }; ' >> /etc/radvd.conf | |
echo ' }; ' >> /etc/radvd.conf | |
- # enable ipv6 forwarding | |
+ # enable ipv6 forwarding | |
sysctl -w net.ipv6.conf.all.forwarding=1 | |
service radvd restart | |
else | |
ip link set {{dhcp_interface1}}p master testbr | |
ip link set {{dhcp_interface2}}p master testbr | |
- # Run joint DHCP4/DHCP6 server with RA enabled in veth namespace | |
+ # Run joint DHCP4/DHCP6 server with RA enabled in veth namespace | |
dnsmasq \ | |
--pid-file=/run/dhcp_testbr.pid \ | |
--dhcp-leasefile=/run/dhcp_testbr.lease \ | |
--dhcp-range=192.0.2.1,192.0.2.254,240 \ | |
./tests/tasks/create_test_interfaces_with_dhcp.yml.lsrout | |
--- ./tests/tasks/setup_mock_wifi.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/tasks/setup_mock_wifi.yml.lsrout 2020-09-09 17:48:31.951702810 -0600 | |
@@ -1,9 +1,10 @@ | |
# SPDX-License-Identifier: BSD-3-Clause | |
--- | |
- name: Install EPEL on enterprise Linux for hostapd | |
# yamllint disable-line rule:line-length | |
- command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm | |
+ command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ | |
+ ansible_distribution_major_version }}.noarch.rpm | |
args: | |
warn: false | |
creates: /etc/yum.repos.d/epel.repo | |
when: | |
./tests/tasks/setup_mock_wifi.yml.lsrout | |
./tests/tasks/provider/create_with_nm.yml.lsrout | |
./tests/tasks/provider/create_and_remove_with_initscripts.yml.lsrout | |
./tests/tasks/provider/default_with_nm.yml.lsrout | |
./tests/tasks/assert_device_absent.yml.lsrout | |
./tests/tasks/assert_device_present.yml.lsrout | |
./tests/tasks/activate_profile.yml.lsrout | |
--- ./tests/tasks/manage_test_interface.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/tasks/manage_test_interface.yml.lsrout 2020-09-09 17:48:32.631706901 -0600 | |
@@ -17,33 +17,27 @@ | |
# veth | |
- name: Create veth interface {{ interface }} | |
command: ip link add {{ interface }} type veth peer name peer{{ interface }} | |
- when: "type == 'veth' and state == 'present' and | |
- interface not in current_interfaces" | |
+ when: "type == 'veth' and state == 'present' and interface not in current_interfaces" | |
- name: Delete veth interface {{ interface }} | |
command: ip link del {{ interface }} type veth | |
- when: "type == 'veth' and state == 'absent' and | |
- interface in current_interfaces" | |
+ when: "type == 'veth' and state == 'absent' and interface in current_interfaces" | |
# dummy | |
- name: Create dummy interface {{ interface }} | |
command: ip link add "{{ interface }}" type dummy | |
- when: "type == 'dummy' and state == 'present' and | |
- interface not in current_interfaces" | |
+ when: "type == 'dummy' and state == 'present' and interface not in current_interfaces" | |
- name: Delete dummy interface {{ interface }} | |
command: ip link del "{{ interface }}" type dummy | |
- when: "type == 'dummy' and state == 'absent' and | |
- interface in current_interfaces" | |
+ when: "type == 'dummy' and state == 'absent' and interface in current_interfaces" | |
# tap | |
- name: Create tap interface {{ interface }} | |
command: ip tuntap add dev {{ interface }} mode tap | |
- when: "type == 'tap' and state == 'present' | |
- and interface not in current_interfaces" | |
+ when: "type == 'tap' and state == 'present' and interface not in current_interfaces" | |
- name: Delete tap interface {{ interface }} | |
command: ip tuntap del dev {{ interface }} mode tap | |
- when: "type == 'tap' and state == 'absent' and | |
- interface in current_interfaces" | |
+ when: "type == 'tap' and state == 'absent' and interface in current_interfaces" | |
./tests/tasks/manage_test_interface.yml.lsrout | |
--- ./tests/tasks/remove_test_interfaces_with_dhcp.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/tasks/remove_test_interfaces_with_dhcp.yml.lsrout 2020-09-09 17:48:32.124703851 -0600 | |
@@ -5,9 +5,9 @@ | |
ip link delete {{dhcp_interface1}} | |
ip link delete {{dhcp_interface2}} | |
ip link delete testbr | |
- # Remove udev rule for NM to see veth devices starting with test*..... | |
+ # Remove udev rule for NM to see veth devices starting with test*..... | |
rm -rf /etc/udev/rules.d/88-veth.rules | |
udevadm control --reload-rules | |
udevadm settle --timeout=5 | |
@@ -17,9 +17,9 @@ | |
pkill -F /run/dhcp_testbr.pid | |
rm -rf /run/dhcp_testbr.pid | |
rm -rf /run/dhcp_testbr.lease | |
if grep 'release 6' /etc/redhat-release; then | |
- # Stop radvd server | |
+ # Stop radvd server | |
service radvd stop | |
iptables -D INPUT -i testbr -p udp --dport 67:68 --sport 67:68 -j ACCEPT | |
fi | |
./tests/tasks/remove_test_interfaces_with_dhcp.yml.lsrout | |
./tests/tasks/get_profile_stat.yml.lsrout | |
./tests/tasks/create_bridge_profile_no_autoconnect.yml.lsrout | |
./tests/tasks/get_interface_stat.yml.lsrout | |
./tests/tasks/setup_test_interface.yml.lsrout | |
./tests/tasks/get_NetworkManager_NVR.yml.lsrout | |
./tests/tasks/setup_802.1x.yml.lsrout | |
./tests/tasks/cleanup_802_1x_server.yml.lsrout | |
./tests/tasks/run_test.yml.lsrout | |
./tests/tasks/remove_profile.yml.lsrout | |
./tests/tasks/create_bridge_profile.yml.lsrout | |
./tests/tasks/show_interfaces.yml.lsrout | |
./tests/tasks/get_current_interfaces.yml.lsrout | |
./tests/tasks/remove+down_profile.yml.lsrout | |
./tests/tasks/assert_profile_absent.yml.lsrout | |
./tests/tasks/delete_interface.yml.lsrout | |
./tests/tasks/cleanup_mock_wifi.yml.lsrout | |
--- ./tests/tasks/test_802.1x_capath.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/tasks/test_802.1x_capath.yml.lsrout 2020-09-09 17:48:31.846702178 -0600 | |
@@ -28,10 +28,9 @@ | |
src: "cacert.pem" | |
dest: "/etc/pki/tls/my_ca_certs/cacert.pem" | |
mode: 0644 | |
- name: Hash cacert | |
- command: openssl x509 -hash -noout | |
- -in /etc/pki/tls/my_ca_certs/cacert.pem | |
+ command: openssl x509 -hash -noout -in /etc/pki/tls/my_ca_certs/cacert.pem | |
register: cacert_hash | |
- name: Add symlink for cacert | |
file: | |
state: link | |
@@ -82,18 +81,16 @@ | |
vars: | |
expected_failure: __network_NM_NVR.stdout in __NM_capath_ignored_NVRs | |
failure: __network_connections_result.failed | |
assert: | |
- that: (failure and expected_failure) or | |
- (not failure and not expected_failure) | |
- msg: "Role {{ failure and 'failed' or 'did not fail' }} but was expected | |
- {{ expected_failure and '' or 'not' }} to fail. | |
- NM NVR: {{ __network_NM_NVR.stdout }}" | |
+ that: (failure and expected_failure) or (not failure and not expected_failure) | |
+ msg: "Role {{ failure and 'failed' or 'did not fail' }} but was expected\ | |
+ \ {{ expected_failure and '' or 'not' }} to fail. NM NVR: {{ __network_NM_NVR.stdout\ | |
+ \ }}" | |
- name: Assert role failure | |
assert: | |
- that: " | |
- 'ieee802_1x.ca_path specified but not supported by NetworkManager' | |
- in __network_connections_result.stderr" | |
+ that: " 'ieee802_1x.ca_path specified but not supported by NetworkManager'\ | |
+ \ in __network_connections_result.stderr" | |
when: | |
- __network_connections_result.failed | |
./tests/tasks/test_802.1x_capath.yml.lsrout | |
--- ./tests/get_coverage.yml 2020-09-03 18:14:44.304820057 -0600 | |
+++ ./tests/get_coverage.yml.lsrout 2020-09-09 17:48:31.447699778 -0600 | |
@@ -15,17 +15,15 @@ | |
# This uses variables from the other set_fact task, therefore it needs to | |
# be its own task | |
- name: set more facts | |
set_fact: | |
- coverage_file: | |
- # yamllint disable-line rule:line-length | |
- ansible-coverage-{{ coverage_module }}-{{ test_playbook|replace('.yml', '') }} | |
+ coverage_file: ansible-coverage-{{ coverage_module }}-{{ test_playbook|replace('.yml', | |
+ '') }} | |
- name: debug info | |
debug: | |
- msg: | |
- # yamllint disable-line rule:line-length | |
- Getting coverage for '{{ coverage_module }}' with '{{ test_playbook }}' | |
+ msg: Getting coverage for '{{ coverage_module }}' with '{{ test_playbook | |
+ }}' | |
# combine data in case old data is left there | |
- command: "{{ coverage }} combine" | |
environment: | |
@@ -61,11 +59,9 @@ | |
extra_args: --user --upgrade | |
- import_playbook: "{{ test_playbook }}" | |
vars: | |
- ansible_python_interpreter: | |
- # yamllint disable-line rule:line-length | |
- "{{ coverage }} run -p --include /*/modules/network_connections.py,/*/module_utils/network_lsr/*" | |
+ ansible_python_interpreter: "{{ coverage }} run -p --include /*/modules/network_connections.py,/*/module_utils/network_lsr/*" | |
- name: Gather coverage data | |
hosts: all | |
tasks: | |
./tests/get_coverage.yml.lsrout | |
./tests/tests_802_1x_updated_nm.yml.lsrout | |
./tests/playbooks/tests_bond.yml.lsrout | |
--- ./tests/playbooks/tests_provider.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/playbooks/tests_provider.yml.lsrout 2020-09-09 17:48:33.232710517 -0600 | |
@@ -16,10 +16,10 @@ | |
- block: | |
- include_tasks: tasks/run_test.yml | |
vars: | |
state: present | |
- lsr_description: I can manage a veth interface with NM after I | |
- managed it with initscripts. | |
+ lsr_description: I can manage a veth interface with NM after I managed | |
+ it with initscripts. | |
lsr_setup: | |
- tasks/setup_test_interface.yml | |
# run role once with defaults but nm provider to ensure that | |
# NetworKManager is running | |
./tests/playbooks/tests_provider.yml.lsrout | |
--- ./tests/playbooks/tests_reapply.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/playbooks/tests_reapply.yml.lsrout 2020-09-09 17:48:34.411717610 -0600 | |
@@ -31,9 +31,9 @@ | |
auto6: false | |
- include_tasks: tasks/assert_device_present.yml | |
- include_tasks: tasks/assert_profile_present.yml | |
# Use internal module to get output | |
- - network_connections: | |
+ - fedora.system_roles.network_connections: | |
provider: nm | |
connections: | |
- name: "{{ interface }}" | |
state: up | |
@@ -53,9 +53,9 @@ | |
that: "{{ 'connection reapplied' in test_module_run.stderr }}" | |
always: | |
- block: | |
# Use internal module directly for speedup | |
- - network_connections: | |
+ - fedora.system_roles.network_connections: | |
provider: nm | |
connections: | |
- name: "{{ interface }}" | |
persistent_state: absent | |
./tests/playbooks/tests_reapply.yml.lsrout | |
./tests/playbooks/tests_vlan_mtu.yml.lsrout | |
--- ./tests/playbooks/tests_ethtool_features.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/playbooks/tests_ethtool_features.yml.lsrout 2020-09-09 17:48:34.153716057 -0600 | |
@@ -79,16 +79,16 @@ | |
- name: Assert device features | |
assert: | |
that: | |
- >- | |
- 'generic-receive-offload: off' in | |
- ethtool_features.stdout_lines | |
+ 'generic-receive-offload: off' in | |
+ ethtool_features.stdout_lines | |
- >- | |
- 'generic-segmentation-offload: on' in | |
- ethtool_features.stdout_lines | |
+ 'generic-segmentation-offload: on' in | |
+ ethtool_features.stdout_lines | |
- >- | |
- 'tx-tcp-segmentation: off' in | |
- ethtool_features.stdout_lines | map('trim') | |
+ 'tx-tcp-segmentation: off' in | |
+ ethtool_features.stdout_lines | map('trim') | |
- name: >- | |
TEST: I can enable tx_tcp_segmentation (using underscores). | |
@@ -116,20 +116,20 @@ | |
- name: Assert device features | |
assert: | |
that: | |
- >- | |
- 'tx-tcp-segmentation: on' in | |
- ethtool_features.stdout_lines | map('trim') | |
+ 'tx-tcp-segmentation: on' in | |
+ ethtool_features.stdout_lines | map('trim') | |
- - name: I cannot change tx_tcp_segmentation and tx-tcp-segmentation at | |
- the same time. | |
+ - name: I cannot change tx_tcp_segmentation and tx-tcp-segmentation at the | |
+ same time. | |
block: | |
- name: >- | |
TEST: Change feature with both underscores and dashes. | |
debug: | |
msg: "##################################################" | |
- - network_connections: | |
+ - fedora.system_roles.network_connections: | |
provider: "{{ network_provider | mandatory }}" | |
connections: | |
- name: "{{ interface }}" | |
state: up | |
@@ -147,12 +147,11 @@ | |
debug: | |
var: __network_connections_result | |
- assert: | |
that: | |
- - '{{ "fatal error: configuration error: | |
- connections[0].ethtool.features: duplicate key | |
- ''tx_tcp_segmentation''" in | |
- __network_connections_result.msg }}' | |
+ - '{{ "fatal error: configuration error: connections[0].ethtool.features: | |
+ duplicate key ''tx_tcp_segmentation''" in __network_connections_result.msg | |
+ }}' | |
always: | |
- name: Check failure | |
debug: | |
var: __network_connections_result | |
@@ -180,10 +179,9 @@ | |
- name: "ASSERT: The profile does not change the ethtool features" | |
assert: | |
that: | |
- original_ethtool_features.stdout == ethtool_features.stdout | |
- when: | |
- network_provider == 'nm' | |
+ when: network_provider == 'nm' | |
always: | |
- block: | |
- import_role: | |
name: linux-system-roles.network | |
./tests/playbooks/tests_ethtool_features.yml.lsrout | |
--- ./tests/playbooks/tests_checkpoint_cleanup.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/playbooks/tests_checkpoint_cleanup.yml.lsrout 2020-09-09 17:48:34.814720034 -0600 | |
@@ -36,9 +36,9 @@ | |
auto6: false | |
- include_tasks: tasks/assert_device_present.yml | |
- include_tasks: tasks/assert_profile_present.yml | |
# Use internal module directly for speedup | |
- - network_connections: | |
+ - fedora.system_roles.network_connections: | |
provider: nm | |
connections: | |
- name: "{{ interface }}" | |
state: up | |
@@ -48,11 +48,10 @@ | |
auto6: false | |
ignore_errors: true | |
register: error_trigger | |
- assert: | |
- fail_msg: The module call did not fail. Therefore the test | |
- condition was not triggered. This test needs to be adjusted or | |
- dropped. | |
+ fail_msg: The module call did not fail. Therefore the test condition | |
+ was not triggered. This test needs to be adjusted or dropped. | |
that: error_trigger.failed | |
# yamllint disable-line rule:line-length | |
- command: busctl --system tree --list org.freedesktop.NetworkManager | |
register: nm_dbus_objects | |
@@ -66,9 +65,9 @@ | |
nm_dbus_objects.stdout_lines | |
always: | |
- block: | |
# Use internal module directly for speedup | |
- - network_connections: | |
+ - fedora.system_roles.network_connections: | |
provider: nm | |
connections: | |
- name: "{{ interface }}" | |
persistent_state: absent | |
./tests/playbooks/tests_checkpoint_cleanup.yml.lsrout | |
--- ./tests/playbooks/tests_states.yml 2020-09-03 18:14:44.305820063 -0600 | |
+++ ./tests/playbooks/tests_states.yml.lsrout 2020-09-09 17:48:34.639718981 -0600 | |
@@ -108,10 +108,10 @@ | |
- block: | |
- include_tasks: tasks/run_test.yml | |
vars: | |
- lsr_description: I will not get an error when I try to | |
- remove an absent profile | |
+ lsr_description: I will not get an error when I try to remove an absent | |
+ profile | |
lsr_setup: | |
- tasks/create_bridge_profile.yml | |
- tasks/activate_profile.yml | |
- tasks/remove+down_profile.yml | |
@@ -127,11 +127,10 @@ | |
- what: tasks/assert_device_absent.yml | |
# NetworkManager 1.18.4 from CentOS does not seem to remove the | |
# virtual interface in this case but it seems to work with | |
# 1:NetworkManager-1.27.0-26129.d0a2eb8f05.el7 | |
- when: "{{ network_provider == 'nm' and | |
- NetworkManager_NVR != 'NetworkManager-1.18.4-3.el7' | |
- }}" | |
+ when: "{{ network_provider == 'nm' and NetworkManager_NVR != 'NetworkManager-1.18.4-3.el7'\ | |
+ \ }}" | |
lsr_cleanup: | |
- tasks/cleanup_profile+device.yml | |
tags: | |
- tests::states:remove_down_twice | |
./tests/playbooks/tests_states.yml.lsrout | |
./tests/playbooks/tests_wireless.yml.lsrout | |
./tests/playbooks/down_profile.yml.lsrout | |
--- ./tests/playbooks/tests_802_1x.yml 2020-09-03 18:14:44.304820057 -0600 | |
+++ ./tests/playbooks/tests_802_1x.yml.lsrout 2020-09-09 17:48:33.765713723 -0600 | |
@@ -74,9 +74,9 @@ | |
private_key: /etc/pki/tls/client.key.nocrypt | |
client_cert: /etc/pki/tls/client.pem | |
private_key_password_flags: | |
- not-required | |
- system_ca_certs: True | |
+ system_ca_certs: true | |
domain_suffix_match: example.com | |
- name: "TEST: I can ping the EAP server" | |
command: ping -c1 203.0.113.1 | |
- import_role: | |
./tests/playbooks/tests_802_1x.yml.lsrout | |
./tests/playbooks/run_tasks.yml.lsrout | |
./tests/playbooks/remove_profile.yml.lsrout | |
--- ./tests/playbooks/integration_pytest_python3.yml 2020-09-03 18:14:44.304820057 -0600 | |
+++ ./tests/playbooks/integration_pytest_python3.yml.lsrout 2020-09-09 17:48:33.390711467 -0600 | |
@@ -56,18 +56,18 @@ | |
delete: yes | |
rsync_opts: | |
- "--exclude=.pyc" | |
- "--exclude=__pycache__" | |
- when: False | |
+ when: false | |
# TODO: using tar and copying the file is a workaround for the synchronize | |
# module that does not work in test-harness. Related issue: | |
# https://github.com/linux-system-roles/test-harness/issues/102 | |
# | |
- name: Create Tar file | |
- shell: 'tar -cvf {{ git_top_directory.stdout }}/testrepo.tar | |
- --exclude "*.pyc" --exclude "__pycache__" --exclude testrepo.tar | |
- -C {{ git_top_directory.stdout }} .' | |
+ shell: 'tar -cvf {{ git_top_directory.stdout }}/testrepo.tar --exclude "*.pyc" | |
+ --exclude "__pycache__" --exclude testrepo.tar -C {{ git_top_directory.stdout | |
+ }} .' | |
delegate_to: localhost | |
- name: Copy testrepo.tar to the remote system | |
copy: | |
./tests/playbooks/integration_pytest_python3.yml.lsrout | |
./tests/playbooks/tests_ethernet.yml.lsrout | |
./tests/playbooks/tests_802_1x_updated.yml.lsrout | |
./tests/playbooks/tests_bridge.yml.lsrout | |
./tests/tests_wireless_nm.yml.lsrout | |
./tests/tests_bond_nm.yml.lsrout | |
./tests/tests_states_nm.yml.lsrout | |
./tests/tests_reapply_nm.yml.lsrout | |
--- ./tests/tests_integration_pytest.yml 2020-09-03 18:14:44.306820069 -0600 | |
+++ ./tests/tests_integration_pytest.yml.lsrout 2020-09-09 17:48:30.630694862 -0600 | |
@@ -3,7 +3,6 @@ | |
- name: Empty play to gather facts | |
hosts: all | |
- import_playbook: playbooks/integration_pytest_python3.yml | |
- when: (ansible_distribution in ["CentOS", "RedHat"] and | |
- ansible_distribution_major_version == "8") or | |
- ansible_distribution == "Fedora" | |
+ when: (ansible_distribution in ["CentOS", "RedHat"] and ansible_distribution_major_version | |
+ == "8") or ansible_distribution == "Fedora" | |
./tests/tests_integration_pytest.yml.lsrout | |
./tests/tests_default_nm.yml.lsrout | |
./tests/tests_default_initscripts.yml.lsrout | |
--- ./defaults/main.yml 2020-09-03 18:14:44.302820045 -0600 | |
+++ ./defaults/main.yml.lsrout 2020-09-09 17:48:35.031721340 -0600 | |
@@ -4,81 +4,65 @@ | |
network_allow_restart: no | |
# Use initscripts for RHEL/CentOS < 7, nm otherwise | |
-network_provider_os_default: "{{ | |
- 'initscripts' if ansible_distribution in [ | |
- 'RedHat', | |
- 'CentOS', | |
- 'OracleLinux' | |
- ] and ansible_distribution_major_version is version('7', '<') | |
- else 'nm' }}" | |
+network_provider_os_default: "{{ 'initscripts' if ansible_distribution in [ 'RedHat',\ | |
+ \ 'CentOS', 'OracleLinux' ] and ansible_distribution_major_version is version('7',\ | |
+ \ '<') else 'nm' }}" | |
# If NetworkManager.service is running, assume that 'nm' is currently in-use, | |
# otherwise initscripts | |
-__network_provider_current: "{{ | |
- 'nm' if 'NetworkManager.service' in ansible_facts.services and | |
- ansible_facts.services['NetworkManager.service']['state'] == 'running' | |
- else 'initscripts' | |
- }}" | |
+__network_provider_current: "{{ 'nm' if 'NetworkManager.service' in ansible_facts.services\ | |
+ \ and ansible_facts.services['NetworkManager.service']['state'] == 'running' else\ | |
+ \ 'initscripts' }}" | |
# Default to the auto-detected value | |
network_provider: "{{ __network_provider_current }}" | |
# check if any 802.1x connections are defined | |
-__network_ieee802_1x_connections_defined: "{{ network_connections | | |
- selectattr('ieee802_1x', 'defined') | list | count > 0 }}" | |
+__network_ieee802_1x_connections_defined: "{{ network_connections | selectattr('ieee802_1x',\ | |
+ \ 'defined') | list | count > 0 }}" | |
# check if any wireless connections are defined | |
-__network_wireless_connections_defined: "{{ | |
- ['wireless'] in network_connections|json_query('[*][type]') }}" | |
+__network_wireless_connections_defined: "{{ ['wireless'] in network_connections|json_query('[*][type]')\ | |
+ \ }}" | |
# NetworkManager-wireless is required for wireless connections | |
-__network_packages_default_wireless: ["{% | |
- if __network_wireless_connections_defined | |
- %}NetworkManager-wifi{% endif %}"] | |
+__network_packages_default_wireless: ["{% if __network_wireless_connections_defined\ | |
+ \ %}NetworkManager-wifi{% endif %}"] | |
# wpa_supplicant is required if any 802.1x or wireless connections are defined | |
-__network_wpa_supplicant_required: "{{ | |
- __network_ieee802_1x_connections_defined or | |
- __network_wireless_connections_defined }}" | |
-__network_packages_default_wpa_supplicant: ["{% | |
- if __network_wpa_supplicant_required | |
- %}wpa_supplicant{% endif %}"] | |
+__network_wpa_supplicant_required: "{{ __network_ieee802_1x_connections_defined or\ | |
+ \ __network_wireless_connections_defined }}" | |
+__network_packages_default_wpa_supplicant: ["{% if __network_wpa_supplicant_required\ | |
+ \ %}wpa_supplicant{% endif %}"] | |
# The python-gobject-base package depends on the python version and | |
# distribution: | |
# - python-gobject-base on RHEL7 (no python2-gobject-base :-/) | |
# - python3-gobject-base on Fedora 28+ | |
-__network_packages_default_gobject_packages: ["python{{ | |
- ansible_python['version']['major'] | replace('2', '')}}-gobject-base"] | |
+__network_packages_default_gobject_packages: ["python{{ ansible_python['version']['major']\ | |
+ \ | replace('2', '')}}-gobject-base"] | |
__network_service_name_default_nm: NetworkManager | |
-__network_packages_default_nm: "{{['NetworkManager'] | |
- + __network_packages_default_gobject_packages|select()|list() | |
- + __network_packages_default_wpa_supplicant|select()|list() | |
- + __network_packages_default_wireless|select()|list()}}" | |
+__network_packages_default_nm: "{{['NetworkManager'] + __network_packages_default_gobject_packages|select()|list()\ | |
+ \ + __network_packages_default_wpa_supplicant|select()|list() + __network_packages_default_wireless|select()|list()}}" | |
__network_service_name_default_initscripts: network | |
# initscripts requires bridge-utils to manage bridges, install it when the | |
# 'bridge' type is used in network_connections | |
-__network_packages_default_initscripts_bridge: ["{% | |
-if ['bridge'] in network_connections|json_query('[*][type]') and | |
- ansible_distribution in ['RedHat', 'CentOS', 'OracleLinux'] and | |
- ansible_distribution_major_version is version('7', '<=') | |
-%}bridge-utils{% endif %}"] | |
-__network_packages_default_initscripts_network_scripts: ["{% | |
-if ansible_distribution in ['RedHat', 'CentOS', 'OracleLinux'] and | |
- ansible_distribution_major_version is version('7', '<=') | |
-%}initscripts{% else %}network-scripts{% endif %}"] | |
+__network_packages_default_initscripts_bridge: ["{% if ['bridge'] in network_connections|json_query('[*][type]')\ | |
+ \ and ansible_distribution in ['RedHat', 'CentOS', 'OracleLinux'] and ansible_distribution_major_version\ | |
+ \ is version('7', '<=') %}bridge-utils{% endif %}"] | |
+__network_packages_default_initscripts_network_scripts: ["{% if ansible_distribution\ | |
+ \ in ['RedHat', 'CentOS', 'OracleLinux'] and ansible_distribution_major_version\ | |
+ \ is version('7', '<=') %}initscripts{% else %}network-scripts{% endif %}"] | |
# convert _network_packages_default_initscripts_bridge to an empty list if it | |
# contains only the empty string and add it to the default package list | |
# |select() filters the list to include only values that evaluate to true | |
# (the empty string is false) | |
# |list() converts the generator that |select() creates to a list | |
-__network_packages_default_initscripts: "{{ | |
-__network_packages_default_initscripts_bridge|select()|list() | |
-+ __network_packages_default_initscripts_network_scripts|select()|list() | |
-}}" | |
+__network_packages_default_initscripts: "{{ __network_packages_default_initscripts_bridge|select()|list()\ | |
+ \ + __network_packages_default_initscripts_network_scripts|select()|list() }}" | |
# The user can explicitly set host variables "network_provider", | |
# "network_service_name" and "network_packages". | |
@@ -102,8 +86,7 @@ | |
initscripts: | |
service_name: "{{ __network_service_name_default_initscripts }}" | |
packages: "{{ __network_packages_default_initscripts }}" | |
-network_packages: "{{ | |
- __network_provider_setup[network_provider]['packages'] }}" | |
-network_service_name: "{{ | |
- __network_provider_setup[network_provider]['service_name'] }}" | |
+network_packages: "{{ __network_provider_setup[network_provider]['packages'] }}" | |
+network_service_name: "{{ __network_provider_setup[network_provider]['service_name']\ | |
+ \ }}" | |
./defaults/main.yml.lsrout | |
--- ./tasks/main.yml 2020-09-03 18:14:44.304820057 -0600 | |
+++ ./tasks/main.yml.lsrout 2020-09-09 17:48:35.169722170 -0600 | |
@@ -37,9 +37,9 @@ | |
- network_allow_restart | |
# ansible-lint wants this to be a handler, but this is not appropriate as | |
# NetworkManager must be restarted prior to the connections being created. | |
# see (https://docs.ansible.com/ansible-lint/rules/default_rules.html) | |
- - __network_package_install.changed # noqa 503 | |
+ - __network_package_install.changed # noqa 503 | |
- name: Enable and start NetworkManager | |
service: | |
name: "{{ network_service_name }}" | |
@@ -77,9 +77,9 @@ | |
when: | |
- network_provider == "initscripts" | |
- name: Configure networking connection profiles | |
- network_connections: | |
+ fedora.system_roles.network_connections: | |
provider: "{{ network_provider | mandatory }}" | |
ignore_errors: "{{ network_ignore_errors | default(omit) }}" | |
force_state_change: "{{ network_force_state_change | default(omit) }}" | |
connections: "{{ network_connections | default([]) }}" | |
./tasks/main.yml.lsrout | |
./meta/main.yml.lsrout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment