Commit graph

22 commits

Author SHA1 Message Date
Wen Liang
c7af145a9a Install NetworkManager-team package when team profiles are configured
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2020-10-07 11:18:30 +02:00
Till Maas
bf4501bb87 tests: Do not check arch for NM version
To allow running the tests on any arch, do not check for the RPM
architecture when checking the NetworkManager version.

Signed-off-by: Till Maas <opensource@till.name>
2020-08-21 08:43:10 +02:00
Vladimír Beneš
6e85ffe5f2 tests: add simple bond tests for both nm and initscripts
* add a helper to create two veth devices with IPv4/IPv6 infra
 * add a bond in active-backup mode with miimon value
 * add two slaves connections for two veth devices
 * check automated IPv4/IPv6 addresses are assigned to master
 * check all connections are present
 * add a helper to delete previously created veth device setup
2020-08-20 17:06:05 +02:00
Till Maas
0b2edc50d8 Forget unmanaged state in NetworkManager
When removing a profile with initscripts, also notify NetworkManager so
it can forget that the specified device was to be ignored.
2020-07-11 16:17:06 +02:00
Till Maas
e0c7d550a9 States: Ignore already removed profile for absent
When a profile is specified as absent, ignore state requests if the
profile is already removed or not completely specified to improve
idempotence.

Also restructure the states test. This introduces a clear structure for
the individual test steps, properly assigns tags for each test from the
file and provides a clear error message with a description of the test
that failed in case of errors. Support for tests that expect a failure
is still missing.
2020-06-26 20:08:51 +02:00
Till Maas
ff1cba43d6 Tests: Check error message in ca_path test 2020-06-17 08:51:12 +02:00
Till Maas
cea278cd11 Tests: Avoid comparing booleans
Instead of testing directly for equality of boolean values, use logical
comparisons since the comparison is broken in Jinja2 before version
2.11.0.
2020-06-17 08:51:12 +02:00
Jack Adolph
51f8e5b05f Add support for wireless connections
WPA-PSK and WPA-EAP are supported. Uses existing 802.1x features of the role.
Added extra functionality to ArgValidatorStr to enforce a min and max length.
2020-06-15 21:10:54 +02:00
Jack Adolph
dd4ae77cbf Add ca_path option for 802.1x connections
Special notes:
Hash the cacert in the ca_path as OpenSSL needs symlinks for ca
certificates from their symlinks to their filename if specifying a
directory.

In case ieee802_1x.ca_path is specified but not supported by
NetworkManager, fail to ensure the setting is not silently ignored.

References:
https://stackoverflow.com/questions/25889341/what-is-the-equivalent-of-unix-c-rehash-command-script-on-linux
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448

Co-authored-by: Till Maas <opensource@till.name>
2020-06-15 18:26:34 +02:00
Till Maas
371d6f4679 802.1x tests: Improve cleanup 2020-06-15 18:26:34 +02:00
Till Maas
7f222e5dbe Tests: Use command module 2020-06-15 18:26:34 +02:00
Elvira Garcia Ruiz
4753c70c55 library: Separate debug and info logs from warnings
Logs are now separed by severity level. Warnings and failures are the only logs
that appear now on the output. All logs are saved into a new json parameter
called "stderr" that is later shown on a different task. In case of
failure, all logs are shown as output. Tests have been created and modified in
order to assure that this feature works.

Signed-off-by: Elvira Garcia Ruiz <elviragr@riseup.net>
2020-05-06 21:57:34 +02:00
Jack Adolph
97129717a5 Rename files to be valid python identifiers 2020-04-22 17:40:03 +02:00
Jack Adolph
4af8f23955 Add support for 802.1x wired connections (EAP-TLS only)
Only EAP-TLS method is supported. Must use NetworkManager as the network_provider.
Also fixed bug in do_connections_validate_nm() function.
2020-03-25 10:49:10 +01:00
Till Maas
00a81165e8 tests: Install iproute to manage test interfaces 2019-04-16 18:27:45 +02:00
Till Maas
f8d325f9fa tests: Adjust profile path if necessary
If /etc/network-scripts does no exist, NeworkManger uses
/etc/NetworkManager/system-connections to store profiles. Use this
directory if necessary.
2019-04-16 18:27:45 +02:00
Till Maas
5273f55166 tests: Do not use ansible_interfaces
ansible_interfaces requires iproute to be present which might not be the
case for container images. Check /sys/class/net to avoid the dependency.
2019-04-16 18:27:45 +02:00
Till Maas
9b3712cbdf test asserts: Clarify name 2019-01-08 17:11:38 +01:00
Till Maas
49c7c6a0f4 tests: Properly set the name of assert tasks
Otherwise it breaks with Ansible 2.7 or does not show the name with
previous Ansible versions.
2018-10-16 11:31:22 +02:00
Till Maas
9b3d2d3ad8 Add simple test for bridges 2018-07-16 08:26:50 +02:00
Till Maas
488c59a5f5 Rename/symlink accidentally checked-in files 2018-06-28 16:55:37 +02:00
Till Maas
ff2f35cb8a Add helper tasks for integration tests 2018-05-23 18:55:21 +02:00