* ansible-test: add skip/windows/... alias to skip tests on specific Windows versions
* show what tests were skipped
* changes to logic to only skip if all Windows targets are set to skip
* codestyle improvements
* change warning message based on review
* check args type before running the Windows path
(cherry picked from commit 0f5331645f)
* Fix unit test parametrize order on Python 3.5.
(cherry picked from commit 53b230ca74)
* Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
(cherry picked from commit 379a7f4f5a)
* Run unit tests in parallel. (#45812)
(cherry picked from commit abe8e4c9e8)
* Minor fixes for unit test delegation.
(cherry picked from commit be199cfe90)
* add support for opening shell on remote Windows host (#43919)
* add support for opening shell on remote Windows host
* added arg completion and fix sanity check
* remove uneeded arg
(cherry picked from commit 6ca4ea0c1f)
* Block network access for unit tests in docker.
(cherry picked from commit 99cac99cbc)
* Make ansible-test available in the bin directory. (#45876)
(cherry picked from commit f3d1f9544b)
* Support comments in ansible-test flat files.
(cherry picked from commit 5a3000af19)
* Fix incorrect use of subprocess.CalledProcessError (#45890)
(cherry picked from commit 24dd87bd0a)
* Improve ansible-test match error handling.
(cherry picked from commit 2056c981ae)
* Improve error handling for docs-build test.
(cherry picked from commit 2148999048)
* Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports.
* Clean up ConfigParser usage in ansible-test.
* Fix bare except statements in ansible-test.
* Miscellaneous cleanup from PyCharm inspections.
* Enable pylint no-self-use for ansible-test.
* Remove obsolete pylint ignores for Python 3.7.
* Fix shellcheck issuers under newer shellcheck.
* Use newer path for ansible-test.
* Fix issues in code-smell tests.
(cherry picked from commit ac492476e5)
* Fix integration test library search path.
This prevents tests from loading modules outside the source tree,
which could result in testing the wrong module if a system-wide
install is present, or custom modules exist.
(cherry picked from commit d603cd41fe)
* Update default container to version 1.2.0.
(cherry picked from commit d478a4c3f6)
(cherry picked from commit 21c4eb8db5)
* Fix ansible-test docker python version handling.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.
(cherry picked from commit 54937ba784)
* Reduce noise in docs-build test failures.
(cherry picked from commit 4085d01617)
* Fix ansible-test encoding issues for exceptions.
(cherry picked from commit 0d7a156319)
* Fix ansible-test multi-group smoke test handling. (#46363)
* Fix ansible-test smoke tests across groups.
* Fix ansible-test list arg defaults.
* Fix ansible-test require and exclude delegation.
* Fix detection of Windows specific changes.
* Add minimal Windows testing for Python 3.7.
(cherry picked from commit e53390b3b1)
* Use default-test-container version 1.3.0.
(cherry picked from commit 6d9be66418)
* Add file exists check in integration-aliases test.
(cherry picked from commit 33a8be9109)
* Improve ansible-test environment checking between tests. (#46459)
* Add unified diff output to environment validation.
This makes it easier to see where the environment changed.
* Compare Python interpreters by version to pip shebangs.
This helps expose cases where pip executables use a different
Python interpreter than is expected.
* Query `pip.__version__` instead of using `pip --version`.
This is a much faster way to query the pip version. It also more
closely matches how we invoke pip within ansible-test.
* Remove redundant environment scan between tests.
This reuses the environment scan from the end of the previous test
as the basis for comparison during the next test.
(cherry picked from commit 0dc7f38787)
* Add symlinks sanity test. (#46467)
* Add symlinks sanity test.
* Replace legacy test symlinks with actual content.
* Remove dir symlink from template_jinja2_latest.
* Update import test to use generated library dir.
* Fix copy test symlink setup.
(cherry picked from commit e2b6047514)
* Fix parametrize warning in unit tests.
(cherry picked from commit 1a28898a00)
* Update MANIFEST.in (#46502)
* Update MANIFEST.in:
- Remove unnecessary prune.
- Include files needed by tests.
- Exclude botmeta sanity test.
These changes permit sanity tests to pass on sdist output.
(cherry picked from commit cbb49f66ec)
* Fix unit tests which modify the source tree. (#45763)
* Fix CNOS unit test log usage.
* Use temp dir for Galaxy unit tests.
* Write to temp files in interfaces_file unit test.
* Fix log placement in netapp_e_ldap unit test.
(cherry picked from commit 0686450cae)
* Fix ansible-test custom docker image traceback.
(cherry picked from commit 712ad9ed64)
* ansible-test: Create public key creating Windows targets (#43760)
* ansible-test: Create public key creating Windows targets
* Changed to always set SSH Key for Windows hosts
(cherry picked from commit adc0efe10c)
* Fix and re-enable sts_assume_role integration tests (#46026)
* Fix the STS assume role error message assertion when the role to assume does not exist.
(cherry picked from commit 18dc928e28)
* Fix ACI unit test on Python 3.7.0.
The previous logic was only needed for pre-release versions of 3.7.
(cherry picked from commit c0bf9815c9)
* Remove placeboify from unit tests that are not calling AWS (i.e. creating a recording) (#45754)
(cherry picked from commit 2167ce6cb6)
* Update sanity test ignore entries.
* Return correct version on installed VyOS (#39115)
* Return correct version on installed VyOS
Previously existing regexp will shows only "VyOS" without numeric output of router version.
For example: from "Version: VyOS 1.1.6" only VyOS will be written in ansible_net_version variable
For more informative output numeric value should be returned as well
* Fixed unittests
(cherry picked from commit 235b11f681)
* Added changelog
* [stable-2.5] [stable-2.7] Fix logic to not re-download existing files when force=no (#45495) (#45509)
* [stable-2.7] Fix logic to not re-download existing files when force=no (#45495)
* Fix logic to not re-download existing files when force=no. Fixes#45491
* Reduce logic complexity.
(cherry picked from commit 5785de582f)
Co-authored-by: Matt Martz <matt@sivel.net>
* Backport of get_url fix cannot use result
result was only added in 2.8+.
(cherry picked from commit 99171a9c6f)
Co-authored-by: Matt Martz <matt@sivel.net>
* Update get_url.py
* Documentation change for resizefs (#43224)
Changed documentation to match the default value of resizefs set in the code.
Added a note on the resizefs use on the example utilizing it.
- Limit virtualenv version on Python 2.6.
- Limit pyopenssl version on Python 2.6.
- Pin pyfmg version to keep unit tests passing.
(cherry picked from commit b3a3e8ba7b)
There should be no warning if there is no ansible.cfg file i nthe
current working directory.
(cherry picked from commit f46c943)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* essential fixes in 2.5
* one more fix
* disable try to see whats the problem
* fix indent
* try to fix msrest version
* fixed test
* undo try-except commenting out
* updated tests
This also allows the test to run on newer containers by not
manipulating any of the pre-configured repositories.
(cherry picked from commit cac51e6da8)
This allows the use of variables in vars_prompt fields but allows variables entered in the prompt to affect play vars rather than throwing an undefined error.
Add tests for vars_prompt
(cherry picked from commit 6d38167d49)
Only print warning when ansible.cfg is actually skipped
* Also add unittests for the find_ini_config_file function
* Add documentation on world writable current working directory
config files can no longer be loaded from a world writable current
working directory but the end user is allowed to specify that
explicitly. Give appropriate warnings and information on how.
Fixes#42388
(cherry picked from commit 30662bedad)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* openvswitch_db: Split key-value pairs correctly (#33335)
Map values can contain commas, e.g.
- name: Configure OVN bridge mapping
openvswitch_db:
state: present table: open_vswitch record: . col: external_ids key: ovn-bridge-mappings
value: '"vmnet-static:br-vmnet-st,vmnet-dynamic:br-vmnet-dyn"'
Previous behaviour was splitting the value and raised an exception.
(cherry picked from commit 3c53e2f8ea)
* openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is
required only for columns with type of a 'map'. This patch makes 'key'
an optional parameter to allow setting values for other column types
like int.
Fixes#42108
(cherry picked from commit 26b0908270)
(cherry picked from commit 01097715fd)
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
(cherry picked from commit 4e489d1be8)
* Make ios_vlan identify vlans starting with 9 (#42247)
* Make ios_vlan identify vlans starting with 9
* Add unit test for vlan id start with 9
(cherry picked from commit 70e33ef92c)
* Added changelog for ios_vlan fix
* [2.5] Update ios tests (#42509)
* 192.168.0.1/24 conflicts with management IP
* Images don't have the hostnames we expect
(cherry picked from commit 399d13d)
Co-authored-by: Nathaniel Case <this.is@nathanielca.se>
* ios test cleanup pt 2 (#42570)
* Remove local from ios_config to avoid needing to add provider
* ios_smoke should test all with local to pick up the slack
(cherry picked from commit 381263ad99)
* Use separate variables for stdin and stdout file descriptors
* Do not set stdout to raw mode when output is not a TTY
(cherry picked from commit 1d1595b990)
* Revert "Account for empty string regexp in lineinfile (#41451)"
This reverts commit 4b5b4a760c.
* Use context managers for interacting with files
* Store line and regexp parameters in a variable
* Add warning when regexp is an empty string
* Remove '=' from error messages
* Update warning message and add changelog
* Add tests
* Improve warning message
Offer an equivalent regexp that won't trigger the warning.
Update tests to match new warning.
* Add porting guide entry for lineinfile change
(cherry picked from commit fb55038d75)
* Skip if insertbefore BOF until later (#41767)
If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF.
Add tests for this scenario.
(cherry picked from commit eaae1318f8)
* Add changelog fragment
* fix minor issues with debug and item labels
- no more `item=None`, we always have a label now
- debug should only show expected information, either msg= or the var in var=
- also fixed method name, deprecated misleading _get_item
(cherry picked from commit 27c43daab8)
When parsing the distribution files such as /etc/os-release, we extract
the full distribution version but not the major version. As such, the
ansible_distribution_major_version ends up being 'NA' whereas the
ansible_distribution_version contains the full version.
Before this patch we get this on openSUSE Leap 15
ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "NA"}, "changed": false}
After this patch we get this
ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "15"}, "changed": false}
This also fixes the Tumbleweed distribution test to report a proper
major version and also adds a test for openSUSE Leap 15.0 to avoid
potential future regressions.
Fixes: #41410
(cherry picked from commit 1737b7be3e)
* Fixes#34893 (#40166)
Fixes several bugs exposed in #34893
* Fixes relative path handling in copy so that it splits directories and
reconstructs the correct file path
* Return failed in the proper circumstances
(cherry picked from commit ca4147f2cc)
* Add changelog for recursive copy fix
(cherry picked from commit cab0f21564)
* Add helpful failure message if target_type=ip is not supported
Create test case for target_type=ip not supported
* Update elb_target_group module to latest standards
Use AnsibleAWSModule
Improve exception handling
Improve connection handling
(cherry picked from commit 29770a297a)
* no_log even when task_result doesn't provide key
- now also checks task property
- added reproducer to tests for unreachable status on item loop
(cherry picked from commit 336b3762b2)
* Add changelog entry for the no_log fix
(cherry picked from commit 5fdd101a3e)
* cherry-picked from 89cea78e30 and fixed merge conflicts from restructuring the integration tests in devel
Fix async for aws_s3
Add a test that async is able to be used on aws_s3 tasks
(cherry picked from commit cef92e3942)
* changelog format tweak
* Fixes to ios_logging (#41029)
* Logging size may not show up in config
* This is much simpler
* Avoid repetition in tests
* Both options of buffered are optional
(cherry picked from commit 92a95368fe)
* Added changelog
* Use _remote_is_local=True for local connection in synchronize (#40833)
* All instances of local connection should use _remote_is_local=True. Fixes#40551
* Switch to instance attribute for synchronize
* Add test that shows that synchronize _remote_is_local addresses tmpdir building
(cherry picked from commit ad7ba91f75)
* Add changelog entry for #40833
* fix become_method 'doas' support by properly specifying becomecmd
a repatch of https://github.com/ansible/ansible/pull/13451/ which was never committed to 'devel' branch.
* fix play_context test for become_method doas to match new becomecmd
(cherry picked from commit be3670f528)
* Fix failing aws_ses_identity integration tests (#39560)
* Fix failing aws_ses_identity integration tests
Reduce boilerplate with yaml anchor
* remove unstable test alias
* Update feedback forwarding check to use desired state rather than
repeated API calls.
(cherry picked from commit 571c183f59)
* changelog
* Fix legacy Nexus 3k integration test and module issues. (#40322)
* Add setup ignore_errors for nxos_config test
* Fix parse_fan_info for n3k
* Skip bidir tests for N3k
* Omit vni config for n3k
* Skip unsupported nxos_vrf_af test on N3K
* Add legacy N3K platform tag
(cherry picked from commit 63e16431b7)
* Skip N35 and N3L platforms for nxos_evpn_global test (#40333)
(cherry picked from commit ad69ef88e7)
* add normalize_interface in module_utils and fix nxos_l3_interface module (#40598)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 0b7932db30)
* nxos_interface: Disable switchport for loopback/svi (#40314)
* nxos_interface: Disable switchport for loopback/svi
* Replace interface_type with get_interface_type(name)
(cherry picked from commit d04a989bd2)
* fixes bug with matching nxos prompts (#40655)
This change addresses an issue where the prompt matching regular
expressions would not match a prompt if the hostname starts with a
numeric value. Before this change, the connection would fail with a
socket.timeout() error. This change updates the termnal_stdout_re
values to now check for a number.
See Github issue #38639
(cherry picked from commit d829ff6993)
* fix nxos_vrf and migrate get_interface_type to module_utils (#40825)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit b4baa2d484)
* nxos_vlan fix
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* changelog nxos bugfixes 2.5.4
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* Ios test fixes (#40503)
* Return messages generated from edit_config to module
* This does not seem to work that way
* Change test IP addresses to not conflict with device config
(cherry picked from commit eb818df1ec)
* Search all assigned ipv6 addresses instead of just the first (#40533)
* Search all assigned ipv6 addresses instead of just the first
* Add test for idempotency with multiple ipv6 addresses assigned
(cherry picked from commit e8d02a3a0f)
* Fix ios test pt. 2 (#40628)
* Add missing idempotence assert
* Remove dhcp with other addresses on ipv6
(cherry picked from commit f88412b7cd)
Change the command to get the interface in a vlan "show vlan" => "show vlan brief"
Change the parsing of the return command of the switch.
The return of the ios command is fixed so i cut with fix number of carracter.
Adding looking for the next line to add the forgeted interfaces.
(cherry picked from commit 3903ca5)
Co-authored-by: pierremahot <pierre.mahot@orange.fr>
* winrm: add better exception handling for krb5 auth with pexpect
* Added changelog fragment
* Added exception handler in case kinit path isn't valid, added test cases
* fixed for Python 2 compatibility
(cherry picked from commit 5e28e282a5)
* Ios test fixes (#40503)
* Return messages generated from edit_config to module
* This does not seem to work that way
* Change test IP addresses to not conflict with device config
* Add test for idempotency with multiple ipv6 addresses assigned
* Do not join flag parameters
This put a comma between every character of the tcp flag parameters, resulting in a bad iptables command.
Fixes#36490
* Use suboptions to ensure tcp_flags options are lists
* Add unit tests for tcp_flags
* Add example of how to use tcp_flags
(cherry picked from commit c9d3bb59a4)
* winrm: source user from options than remote_user (#40467)
* winrm: source user from options than remote_user
* fixed up mock for kerberos import
* Added changelog fragment
* get hostname from option as well
(cherry picked from commit 1ac180c74d)
* Also removed uneeded method that wasn't backported
* ec2_vpc_route_table: Update matching_count parsing on find_subnets function and tests
* ec2_vpc_route_table: Update matching_count parsing on find_subnets function
(cherry picked from commit 1905a6e8fb)
* Fixing lack of failure when uploaded source is invalid (#37461)
Checking the response status for 400 and throwing exception.
Unit tests updated.
Fixes#37406
(cherry picked from commit 5e990301bb)
* changelog
Previously the test framework (DCI, Zuul) were installing the various
dependencies, this meant the list of what was required was duplicated.
Having everything defined in ansible-test makes it easier for people to
run tests locally.
Also this allows the test to work correctly on Python 2 & Python 3
(cherry picked from commit 27942d937f)