Skip to content
Merged
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
30 changes: 8 additions & 22 deletions tests/ensure_provider_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,10 @@
EXTRA_RUN_CONDITION = "extra_run_condition"
NM_ONLY_TESTS = {
"playbooks/tests_802_1x_updated.yml": {
EXTRA_RUN_CONDITION: (
"(not __network_is_rhel and\n"
" __network_distro_major_version | int > 7) or\n"
" __network_distro_major_version | int == 8"
),
EXTRA_RUN_CONDITION: "not __network_is_rhel or __network_distro_major_version | int > 7",
},
"playbooks/tests_802_1x.yml": {
EXTRA_RUN_CONDITION: (
"(not __network_is_rhel and\n"
" __network_distro_major_version | int > 7) or\n"
" __network_distro_major_version | int == 8"
),
EXTRA_RUN_CONDITION: "not __network_is_rhel or __network_distro_major_version | int > 7",
},
"playbooks/tests_ignore_auto_dns.yml": {},
"playbooks/tests_bond_options.yml": {},
Expand Down Expand Up @@ -164,25 +156,19 @@
"playbooks/tests_team_plugin_installation.yml": {
EXTRA_RUN_CONDITION: "not __is_rh_distro or\n __network_distro_major_version | int < 10",
},
# mac80211_hwsim (used for tests_wireless) only seems to be available
# and working on RHEL/CentOS 7
# hostapd is not available on RHEL7, so tests_wireless cannot be run on RHEL7
"playbooks/tests_wireless.yml": {
EXTRA_RUN_CONDITION: "__network_distro_major_version == '7'",
EXTRA_RUN_CONDITION: "not __network_is_rhel or __network_distro_major_version | int > 7",
},
"playbooks/tests_wireless_and_network_restart.yml": {},
"playbooks/tests_wireless_plugin_installation.yml": {},
"playbooks/tests_wireless_wpa3_owe.yml": {
"comment": "# OWE has not been supported by NetworkManager 1.18.8 on \
RHEL 7(dist-tag). Failed in setting up mock wifi on RHEL 8",
EXTRA_RUN_CONDITION: "__network_distro_major_version | int > 7 and \
__network_is_centos or\n __network_distro_major_version | int > 32 \
and __network_is_fedora",
"comment": "# OWE has not been supported by NetworkManager 1.18.8 on EL 7.",
EXTRA_RUN_CONDITION: "not __is_rh_distro or __network_distro_major_version | int > 7",
},
"playbooks/tests_wireless_wpa3_sae.yml": {
"comment": "# SAE has not been supported by NetworkManager 1.18.8 on \
RHEL 7. Failed in setting up mock wifi on RHEL 8",
EXTRA_RUN_CONDITION: "__network_distro_major_version != '7' and \
not __network_is_rhel",
"comment": "# SAE has not been supported by NetworkManager 1.18.8 on EL 7.",
EXTRA_RUN_CONDITION: "not __is_rh_distro or __network_distro_major_version | int > 7",
},
}
# NM_CONDITIONAL_TESTS is used to store the test playbooks which are demanding for NM
Expand Down
19 changes: 6 additions & 13 deletions tests/playbooks/tests_802_1x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
- name: "INIT: 802.1x tests"
debug:
msg: "##################################################"
- name: Include the task 'setup_802.1x.yml'
include_tasks: tasks/setup_802.1x.yml
- name: Include the task 'setup_mock_wifi.yml'
include_tasks: tasks/setup_mock_wifi.yml
vars:
__mock_wifi_mode: 802_1x
- name: Test configuring 802.1x authentication
block:
- name: "TEST: 802.1x profile with private key password and ca cert"
Expand Down Expand Up @@ -127,17 +129,8 @@
persistent_state: absent
state: down
__sr_failed_when: false
- name: Include the task 'cleanup_802_1x_server.yml'
include_tasks: tasks/cleanup_802_1x_server.yml
- name: Remove test certificates
file:
state: absent
path: "/etc/pki/tls/{{ item }}"
with_items:
- client.key
- client.key.nocrypt
- client.pem
- cacert.pem
- name: Include the task 'cleanup_mock_wifi.yml'
include_tasks: tasks/cleanup_mock_wifi.yml
- name: Remove test CA
file:
state: absent
Expand Down
9 changes: 0 additions & 9 deletions tests/playbooks/tests_wireless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
msg: "##################################################"
- name: Include the task 'setup_mock_wifi.yml'
include_tasks: tasks/setup_mock_wifi.yml
- name: Copy client certs
copy:
src: "{{ item }}"
dest: "/etc/pki/tls/{{ item }}"
mode: "0644"
with_items:
- client.key
- client.pem
- cacert.pem
- name: Test wireless connection with WPA-PSK
block:
- name: "TEST: wireless connection with WPA-PSK"
Expand Down
6 changes: 4 additions & 2 deletions tests/playbooks/tests_wireless_wpa3_owe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
- name: "INIT: wireless tests"
debug:
msg: "##################################################"
- name: Include the task 'setup_mock_wifi_wpa3_owe.yml'
include_tasks: tasks/setup_mock_wifi_wpa3_owe.yml
- name: Include the task 'setup_mock_wifi.yml'
include_tasks: tasks/setup_mock_wifi.yml
vars:
__mock_wifi_mode: owe
- name: Test wireless connection with OWE
block:
- name: "TEST: wireless connection with OWE"
Expand Down
12 changes: 7 additions & 5 deletions tests/playbooks/tests_wireless_wpa3_sae.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
interface: wlan0
tasks:
- name: "INIT: wireless tests"
include_tasks: tasks/setup_mock_wifi_wpa3_sae.yml
when: ansible_facts['distribution'] in ['CentOS', 'Fedora']
debug:
msg: "##################################################"
- name: Include the task 'setup_mock_wifi.yml'
include_tasks: tasks/setup_mock_wifi.yml
vars:
__mock_wifi_mode: sae

- name: Test wireless connection with WPA3 Personal
block:
Expand All @@ -17,9 +21,7 @@
network_allow_restart: true
network_connections:
- name: "{{ interface }}"
# set `state: down` on RHEL 8 since we failed in setting up mock
# wifi on RHEL 8
state: "{{ 'down' if ansible_facts['distribution'] == 'RedHat' else 'up' }}"
state: up
type: wireless
ip:
address:
Expand Down
23 changes: 0 additions & 23 deletions tests/tasks/cleanup_802_1x_server.yml

This file was deleted.

40 changes: 40 additions & 0 deletions tests/tasks/cleanup_mock_wifi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- name: Remove wired 802.1x test interfaces
shell: |
set -uxo pipefail
exec 1>&2
ip netns delete ns1
ip link delete veth1-br
ip link delete veth2-br
ip link delete br1
changed_when: false
failed_when: false

- name: Unload mac80211_hwsim module
command: modprobe -r mac80211_hwsim
changed_when: false
failed_when: false

- name: Kill hostapd process
command: pkill hostapd
changed_when: false
failed_when: false

- name: Remove hostapd config files
file:
state: absent
path: "{{ item }}"
with_items:
- /etc/hostapd/wireless.conf
- /etc/hostapd/wired.conf
- /etc/hostapd/hostapd.eap_user

- name: Remove server certificate directory for wired 802.1x tests
file:
state: absent
path: /etc/pki/tls/hostapd_test

- name: Remove test certificates
file:
state: absent
path: "/etc/pki/tls/{{ item }}"
with_items:
- server.key
- dh.pem
- server.pem
- cacert.pem
- client.key
- client.key.nocrypt
- client.pem
13 changes: 0 additions & 13 deletions tests/tasks/setup_802.1x.yml

This file was deleted.

91 changes: 0 additions & 91 deletions tests/tasks/setup_802_1x_server.yml

This file was deleted.

Loading
Loading