From 2b693d14c027f8f146f6dc497de66d5df086ccd7 Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Fri, 17 Mar 2023 15:20:10 -0400 Subject: [PATCH] ansible-lint: Fix no-changed-when failure Signed-off-by: Wen Liang --- tests/ensure_provider_tests.py | 2 ++ tests/playbooks/integration_pytest_python3.yml | 6 ++++++ tests/playbooks/manual_test_ethtool_coalesce.yml | 4 ++++ tests/playbooks/tests_802_1x.yml | 4 ++++ tests/playbooks/tests_bond.yml | 6 ++++++ tests/playbooks/tests_bond_cloned_mac.yml | 3 +++ tests/playbooks/tests_bond_deprecated.yml | 4 ++++ tests/playbooks/tests_bond_options.yml | 7 +++++++ tests/playbooks/tests_bond_removal.yml | 6 ++++++ tests/playbooks/tests_checkpoint_cleanup.yml | 2 ++ tests/playbooks/tests_ethtool_coalesce.yml | 6 ++++++ tests/playbooks/tests_ethtool_features.yml | 5 +++++ tests/playbooks/tests_ethtool_ring.yml | 9 +++++++++ tests/playbooks/tests_infiniband.yml | 3 +++ tests/playbooks/tests_ipv6.yml | 5 +++++ tests/playbooks/tests_reapply.yml | 1 + tests/tasks/enable_epel.yml | 2 ++ tests/tasks/get_NetworkManager_NVR.yml | 1 + tests/tasks/get_profile_stat.yml | 1 + tests/tasks/manage_test_interface.yml | 7 +++++++ tests/tasks/setup_802_1x_server.yml | 1 + tests/tasks/setup_mock_wifi_wpa3_owe.yml | 3 +++ tests/tasks/setup_mock_wifi_wpa3_sae.yml | 2 ++ tests/tasks/test_802.1x_capath.yml | 1 + tests/tests_eth_pci_address_match_nm.yml | 2 ++ tests/tests_ethtool_coalesce_nm.yml | 2 ++ tests/tests_ethtool_features_nm.yml | 2 ++ tests/tests_ethtool_ring_nm.yml | 2 ++ tests/tests_provider_nm.yml | 2 ++ tests/tests_unit.yml | 8 ++++++++ 30 files changed, 109 insertions(+) diff --git a/tests/ensure_provider_tests.py b/tests/ensure_provider_tests.py index b303110..c893d73 100755 --- a/tests/ensure_provider_tests.py +++ b/tests/ensure_provider_tests.py @@ -29,6 +29,8 @@ GET_NM_VERSION = """ networkmanager_version: "{{ networkmanager_info.results | selectattr('yumstate', 'match', '^installed$') | map(attribute='version') | list | first }}" + when: true + changed_when: false """ MINIMUM_NM_VERSION_CHECK = """ diff --git a/tests/playbooks/integration_pytest_python3.yml b/tests/playbooks/integration_pytest_python3.yml index e4159f7..34aee7a 100644 --- a/tests/playbooks/integration_pytest_python3.yml +++ b/tests/playbooks/integration_pytest_python3.yml @@ -74,6 +74,7 @@ {{ module_utils_parent_and_dir.stdout_lines[1] }} # noqa command-instead-of-module delegate_to: localhost + changed_when: false - name: Copy testrepo.tar to the remote system copy: @@ -98,6 +99,7 @@ if [ -d {{ _rundir.path }}/module_utils ]; then mv {{ _rundir.path }}/module_utils {{ _rundir.path }}/ansible fi + changed_when: false - name: Fake out python module directories, primarily for python2 shell: | @@ -106,6 +108,7 @@ touch "$dir/__init__.py" fi done + changed_when: false - name: Set _lsr_python_path set_fact: @@ -120,6 +123,7 @@ - name: "List the files in {{ _rundir.path }}" command: ls -alrtFR {{ _rundir.path }} + changed_when: false - block: - name: Run pytest with nm @@ -130,6 +134,7 @@ register: playbook_run environment: PYTHONPATH: "{{ _lsr_python_path }}" + changed_when: false always: - debug: var: playbook_run.stdout_lines @@ -147,6 +152,7 @@ register: playbook_run environment: PYTHONPATH: "{{ _lsr_python_path }}" + changed_when: false always: - debug: var: playbook_run.stdout_lines diff --git a/tests/playbooks/manual_test_ethtool_coalesce.yml b/tests/playbooks/manual_test_ethtool_coalesce.yml index 2cbfb29..c7afd25 100644 --- a/tests/playbooks/manual_test_ethtool_coalesce.yml +++ b/tests/playbooks/manual_test_ethtool_coalesce.yml @@ -25,6 +25,7 @@ - name: Get current device coalesce command: "ethtool --show-coalesce {{ interface }}" register: original_ethtool_coalesce + changed_when: false - name: Import network role import_role: name: linux-system-roles.network @@ -39,6 +40,7 @@ - name: Get current device coalesce command: "ethtool --show-coalesce {{ interface }}" register: ethtool_coalesce + changed_when: false - name: "ASSERT: The profile does not change the ethtool coalesce" assert: that: @@ -65,6 +67,7 @@ - name: Get current device coalesce command: "ethtool --show-coalesce {{ interface }}" register: ethtool_coalesce + changed_when: false - name: Show ethtool_coalesce output debug: var: ethtool_coalesce.stdout_lines @@ -94,6 +97,7 @@ - name: Get current device coalesce command: "ethtool --show-coalesce {{ interface }}" register: ethtool_coalesce + changed_when: false # Resetting the ethtools only works with NetworkManager - name: "ASSERT: The profile does not change the ethtool coalesce" assert: diff --git a/tests/playbooks/tests_802_1x.yml b/tests/playbooks/tests_802_1x.yml index 72e2517..b751a0f 100644 --- a/tests/playbooks/tests_802_1x.yml +++ b/tests/playbooks/tests_802_1x.yml @@ -37,6 +37,7 @@ ca_cert: /etc/pki/tls/cacert.pem - name: "TEST: I can ping the EAP server" command: ping -c1 203.0.113.1 + changed_when: false - name: Import network role import_role: name: linux-system-roles.network @@ -57,6 +58,7 @@ mode: 0644 - name: Update ca trust command: update-ca-trust + changed_when: false - name: Import network role import_role: name: linux-system-roles.network @@ -82,6 +84,7 @@ domain_suffix_match: example.com - name: "TEST: I can ping the EAP server" command: ping -c1 203.0.113.1 + changed_when: false - name: Import network role import_role: name: linux-system-roles.network @@ -126,3 +129,4 @@ - /etc/pki/ca-trust/source/anchors/cacert.pem - name: Update ca trust command: update-ca-trust + changed_when: false diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml index eebecb0..d3b8d01 100644 --- a/tests/playbooks/tests_bond.yml +++ b/tests/playbooks/tests_bond.yml @@ -25,6 +25,7 @@ command: cp -vf /etc/resolv.conf /etc/resolv.conf.bak when: - network_provider == "initscripts" + changed_when: false - block: - name: "TEST Add Bond with 2 ports" debug: @@ -71,18 +72,21 @@ /proc/net/bonding/{{ controller_device }} register: result until: "'110' in result.stdout" + changed_when: false - name: "** TEST check IPv4" command: ip -4 a s {{ controller_device }} register: result until: "'192.0.2' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: "** TEST check IPv6" command: ip -6 a s {{ controller_device }} register: result until: "'2001' in result.stdout" retries: 20 delay: 2 + changed_when: false always: - tags: - "tests::cleanup" @@ -104,8 +108,10 @@ failed_when: false - command: ip link del {{ controller_device }} failed_when: false + changed_when: false - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml - name: "Restore the /etc/resolv.conf for initscript" command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf when: - network_provider == "initscripts" + changed_when: false diff --git a/tests/playbooks/tests_bond_cloned_mac.yml b/tests/playbooks/tests_bond_cloned_mac.yml index 5503c84..f91a069 100644 --- a/tests/playbooks/tests_bond_cloned_mac.yml +++ b/tests/playbooks/tests_bond_cloned_mac.yml @@ -19,6 +19,7 @@ command: cp -vf /etc/resolv.conf /etc/resolv.conf.bak when: - network_provider == "initscripts" + changed_when: false - block: - name: TEST Add Bond with 2 ports debug: @@ -123,8 +124,10 @@ failed_when: false - command: ip link del {{ controller_device }} failed_when: false + changed_when: false - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml - name: Restore the /etc/resolv.conf for initscript command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf when: - network_provider == "initscripts" + changed_when: false diff --git a/tests/playbooks/tests_bond_deprecated.yml b/tests/playbooks/tests_bond_deprecated.yml index e92e3ed..d48c703 100644 --- a/tests/playbooks/tests_bond_deprecated.yml +++ b/tests/playbooks/tests_bond_deprecated.yml @@ -67,18 +67,21 @@ /proc/net/bonding/{{ controller_device }} register: result until: "'110' in result.stdout" + changed_when: false - name: "** TEST check IPv4" command: ip -4 a s {{ controller_device }} register: result until: "'192.0.2' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: "** TEST check IPv6" command: ip -6 a s {{ controller_device }} register: result until: "'2001' in result.stdout" retries: 20 delay: 2 + changed_when: false always: - tags: - "tests::cleanup" @@ -100,4 +103,5 @@ failed_when: false - command: ip link del {{ controller_device }} failed_when: false + changed_when: false - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml diff --git a/tests/playbooks/tests_bond_options.yml b/tests/playbooks/tests_bond_options.yml index fb19f01..425be36 100644 --- a/tests/playbooks/tests_bond_options.yml +++ b/tests/playbooks/tests_bond_options.yml @@ -101,6 +101,7 @@ - { key: 'updelay', value: '0'} - { key: 'use_carrier', value: '1'} - { key: 'xmit_hash_policy', value: 'encap2+3'} + changed_when: false - name: "** TEST check IPv4" command: ip -4 a s {{ controller_device }} @@ -108,12 +109,14 @@ until: "'192.0.2' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: "** TEST check IPv6" command: ip -6 a s {{ controller_device }} register: result until: "'2001' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: Reconfigure the bond options import_role: @@ -156,6 +159,7 @@ - { key: 'arp_ip_target', value: '192.0.2.128'} - { key: 'arp_validate', value: 'none'} - { key: 'primary', value: '{{ dhcp_interface1 }}'} + changed_when: false - name: "** TEST check IPv4" command: ip -4 a s {{ controller_device }} @@ -163,12 +167,14 @@ until: "'192.0.2' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: "** TEST check IPv6" command: ip -6 a s {{ controller_device }} register: result until: "'2001' in result.stdout" retries: 20 delay: 2 + changed_when: false always: - tags: @@ -191,4 +197,5 @@ failed_when: false - command: ip link del {{ controller_device }} failed_when: false + changed_when: false - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml diff --git a/tests/playbooks/tests_bond_removal.yml b/tests/playbooks/tests_bond_removal.yml index 6721b4f..dd6e573 100644 --- a/tests/playbooks/tests_bond_removal.yml +++ b/tests/playbooks/tests_bond_removal.yml @@ -25,6 +25,7 @@ command: cp -vf /etc/resolv.conf /etc/resolv.conf.bak when: - network_provider == "initscripts" + changed_when: false - block: - name: "TEST Add Bond with 2 ports" debug: @@ -71,18 +72,21 @@ /proc/net/bonding/{{ controller_device }} register: result until: "'110' in result.stdout" + changed_when: false - name: "** TEST check IPv4" command: ip -4 a s {{ controller_device }} register: result until: "'192.0.2' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: "** TEST check IPv6" command: ip -6 a s {{ controller_device }} register: result until: "'2001' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: Deactivate and remove the bond controller profile "{{ controller_profile }}" @@ -238,8 +242,10 @@ failed_when: false - command: ip link del {{ controller_device }} failed_when: false + changed_when: false - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml - name: "Restore the /etc/resolv.conf for initscript" command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf when: - network_provider == "initscripts" + changed_when: false diff --git a/tests/playbooks/tests_checkpoint_cleanup.yml b/tests/playbooks/tests_checkpoint_cleanup.yml index e47f729..67c19f4 100644 --- a/tests/playbooks/tests_checkpoint_cleanup.yml +++ b/tests/playbooks/tests_checkpoint_cleanup.yml @@ -62,6 +62,7 @@ - name: Get NM dbus objects command: busctl --system tree --list org.freedesktop.NetworkManager register: nm_dbus_objects + changed_when: false - name: Show nm_dbus_objects debug: var: nm_dbus_objects @@ -87,3 +88,4 @@ dest: "/etc/sysconfig/network-scripts/ifcfg-{{ interface }}" state: absent - command: ip link del "{{ interface }}" + changed_when: false diff --git a/tests/playbooks/tests_ethtool_coalesce.yml b/tests/playbooks/tests_ethtool_coalesce.yml index 9b8915b..8649e4d 100644 --- a/tests/playbooks/tests_ethtool_coalesce.yml +++ b/tests/playbooks/tests_ethtool_coalesce.yml @@ -46,6 +46,7 @@ register: no_coalesce_nm when: - network_provider == "nm" + changed_when: false - name: "ASSERT: The profile does not contain coalescing options" assert: that: no_coalesce_nm.stdout | length == 0 @@ -58,6 +59,7 @@ ignore_errors: true when: - network_provider == "initscripts" + changed_when: false - name: "ASSERT: The profile does not contain coalescing options" assert: that: no_coalesce_initscripts.stdout | length == 0 @@ -87,6 +89,7 @@ register: with_coalesce_nm when: - network_provider == "nm" + changed_when: false - name: Assert coalesce options set in profile assert: that: with_coalesce_nm.stdout == '128' @@ -100,6 +103,7 @@ ignore_errors: true when: - network_provider == "initscripts" + changed_when: false - name: Assert coalesce options set in profile assert: that: '"rx-frames 128" in with_coalesce_initscripts.stdout' @@ -126,6 +130,7 @@ when: - network_provider == "nm" register: clear_coalesce_nm + changed_when: false - name: "ASSERT: The profile does reset coalescing options" assert: that: clear_coalesce_nm.stdout | length == 0 @@ -138,6 +143,7 @@ ignore_errors: true when: - network_provider == "initscripts" + changed_when: false - name: "ASSERT: The profile does reset coalescing options" assert: that: clear_coalesce_initscripts.stdout | length == 0 diff --git a/tests/playbooks/tests_ethtool_features.yml b/tests/playbooks/tests_ethtool_features.yml index 67f7c42..8a7b5b1 100644 --- a/tests/playbooks/tests_ethtool_features.yml +++ b/tests/playbooks/tests_ethtool_features.yml @@ -33,6 +33,7 @@ - name: Get current device features command: "ethtool --show-features {{ interface }}" register: original_ethtool_features + changed_when: false - name: Import network role import_role: name: linux-system-roles.network @@ -47,6 +48,7 @@ - name: Get current device features command: "ethtool --show-features {{ interface }}" register: ethtool_features + changed_when: false - name: "ASSERT: The profile does not change the ethtool features" assert: that: @@ -76,6 +78,7 @@ - name: Get current device features command: "ethtool --show-features {{ interface }}" register: ethtool_features + changed_when: false - name: Show ethtool_features debug: var: ethtool_features.stdout_lines @@ -114,6 +117,7 @@ - name: Get current device features command: "ethtool --show-features {{ interface }}" register: ethtool_features + changed_when: false - name: Show ethtool_features debug: var: ethtool_features.stdout_lines @@ -183,6 +187,7 @@ - name: Get current device features command: "ethtool --show-features {{ interface }}" register: ethtool_features + changed_when: false # Resetting the ethtools only works with NetworkManager - name: "ASSERT: The profile does not change the ethtool features" assert: diff --git a/tests/playbooks/tests_ethtool_ring.yml b/tests/playbooks/tests_ethtool_ring.yml index 0a5d24c..cdeb655 100644 --- a/tests/playbooks/tests_ethtool_ring.yml +++ b/tests/playbooks/tests_ethtool_ring.yml @@ -46,6 +46,7 @@ register: no_ring_nm when: - network_provider == "nm" + changed_when: false - name: "ASSERT: The profile does not contain ring options" assert: that: no_ring_nm.stdout | length == 0 @@ -58,6 +59,7 @@ ignore_errors: true when: - network_provider == "initscripts" + changed_when: false - name: "ASSERT: The profile does not contain ring options" assert: that: no_ring_initscripts.stdout | length == 0 @@ -91,6 +93,7 @@ register: with_ring_rx when: - network_provider == "nm" + changed_when: false - name: Assert ethtool.ring-rx option set in profile assert: that: with_ring_rx.stdout == '128' @@ -101,6 +104,7 @@ register: with_ring_rx_jumbo when: - network_provider == "nm" + changed_when: false - name: Assert ethtool.ring-rx-jumbo option set in profile assert: that: with_ring_rx_jumbo.stdout == '128' @@ -111,6 +115,7 @@ register: with_ring_rx_mini when: - network_provider == "nm" + changed_when: false - name: Assert ethtool.ring-rx-mini option set in profile assert: that: with_ring_rx_mini.stdout == '128' @@ -121,6 +126,7 @@ register: with_ring_tx when: - network_provider == "nm" + changed_when: false - name: Assert ethtool.ring-tx option set in profile assert: that: with_ring_tx.stdout == '128' @@ -134,6 +140,7 @@ ignore_errors: true when: - network_provider == "initscripts" + changed_when: false - name: Assert ethtool.ring option set in profile assert: that: @@ -164,6 +171,7 @@ register: clear_ring_nm when: - network_provider == "nm" + changed_when: false - name: "ASSERT: The profile does reset ring options" assert: that: clear_ring_nm.stdout | length == 0 @@ -176,6 +184,7 @@ ignore_errors: true when: - network_provider == "initscripts" + changed_when: false - name: "ASSERT: The profile does reset ring options" assert: that: clear_ring_initscripts.stdout | length == 0 diff --git a/tests/playbooks/tests_infiniband.yml b/tests/playbooks/tests_infiniband.yml index 9b4884a..e3c9d6a 100644 --- a/tests/playbooks/tests_infiniband.yml +++ b/tests/playbooks/tests_infiniband.yml @@ -53,6 +53,7 @@ until: "'198.51.100.133/30' in result.stdout" retries: 20 delay: 2 + changed_when: false - name: "** TEST check IPv6" command: ip -6 a s ib0.000a @@ -60,6 +61,7 @@ until: "'2001:db8::2/32' in result.stdout" retries: 20 delay: 2 + changed_when: false always: - tags: @@ -79,3 +81,4 @@ failed_when: false - command: ip link del ib0.000a failed_when: false + changed_when: false diff --git a/tests/playbooks/tests_ipv6.yml b/tests/playbooks/tests_ipv6.yml index 5fb5c1e..ff86c7a 100644 --- a/tests/playbooks/tests_ipv6.yml +++ b/tests/playbooks/tests_ipv6.yml @@ -18,6 +18,7 @@ when: # netns not available on RHEL/CentOS 6 - ansible_distribution_major_version != '6' + changed_when: false - block: - name: >- TEST: I can configure an interface with static ipv6 config @@ -46,6 +47,7 @@ - name: Get ip address information command: "ip addr show {{ interface }}" register: ip_addr + changed_when: false - name: Show ip_addr debug: var: ip_addr.stdout @@ -61,6 +63,7 @@ - name: Get ipv6 routes command: "ip -6 route" register: ipv6_route + changed_when: false - name: Show ipv6_route debug: var: ipv6_route.stdout @@ -74,6 +77,7 @@ command: ping6 -c1 2001:db8::1 when: - ansible_distribution_major_version != '6' + changed_when: false always: - name: "TEARDOWN: remove profiles." debug: @@ -94,3 +98,4 @@ command: ip netns delete ns1 when: - ansible_distribution_major_version != '6' + changed_when: false diff --git a/tests/playbooks/tests_reapply.yml b/tests/playbooks/tests_reapply.yml index 0b13b96..f9655e5 100644 --- a/tests/playbooks/tests_reapply.yml +++ b/tests/playbooks/tests_reapply.yml @@ -69,3 +69,4 @@ persistent_state: absent state: down - command: ip link del "{{ interface }}" + changed_when: false diff --git a/tests/tasks/enable_epel.yml b/tests/tasks/enable_epel.yml index 6ebbab6..e5968b0 100644 --- a/tests/tasks/enable_epel.yml +++ b/tests/tasks/enable_epel.yml @@ -23,10 +23,12 @@ - name: Enable EPEL 7 command: yum-config-manager --enable epel when: ansible_distribution_major_version == '7' + changed_when: false - name: Enable EPEL 8 command: dnf config-manager --set-enabled epel when: ansible_distribution_major_version == '8' + changed_when: false - name: Enable EPEL 6 copy: diff --git a/tests/tasks/get_NetworkManager_NVR.yml b/tests/tasks/get_NetworkManager_NVR.yml index f9a2683..9aaae78 100644 --- a/tests/tasks/get_NetworkManager_NVR.yml +++ b/tests/tasks/get_NetworkManager_NVR.yml @@ -8,6 +8,7 @@ cmd: rpm -qa --qf '%{name}-%{version}-%{release}\n' NetworkManager # noqa command-instead-of-module register: __rpm_q_networkmanager + changed_when: false - name: Store NetworkManager version set_fact: diff --git a/tests/tasks/get_profile_stat.yml b/tests/tasks/get_profile_stat.yml index 3438597..10f3ce1 100644 --- a/tests/tasks/get_profile_stat.yml +++ b/tests/tasks/get_profile_stat.yml @@ -48,6 +48,7 @@ grep "^# Ansible managed" /etc/sysconfig/network-scripts/ifcfg-{{ profile }} register: _result + changed_when: false - name: Verify the ansible_managed comment in ifcfg-{{ profile }} set_fact: diff --git a/tests/tasks/manage_test_interface.yml b/tests/tasks/manage_test_interface.yml index d27b2a6..b0bc7e7 100644 --- a/tests/tasks/manage_test_interface.yml +++ b/tests/tasks/manage_test_interface.yml @@ -26,36 +26,43 @@ - ip link set {{ interface }} up when: "type == 'veth' and state == 'present' and interface not in current_interfaces" + changed_when: false - name: Set up veth as managed by NetworkManager command: nmcli d set {{ interface }} managed true # The varible for `network_provider` is not exists yet, # just ignore error for initscripts ignore_errors: true # noqa ignore-errors when: "type == 'veth' and state == 'present'" + changed_when: false - name: Delete veth interface {{ interface }} command: ip link del {{ interface }} type veth when: "type == 'veth' and state == 'absent' and interface in current_interfaces" + changed_when: false # 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" + changed_when: false - name: Delete dummy interface {{ interface }} command: ip link del "{{ interface }}" type dummy when: "type == 'dummy' and state == 'absent' and interface in current_interfaces" + changed_when: false # 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" + changed_when: false - name: Delete tap interface {{ interface }} command: ip tuntap del dev {{ interface }} mode tap when: "type == 'tap' and state == 'absent' and interface in current_interfaces" + changed_when: false diff --git a/tests/tasks/setup_802_1x_server.yml b/tests/tasks/setup_802_1x_server.yml index 34b530f..bce11ed 100644 --- a/tests/tasks/setup_802_1x_server.yml +++ b/tests/tasks/setup_802_1x_server.yml @@ -7,6 +7,7 @@ - ansible_distribution_version | float < 8.6 - ansible_distribution_major_version == '8' - ansible_distribution == 'RedHat' + changed_when: false - name: Install hostapd package: diff --git a/tests/tasks/setup_mock_wifi_wpa3_owe.yml b/tests/tasks/setup_mock_wifi_wpa3_owe.yml index 26965ca..798b7fe 100644 --- a/tests/tasks/setup_mock_wifi_wpa3_owe.yml +++ b/tests/tasks/setup_mock_wifi_wpa3_owe.yml @@ -23,6 +23,7 @@ when: - ansible_distribution_major_version == '8' - ansible_distribution == 'CentOS' + changed_when: false - name: Install hostapd in Fedora shell: | @@ -30,6 +31,7 @@ dnf -y install hostapd when: - ansible_distribution == 'Fedora' + changed_when: false - name: Install mac80211_hwsim kernel modules in Fedora shell: | @@ -38,6 +40,7 @@ dnf -y install kernel-modules*.rpm when: - ansible_distribution == 'Fedora' + changed_when: false - name: Create hostapd config copy: diff --git a/tests/tasks/setup_mock_wifi_wpa3_sae.yml b/tests/tasks/setup_mock_wifi_wpa3_sae.yml index b0b1a3c..45ce717 100644 --- a/tests/tasks/setup_mock_wifi_wpa3_sae.yml +++ b/tests/tasks/setup_mock_wifi_wpa3_sae.yml @@ -23,6 +23,7 @@ when: - ansible_distribution_major_version == '8' - ansible_distribution == 'CentOS' + changed_when: false - name: Install hostapd in Fedora package: @@ -41,6 +42,7 @@ dnf -y install kernel-modules*.rpm when: - ansible_distribution == 'Fedora' + changed_when: false - name: Create hostapd config copy: diff --git a/tests/tasks/test_802.1x_capath.yml b/tests/tasks/test_802.1x_capath.yml index 1dfef46..85c95fc 100644 --- a/tests/tasks/test_802.1x_capath.yml +++ b/tests/tasks/test_802.1x_capath.yml @@ -74,6 +74,7 @@ ca_path: /etc/pki/tls/my_ca_certs - name: "TEST: I can ping the EAP server" command: ping -c1 203.0.113.1 + changed_when: false - name: Trigger failure in case the role did not fail fail: msg: after test diff --git a/tests/tests_eth_pci_address_match_nm.yml b/tests/tests_eth_pci_address_match_nm.yml index 93f4973..660d8e4 100644 --- a/tests/tests_eth_pci_address_match_nm.yml +++ b/tests/tests_eth_pci_address_match_nm.yml @@ -30,6 +30,8 @@ networkmanager_version: "{{ networkmanager_info.results | selectattr('yumstate', 'match', '^installed$') | map(attribute='version') | list | first }}" + when: true + changed_when: false # The test requires or should run with NetworkManager, therefore it cannot run diff --git a/tests/tests_ethtool_coalesce_nm.yml b/tests/tests_ethtool_coalesce_nm.yml index 6edfef1..a1a1905 100644 --- a/tests/tests_ethtool_coalesce_nm.yml +++ b/tests/tests_ethtool_coalesce_nm.yml @@ -30,6 +30,8 @@ networkmanager_version: "{{ networkmanager_info.results | selectattr('yumstate', 'match', '^installed$') | map(attribute='version') | list | first }}" + when: true + changed_when: false # The test requires or should run with NetworkManager, therefore it cannot run diff --git a/tests/tests_ethtool_features_nm.yml b/tests/tests_ethtool_features_nm.yml index 457d0fd..5f2e879 100644 --- a/tests/tests_ethtool_features_nm.yml +++ b/tests/tests_ethtool_features_nm.yml @@ -30,6 +30,8 @@ networkmanager_version: "{{ networkmanager_info.results | selectattr('yumstate', 'match', '^installed$') | map(attribute='version') | list | first }}" + when: true + changed_when: false # The test requires or should run with NetworkManager, therefore it cannot run diff --git a/tests/tests_ethtool_ring_nm.yml b/tests/tests_ethtool_ring_nm.yml index 678b040..2102819 100644 --- a/tests/tests_ethtool_ring_nm.yml +++ b/tests/tests_ethtool_ring_nm.yml @@ -30,6 +30,8 @@ networkmanager_version: "{{ networkmanager_info.results | selectattr('yumstate', 'match', '^installed$') | map(attribute='version') | list | first }}" + when: true + changed_when: false # The test requires or should run with NetworkManager, therefore it cannot run diff --git a/tests/tests_provider_nm.yml b/tests/tests_provider_nm.yml index 51ee74c..f90ff50 100644 --- a/tests/tests_provider_nm.yml +++ b/tests/tests_provider_nm.yml @@ -30,6 +30,8 @@ networkmanager_version: "{{ networkmanager_info.results | selectattr('yumstate', 'match', '^installed$') | map(attribute='version') | list | first }}" + when: true + changed_when: false # The test requires or should run with NetworkManager, therefore it cannot run diff --git a/tests/tests_unit.yml b/tests/tests_unit.yml index 1b5a409..6d60652 100644 --- a/tests/tests_unit.yml +++ b/tests/tests_unit.yml @@ -51,6 +51,7 @@ {{ module_utils_parent_and_dir.stdout_lines[1] }} # noqa command-instead-of-module delegate_to: localhost + changed_when: false - name: Copy testrepo.tar to the remote system copy: @@ -79,6 +80,7 @@ if [ -d {{ _rundir.path }}/module_utils ]; then mv {{ _rundir.path }}/module_utils {{ _rundir.path }}/ansible fi + changed_when: false - name: Fake out python module directories, primarily for python2 shell: | @@ -87,6 +89,7 @@ touch "$dir/__init__.py" fi done + changed_when: false - name: Copy unit test to remote system copy: @@ -108,6 +111,7 @@ - name: "List the files in {{ _rundir.path }}" command: ls -alrtFR {{ _rundir.path }} + changed_when: false - debug: msg: path {{ _lsr_python_path }} @@ -116,6 +120,7 @@ ignore_errors: true register: python2_available when: true + changed_when: false - name: Run python2 unit tests command: > @@ -125,12 +130,14 @@ when: > python2_available is succeeded and ansible_distribution != 'Fedora' register: python2_result + changed_when: false - name: Check if python3 is available command: python3 --version ignore_errors: true register: python3_available when: true + changed_when: false - name: Run python3 unit tests command: > @@ -139,6 +146,7 @@ PYTHONPATH: "{{ _lsr_python_path }}" when: python3_available is succeeded register: python3_result + changed_when: false - name: Show python2 unit test results debug: