1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

7 commits

Author SHA1 Message Date
Felix Fontein
41550b5205
Add hetzner_failover_ip* tests (#1301)
* Add tests for hetzner_failover_ip_info.

* Add basic tests for hetzner_failover_ip.
2020-11-16 07:50:56 +01:00
Justin Bronn
7722800561
nmcli: module refactor (#1113)
* * Refactor `nmcli` module to use consistent parameters when creating/modifying connections and detecting changes.
* Keep DNS list arguments as lists internally.
* Remove duplicated code where practical.

* DBus and GObject dependencies are not necessary.

* Update changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>

* Use identity operator instead of equality for type comparison.

* Don't start changelog notes with a capital letter.

* * Have `settings_type` return `str` by default instead of `None`.
* Improve variable naming, use `convert_func` instead of `type_cast`.

* Revert new feature of allowing ethernet types as slaves.

* Bring back `list_connection_info` to list all connections with `nmcli con show`.

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-23 07:13:39 +02:00
Joey Zhang
d2ee51253d
nmcli: add idempotent support for any kinds of connections (#562)
* nmcli: add idemptent support for any kinds of connections

Fixes #481: nmcli reports changed status even if nothing needs to change
- Implement show_connection() to retrieve connection profile from command line
- Parse integer enumeration values in show_connection()
- Convert 'bond.options' to alias shortcuts
- Modify connection only if changes are detected
- Support generic alias in during the property comparison

* nmcli: add idemptent support for any kinds of connections

Add mock object for modification cases when connection state changes

* nmcli: add idempotent support for any kinds of connections

- Add more test cases to check idempotent for each type of connections
- Verify 'changed' and 'failed' in the result of each test
- Append prefixlen for 'ip4' values in test data
- Fix the incorrect 'return_value' of execute_command() in previous mockers
- Ignore the empty string in _compare_conn_params()
- Fix the property key mapping of 'bridge-port.hairpin-mode' for bridge-slave
- Add 'override_options' in the result output for playboot debug

* nmcli: add idempotent support for any kinds of connections

Fix pep8 issues in test_nmcli.py: Comparison to False should be 'not expr'

* nmcli: add idempotent support for any kinds of connections

Support setting 'ipv4.method' or 'ipv6.method' via nmcli if the configuration method changes

* nmcli: add idempotent support for any kinds of connections

Simplify the if statements in show_connection() according to vlours's advice

* nmcli: add idempotent support for any kinds of connections

Fix the list argument comparison method with multiple values.

* nmcli: add idempotent support for any kinds of connections

Use ansible --diff option output to show detailed changes instead of a private return value.

* nmcli: add idempotent support for any kinds of connections

Add changelog fragment for bugfix.
2020-06-30 05:43:39 +02:00
Abhijeet Kasurde
832dd55144
sanity: Add future boilerplate (#573)
* sanity: Add future boilerplate

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Module Utils

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Scripts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* sanity: Add future boilerplate

* Tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* CI failure

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-24 21:50:36 +02:00
Abhijeet Kasurde
2aaab59d04
nmcli: Typecast parameter values to string as required (#477) 2020-06-15 17:02:55 +05:30
Felix Fontein
703daa9500
Add small unit test framework for testing fetch_url() based modules (#171)
* Convert integrated simple fetch_url() checking framework from hetzner_firewall tests to proper framework which can also be used by other modules.

* Linting.

* One more.

* Use community.internal_test_tools collection.
2020-04-23 14:50:44 +02:00
Felix Fontein
be191cce6c
Move modules and module_utils unit tests to correct place (#81)
* Move modules and module_utils unit tests to correct place.

* Update ignore.txt

* Fix imports.

* Fix typos.

* Fix more typos.
2020-03-31 10:42:38 +02:00