1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/units/modules
Chris Van Heuveln 20fb77c49b nxos_interfaces_ospf: fix passive-interface states & check_mode (#54260)
* nxos_interfaces_ospf: fix passive-interface states & check_mode

This fix addresses issues #41704 and #45343.

The crux of the problem is that `passive-interface` should have been treated as a tri-state value instead of a boolean.

The `no` form of the command disables the passive state on an interface (allows it to form adjacencies and send routing updates).  It's essentially an override for `passive-interface default` which enables passive state on all OSPF interfaces.\*
This `no` config will be present in `running-config`.

   \**See `router ospf` configuration.*

Since both enable and disable states are explicit configs, the proper way to remove either of these is with the `default` syntax.

Passive-interface config syntax:
```
  ip ospf passive-interface              # enable  (nvgens)
  no ip ospf passive-interface           # disable (nvgens)
  default ip ospf passive-interface      # default (removes config, does not nvgen)
```

Code changes:

* `passive_interface` param changed from boolean to string, restricted to `true`,`false`,`default`.

* Several passive-interface specific checks were added because the existing module logic tends to test for true or false and doesn't handle the None case.

* Fixed `check_mode`.

Sanity verified on: N9K,N7K,N3K,N6K

* Fix doc header

* Unit tests for passive-interface

* doc fix #2

* Fix indent for SA

* Remove 'default' keyword, restore bool behavior

* remove changes to sanity
2019-03-27 09:15:50 +05:30
..
cloud docker_swarm_service: Remove configs and secrets defaults (#54361) 2019-03-26 09:45:40 -04:00
crypto New LUKS devices management module (#48991) 2019-02-15 09:25:14 +00:00
files Fixes #34893 (#40166) 2018-05-16 11:09:32 -05:00
messaging Rabbitmq user permission fixes (#49404) 2018-12-07 13:19:08 +00:00
monitoring Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
net_tools Added support for infoblox member object (#53174) 2019-03-12 17:48:51 +05:30
network nxos_interfaces_ospf: fix passive-interface states & check_mode (#54260) 2019-03-27 09:15:50 +05:30
notification Add support for hex color in slack module (#49804) 2018-12-12 08:41:49 +00:00
packaging rename rhsm_repository_release to rhsm_release (#53430) 2019-03-21 10:21:45 -05:00
remote_management Fix test_oneview_ethernet_network unit test. 2019-03-20 22:13:26 -07:00
source_control Add Bitbucket Pipelines variable module (#54049) 2019-03-22 13:17:08 +01:00
storage Use pytest.mark.skip instead of pytest.skip. 2019-03-26 11:10:51 -07:00
system Added support for iptables module iprange (#53732) (#53732) 2019-03-18 13:05:04 +00:00
web_infrastructure Python 3.8 collections compatibility fixes. 2018-10-08 11:26:37 -07:00
__init__.py Some algorithmic unittests for the apt and docker modules 2016-04-27 07:23:31 -07:00
conftest.py Python 3.8 collections compatibility fixes. 2018-10-08 11:26:37 -07:00
utils.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00