You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units
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
6 years ago
..
cli Restore ansible --version output (#55728) 6 years ago
compat Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
config Fix encoding issues with file paths. (#50830) 6 years ago
contrib Fix vmware_inventory unit tests so they run. 6 years ago
errors Add better error when k=v syntax is used with YAML in tasks (#41754) 6 years ago
executor Support using importlib on py>=3 to avoid imp deprecation (#54883) 6 years ago
inventory_test_data/group_vars
mock Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
module_utils unittests for module_utils.common.removed.removed_module function (#57214) 6 years ago
modules nxos_bfd_global / NxosCmdRef initial commit (#56317) 6 years ago
parsing lib/ansible/parsing/ajson.py: added UNIT-tests (#56398) 6 years ago
playbook Restore ansible --version output (#55728) 6 years ago
plugins ipaddr: Handle network address in ipmath (#57149) 6 years ago
regex Add toggle to control invalid character substitution in group names (#52748) 6 years ago
template Templar: encapsulate _available_variables (#55435) 6 years ago
utils Move the arguments module into cli/ and context_objects into utils 6 years ago
vars Fix inventory cache interface (#50446) 6 years ago
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
ansible.cfg Fix ansible-test config management. 7 years ago
conftest.py Update handling of the non_local test alias. 6 years ago
test_constants.py 1st part of ansible config, adds ansible-config to view/manage configs (#12797) 8 years ago
test_context.py Save the command line arguments into a global context 6 years ago