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/network
Chris Van Heuveln 7aa0d26fda nxos_bfd_global / NxosCmdRef initial commit (#56317)
* nxos_bfd_global: initial commit

This is an initial POC with just a few commands included.  The code has been written somewhat generically so that it can act as a best practices template for re-use in future modules. The implementation follows the yaml cmd_ref style to define each command's getter/setter/type/default. It supports platform-specific defaults.

The basic logic is to collect all relevant data in a `cmd_ref` dict and pass that around to various methods.

In the BFD case the devices don't provide JSON output so we have to screen-scrape with show runs.

BFD does not support present/absent states so there is no state param.

BFD has three different property types to handle. We can add add'l types as needed:

- int
- int_list (list of ints)
- str (needs support for 'no' keyword)

* Use get_capabilities to find platform type

* PR comment fixes, round 1

* Minor cleanups

* nxos_bfd_global: create NxosCmdRef in module_utils

This commit just takes the latest bfd global code and moves the bulk
of the code into new `class NxosCmdRef` in `module_utils/nxos/nxos.py`.

The only remaining code in `nxos_bfd_global.py` are the calls from `main()`.

* Add remaining command properties and documentation

* update argument_spec

* Add check for _exclude; add sanity test

* Add targets files for bfd

* Context and state absent updates

* Add dict support to cmd_ref

* Changed remaining list commands to dict usage

* Add idempotence check for dict

* Fix existing overwrite bug

* Move pattern matching logic into its own method

* add support for 'command: absent'

* Add `get_platform_shortname`; update BFD platform-specific settings

* /absent/deleted/

* /sh/show/ in prepare_nxos_tests

* add dict check to get_platform_shortname

* Add normalize_defaults()

* UTs for bfd_global

* support yaml for both py2/py3

* update cmd_ref doc header

* Fix python2.6 incompatibility with dict comprehensions

* Fix bfd_global doc header (yaml syntax fail)

* more shippable fixes

* yet more shippable fixes

* shippable: remove r' ' wrappers

* docfix - remove ':'

* escape regex ctl chars in yaml table

* remove extra blank lines

* Fix str(None) issue

* Command context updates

* import PY2,PY3 instead of import sys

* fix ordereddict import & parent_context

* try/except for yaml import

* fix import issue for ordereddict

* remove epdb

* nxosCmdRef_import_check() workaround for shippable

* fix PEP ws errors
2019-06-06 15:52:55 +05:30
..
aireos Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
aruba Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
asa ASA network/service object-group module (#52925) 2019-04-03 23:22:45 +05:30
basics code clean of old code from network modules updates (#21469) 2017-02-15 12:46:30 -05:00
checkpoint Add checkpoint_session module (#50930) 2019-01-16 13:19:36 +01:00
cli Add backup parameter to cli_config (#50206) 2018-12-21 09:55:14 -05:00
cloudvision Ensure that current uses of BaseException are required 2018-12-16 15:03:19 -08:00
cnos The module fails on switchport. Check added to fix. (#54970) 2019-04-08 10:41:36 +05:30
cumulus Remove wildcard import in test_nclu 2017-10-09 21:41:02 -07:00
dellos6 Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
dellos9 Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
dellos10 Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
edgeos Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
edgeswitch new network module: edgeswitch_vlan (#48041) 2018-12-17 11:30:17 +05:30
enos Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
eos New module for BGP configuration management in Arista EOS (#52722) 2019-03-12 17:31:58 +05:30
exos Exos httpapi (#54405) 2019-03-27 14:44:04 +01:00
f5 Rename _facts -> _info (#57028) 2019-05-28 13:43:04 +02:00
fortimanager FortiManager Plugin Module Conversion: fmgr_ha (#52768) 2019-03-07 12:31:17 +05:30
frr frr: New module for BGP configuration management (#51281) 2019-03-04 15:02:56 +05:30
ftd Add latest updates from FTD Ansible downstream repository. (#53638) 2019-04-01 18:08:01 +05:30
ingate modules: network: ingate: Add module ig_store_edit (#47675) 2019-01-17 23:05:45 -05:00
ios Revert nxos, ios, iosxr return_timestamps (#56206) 2019-05-08 20:49:29 +05:30
iosxr Revert nxos, ios, iosxr return_timestamps (#56206) 2019-05-08 20:49:29 +05:30
ironware Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 2019-03-15 08:55:50 +00:00
itential itential iap_start_workflow module (#51238) 2019-03-07 13:23:40 -05:00
junos Add platform facts in network facts modules (#51434) 2019-03-11 10:56:39 +05:30
netact Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
netscaler Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
netvisor Pluribus Networks ipv6security raguard port module with UT (#57033) 2019-06-03 11:44:28 +05:30
nos Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 2019-03-15 08:55:50 +00:00
nso NSO - added validate_certs parameter to allow for ignoring of SSL certificates (#51981) 2019-02-25 14:17:56 +00:00
nuage Replace nose with pytest 2018-11-26 13:41:57 -08:00
nxos nxos_bfd_global / NxosCmdRef initial commit (#56317) 2019-06-06 15:52:55 +05:30
onyx Adding New Model onyx_qos for Configuring QoS on Onyx Switches (#55127) 2019-05-17 14:20:56 -04:00
opx opx_cps_changes (#51952) 2019-03-07 03:41:36 -05:00
ovs Add support for vlan update on ovs bridges (#57168) 2019-06-05 10:32:14 -04:00
radware Changing the license to Apache 2 2019-05-20 10:14:32 -07:00
routeros Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
slxos Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 2019-03-15 08:55:50 +00:00
voss Update slxos_vlan for new SLX-OS versions, linting fixes (#52956) 2019-03-15 08:55:50 +00:00
vyos Add platform facts in network facts modules (#51434) 2019-03-11 10:56:39 +05:30
__init__.py adds new module net_command for network devices (#19468) 2016-12-19 11:21:37 -05:00