Commit graph

4849 commits

Author SHA1 Message Date
saichint
b8cb382a40 nxos_acl_interface tests addition (#38230) 2018-04-04 02:07:37 -04:00
Matt Clay
d653d52dd8
Mark unsupported integration tests. (#38251)
* Mark UCS integration tests as unsupported.
* Mark various connection tests as unsupported.
* Mark win_domain_group test as unsupported.
* Mark java_cert test as unsupported.
* Mark synchronize-buildah test as unsupported.
* Mark various AWS tests as unsupported.
* Mark azure_rm_acs test as unsupported.
* Mark GCP tests as unsupported.
2018-04-03 19:04:23 -07:00
Matt Clay
a5cbc0a2c8
Multiple ansible-test fixes. (#38247)
* Add ansible-test integration --allow-root option.
* Fix destructive target override.
* Fix bad type hint SanityResult -> TestResult.
* Fix skip/python3 filtering with --docker option.
2018-04-03 18:53:53 -07:00
Jordan Borean
f37a44430f win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets (#37897)
* win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets

* compare username in lowercase for test
2018-04-03 18:28:10 -07:00
Julien Vey
63a8ae94a7 cloudfront_distribution: fix restrictions (#37476) 2018-04-04 10:26:14 +10:00
Sloane Hertel
873a9ddf8d [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534)
* stabilize ec2_vpc_subnet module

* Add waiters for ec2_vpc_subnet

Clean up integration tests

* Reenable CI for stabilized ec2_vpc_subnet tests

* rename waiters

* Use module_json_aws where applicable

Handle WaiterError first if waiting failed

* Fix traceback when tagging with keys/values that look like booleans

* Fix check mode with tags

* Add integration tests for tags that look like booleans and check mode

* Add waiter for deleting subnet

* Sleep a few seconds after using aws command line
2018-04-03 15:25:00 -04:00
Rémy Léone
95c15757a2 Initial commit for Scaleway support (#37638) 2018-04-03 14:04:42 -05:00
Julien Vey
b000339a31 ec2_instace: fix instance_role argument (#37465) 2018-04-03 11:39:39 -04:00
Martin Krizek
f666208b75
Add integration test for #35900 (#38090)
* Add integration test for #35900

* Fix cleanup
2018-04-03 16:25:51 +02:00
Trishna Guha
119352b538
nxos_vlan purge (#38202)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-03 02:53:44 -04:00
saichint
24cc6b80bd fix nxos_aaa_server_host issues (#38188) 2018-04-03 01:53:43 -04:00
Alex Stephen
d129396274 GCP: Compute IP Addresses (#36325) 2018-04-02 16:42:49 -04:00
Will Thames
423b0e0f58 Improve details and events results for ecs_service_facts (#37983)
* Use AnsibleAWSModule to simplify AWS connection
* Add Exception handling, pagination, retries and backoff
* Allow events to be switched off
* Allow details to be obtained without having to specify services
2018-04-02 11:26:23 -04:00
Milan Ilic
a73e2a924b Add OpenNebula one_image module (#37831) 2018-04-02 16:58:39 +02:00
saichint
697c301f04 fix nxos_aaa_server issues (#38117) 2018-04-02 07:56:06 -04:00
René Moser
b06dfbec54
cs_user: fix E325 (#38158) 2018-03-31 11:44:04 +02:00
Dag Wieers
800dad5bdf uri: Add redirect tests for none, safe, urllib2 and all (#37068)
This is required if we want to ensure that #36809 doesn't cause any
important behavioral changes.

This PR changes the uri module to support follow_redirects=urllib2

It also adds a better error message when the connection closes before
any data was returned.
2018-03-29 14:54:42 -04:00
Pilou
7908f78fa6 module_common: handle None value for templar (#36651)
* module_common: set required parameter templar

Fix the following error (related to b455901):

  $ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python
  Traceback (most recent call last):
    File "./hacking/test-module", line 268, in <module>
      main()
    File "./hacking/test-module", line 249, in main
      (modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename)
    File "./hacking/test-module", line 152, in boilerplate_module
      task_vars=task_vars
    File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module
      environment=environment)
    File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils
      shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar)
    File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang
      interpreter = templar.template(task_vars[interpreter_config].strip())
  AttributeError: 'NoneType' object has no attribute 'template'

* module_common.modify_module: templar is required
2018-03-29 13:54:48 -04:00
saichint
6f2cb28bb9 fix nxos_vlan issues (#38008) 2018-03-29 06:26:33 -04:00
zikalino
2ad7d79985 additional fixes to function app test 2018-03-29 00:10:43 -07:00
Deepak Agrawal
66b389a00d
show version brief does not work on iosxr virtual (#37609)
* show version brief does not work on iosxr virtual

* ci failures fix
2018-03-29 12:33:41 +05:30
Martin Krizek
73d3ed85ef
Fix apt tests (#37922)
* Fix apt tests

* Enable the test in CI

* Additional fixes not discovered locally

* Don't break mysql tests and fix for 14.04 upgrade

* Remove not needed when cond

* Add shebang to fix-udev script

* Remove workaround in favor of rebuilding containers

* Remove leftover script
2018-03-29 08:20:10 +02:00
Matt Martz
a19a21d715
Add --include and --omit options to ansible-test coverage report (#38061)
* Support --include and --omit with ansible-test coverage report

* Code format change
2018-03-28 18:42:57 -05:00
Matt Clay
9b1e97424e Update Ubuntu image SHAs for ansible-test. 2018-03-28 16:11:24 -07:00
Milan Ilic
0128022654 Add OpenNebula one_vm module (#37825)
* Add OpenNebula one_vm module

* `one_vm` - module for managing VM instances instances on OpenNebula

* Add integration tests
2018-03-28 23:32:03 +02:00
Martin Krizek
cb5e594c13 Fix building from ubuntu1404 Dockerfile 2018-03-28 14:17:31 -07:00
Will Thames
98b29f8ad6 [cloud]Ensure SGs in default VPCs get default egress rule (#38018)
SGs created when a VPC ID was not specified would not necessarily
get the default egress rule, even when no explicit egress rules
were set.

Add some checks for egress rules in results from existing tests
2018-03-28 12:53:35 -04:00
Samer Deeb
9dfb665e43 issue:37307 Add support for changes in pfc output in onyx 3.6.6000 (#37651)
* issue:37307 Add support for changes in pfc output in onyx 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-03-28 17:13:54 +01:00
Olivier Bourdon
612d0d6634 Fix interfaces_file for proper file contents (#37818)
The generated file was completely unusable by the system
therefore the fix which ensures that diffing the file
prior to changes and after only shows diffs

Furthermore the code did not work for Python 3.6
>       f.writelines(to_bytes(lines, errors='surrogate_or_strict'))
E       TypeError: a bytes-like object is required, not 'int'

The other modifications (lambda variable renaming) is to
comply with default flake8 rules
2018-03-28 10:21:43 +01:00
Abhijeet Kasurde
4edcbeb62d
VMware: Gather facts when powerstate is specified (#37908)
This fix adds additional facts after VM powerstate management.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-28 00:19:33 +05:30
Adrian Likins
6e737c8cb6
Fix 'New Vault password' on vault 'edit' (#35923)
* Fix 'New Vault password' on vault 'edit'

ffe0ddea96 introduce a
change on 'ansible-vault edit' that tried to check
for --encrypt-vault-id in that mode. But '--encrypt-vault-id'
is not intended for 'edit' since the 'edit' should always
reuse the vault secret that was used to decrypt the text.

Change cli to not check for --encrypt-vault-id on 'edit'.

VaultLib.decrypt_and_get_vault_id() was change to return
the vault secret used to decrypt (in addition to vault_id
and the plaintext).

VaultEditor.edit_file() will now use 'vault_secret_used'
as returned from decrypt_and_get_vault_id() so that
an edited file always gets reencrypted with the same
secret, regardless of any vault id configuration or
cli options.

Fixes #35834
2018-03-27 14:12:21 -04:00
Senthil Kumar Ganesan
c2226dd18b Purge legacy test modules (#37691) 2018-03-27 09:46:35 +01:00
saichint
135d343254 fix nxos_udld_interface issue (#37527) 2018-03-27 02:57:14 -04:00
Jordan Borean
b1ac65d95a
win_copy: added fix for win_copy deleting local tmp folder (#37964) 2018-03-27 16:20:10 +10:00
Jordan Borean
68e44e082e
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968) 2018-03-27 16:19:45 +10:00
saichint
63da50e1d8 Integration Tests only: nxos_user (#37852)
* add new integration file to nxos_user

* fix shippable error

* change nxapi to connection

* review comments
2018-03-27 01:41:39 -04:00
Matt Martz
5d90ebb28e
Add argument to allow limiting docker container to s specific amount of memory (#37950)
* Add argument to allow limiting docker container to s specific amount of memory

* Address review comments
2018-03-26 16:45:50 -05:00
Matt Clay
2d0547c411 Disable unstable win_uri test. 2018-03-26 13:43:53 -07:00
Matt Martz
ffbbb5a25b
Use arg_spec type for comparisons on default and choices (#37741)
* Use arg_spec type for comparisons on default and choices

* Further improve type casting

* Make sure to capture output in more places

* Individually report invalid choices

* Update ignore.txt after resolving merge conflicts
2018-03-26 12:15:32 -05:00
Matt Martz
1f824bd620 Don't overwrite builtin jinja2 filters with tests (#37881)
* Don't overwrite builtin jinja2 filters with tests. Fixes #37856

* Fix tests and other callers of _get_filters
2018-03-26 12:06:00 -05:00
saichint
0df5cfd41f fix nxos_static_route issues (#37614)
* fix nxos_static_route issues

* remove nxos_static_route from ignore
2018-03-26 11:13:32 -04:00
Ganesh Nalawade
8eaa9cc938
Fix junos modules check_mode issue (#37311)
Fixes #37208

If check_mode is enabled instead of committing th config need to
discard all the chnages to cnadidate db
In case of cli to discard changes issue `rollback 0` command
and for netconf execute `discard-changes` rpc call
2018-03-26 07:27:30 -04:00
Nate
2c44061a04 append request headers instead of replacing (#37845) 2018-03-26 05:35:41 +10:00
Matt Clay
d502745a4e Disable unstable s3_bucket test. 2018-03-24 11:00:32 -07:00
Matt Clay
2ffbd5554f Disable unstable ec2_group test. 2018-03-24 05:11:19 -07:00
Matt Clay
308b0a9772 Increase ansible-test scp retries. 2018-03-24 03:43:26 -07:00
Matt Clay
c7b6a73d41 Disabled unstable ec2_ami test. 2018-03-23 16:49:41 -07:00
Matt Clay
af15a46f20 Disable unstable ec2_vpc_subnet test. 2018-03-23 16:46:42 -07:00
Matt Clay
97942a588a Disable unstable ec2_vpc_route_table test. 2018-03-23 15:44:57 -07:00
zikalino
7284d40049 trying to fix storage blob timing issue 2018-03-23 15:43:27 -07:00
Sam Doran
00068e9fcc
Add integration tests for include_role using variable for tasks_file (#37742)
* Add tests using a variable in tasks_from field

Related to #32503

* Do not test using hostvars with import_role

hostvars cannot be used with import_role — use include_role instead
2018-03-23 15:43:00 -04:00
Alex Tsitsimpis
c3ab6cb9b1 template: Add option to lstrip_blocks' and fix settingtrim_blocks` inline (#37478)
* template: Add integration tests for `lstrip_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Fix passing `trim_blocks' inline

Fix passing `trim_blocks' option to the template module as inline
argument. Previously passing the `trim_blocks' option inline instead of
using the YAML dictionary format resulted in it always being set to
`True', even if `trim_blocks=False' was used.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add option to `lstrip_blocks'

Add option to set `lstrip_blocks' when using the template module to
render Jinja templates. The Jinja documentation suggests that
`trim_blocks' and `lstrip_blocks' is a great combination and the
template module already provides an option for `trim_blocks'.

Note that although `trim_blocks' in Ansible is enabled by default since
version 2.4, in order to avoid breaking things keep `lstrip_blocks'
disabled by default. Maybe in a future version it could be enabled by
default.

This seems to address issue #10725 in a more appropriate way than the
suggested.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add integration tests for `trim_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Check Jinja2 support for `lstrip_blocks'

Since the `lstrip_blocks' option was added in Jinja2 version 2.7, raise
an exception when `lstrip_blocks' is set but Jinja2 does not support it.
Check support for `lstrip_blocks' option by checking `jinja2.defaults'
for `LSTRIP_BLOCKS' and do not use `jinja2.__version__' because the
latter is set to `unknown' in some cases, perhaps due to bug in
`pkg_resources' in Python 2.6.6.

Also update option description to state that Jinja2 version >=2.7 is
required.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
2018-03-23 12:05:21 -04:00
Martin Krizek
00d9345158
apt: mark installed packages manual (#37751)
* apt: mark installed packages manual

* Add fallback for when manual is not a thing
2018-03-23 12:23:12 +01:00
Matt Clay
0dade18f43 Fix yamllinter handling of tuple assignment. 2018-03-22 23:14:21 -07:00
zikalino
503f907b63 fix container instance version 2018-03-22 20:34:27 -07:00
Pierre-Louis Bonicoli
2a7481444b supervisorctl: add integration tests 2018-03-22 15:46:53 -07:00
Matt Clay
4e0ecfd553 Fix ansible-test handling of network plugins. 2018-03-22 15:16:27 -07:00
Toshio Kuratomi
0633f73faf Fix loader for filters (#37748)
* Fix loading of filter and test plugins

Filter and test plugins are different than other plugins in that they
can have many plugins in a single file.  Therefore they need to operate
a little differently.  They need to have all of the potential files
returned.  Then the caller takes care of passing those onto jinja2 in
order for jinja2 to make use of them.

This problem was (most recently) introduced with f921369445

This commit also restructures how we deduplicate plugins to take paths
into account.  If we want to start scoping which set of modules are
loaded (due to roles, for instance) we'll need to hang on to the path
information.

* add integration test for override

* Fix style checks for bcoca code

* Implement jinja2 plugin loader as a subclass

Having a subclass allows us to customize the overriding of jinja
plugins.  We can then move common parts of common code into the Loader.
2018-03-22 17:23:10 -04:00
Sloane Hertel
da3f7a8db1 [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock - fixes #37003 (#37010)
* [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock

Add module warnings rather than silently skipping

* Permit warnings for routes tables containing vpc endpoints to be turned off

* Add tests to ensure a VPC endpoint associated with a route table does not result in a traceback
2018-03-22 15:15:36 -04:00
Matt Clay
f1899f784b Fix docker_secret test on RHEL. 2018-03-22 11:59:41 -07:00
Sloane Hertel
f53f29352d Move AWS placebo fixtures into test/units/utils so module_utils tests can use them (#37300) 2018-03-22 14:57:59 -04:00
Martin Krizek
296ad80002
apt: allow for integration tests using fake repo (#37639)
* apt: allow for integration tests using fake repo

* Add integration test for 19102

* Clean up packages and repo

* Fix indentation
2018-03-22 19:14:40 +01:00
Martin Krizek
ab1db9bcb8 yum: clean fake repos after tests run (#37770) 2018-03-22 13:19:29 -04:00
Matt Clay
ee596743d1 Improve ansible-test retries. 2018-03-21 22:52:27 -07:00
Zim Kalinowski
fcd75bbc5a fixing function app test (#37687) 2018-03-21 20:58:28 -07:00
Matt Clay
c7701fd4ac Disable failing azure_rm_securitygroup test. 2018-03-21 20:52:59 -07:00
Dag Wieers
2c2f335893
win_psexec: Fix pslint issues (#37718) 2018-03-22 03:21:07 +01:00
Dag Wieers
de5fb66026
win_product_facts: Fix pslint issues (#37722) 2018-03-22 03:18:48 +01:00
Zim Kalinowski
fef5f01b11 adding possibility to specify resource group for referred virtual net… (#36768)
* adding possibility to specify resource group for referred virtual network

* fixed sanity issues

* removed trailing whitespace

* added test

* fixed documentation

* try to fix unstable test

* Tidied up the description of virtual_network_resource_group
2018-03-22 12:10:29 +10:00
Zim Kalinowski
0b828ee830 azure_rm_virtualmachine: adding possibility of disabling public ip address (#36766)
* adding possibility of disabling public ip address

* fixed indent

* fixed whitespace

* fixed mistake

* try to create test with vm without public ip address

* try to fix test

* another attempt for test

* fixing test

* create vm with no ip with different name and delete it immediately

* a few additional fixes

* another attempt to pass test

* must be deleted

* simplified no ip test

* reorganised tests

* Wrapped choice in C()
2018-03-22 09:30:42 +10:00
Zim Kalinowski
89401f13f7 azure_rm_networkinterface: fixed issue when public ip address should not be created (#36824)
* fixed issue when public ip address should not be created

* adding test for public ip address

* fixed samples

* another fix to sample formatting

* fixed test

* fix test

* fixed test

* another attempt to fix test

* maybe it works now

* still wrong

* improved check per customer request

* removed stupid semicolon

* updated test to match main scenario

* changed ip configurations to list

* another attempt
2018-03-22 09:16:32 +10:00
Dag Wieers
fdc0e5c5fb
win_defrag: Fix pslint issues (#37719) 2018-03-22 00:06:42 +01:00
Dag Wieers
f78b415db0
win_wakeonlan: Fix pslint issues (#37717) 2018-03-21 23:45:17 +01:00
Matt Clay
c73ee8aac8 Update httptester SHA. 2018-03-21 15:42:48 -07:00
Matt Clay
307d8b5330 Disable PowerShell null comparison test.
Too many false positives due to unknown types.
2018-03-21 15:41:49 -07:00
Matt Clay
05220d693d
Complete updates of remaining code-smell tests. (#37743)
* Add text/binary file support to code smell tests.
* Enhance line-endings code smell test.
* Enhance no-smart-quotes code-smell test.
* Enhance shebang code-smell test.
2018-03-21 12:02:06 -07:00
Matt Martz
7c311ad615 Update httptester for httpbin==0.6.2 2018-03-21 11:21:39 -07:00
Matt Clay
6352e67ab2 Update ansible-test is_binary_file test.
Add hard-coded list of common text and binary extensions.
2018-03-21 11:05:59 -07:00
Matt Clay
aee01564a9 Clean up non-standard module shebangs. 2018-03-21 11:04:55 -07:00
Abhijeet Kasurde
0ae7a0e88c
VMware: Use environment variable for connection (#37726)
This fix adds environment variables for connection in vmware_*
modules.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-21 13:31:24 -04:00
Matt Clay
8daa80e5bb Move var precedence check to integration tests. 2018-03-21 09:43:32 -07:00
Alexander Bethke
eebe728ae8 Fix SteamOS ansible_distribution fact (Fixes #33628) (#37576)
Fixes #33628
2018-03-21 11:50:54 -04:00
Julien Vey
ec2e027980 cloudfront_distribution: fix the order of headers to avoid updates again and again (#37340)
* Fix python2/3 compatibilities issues

* Sort cloudfront_distribution headers to avoid useless updates
2018-03-21 22:16:42 +10:00
Matt Clay
248ca2df21 Fix encoding of code-smell paths on stdin. 2018-03-20 23:00:39 -07:00
zikalino
fa2ff6ceaa enabling storage blob as it seems that test is stable 2018-03-20 22:53:36 -07:00
Matt Clay
51e3882b80 Update tests triggered for bin/ changes. 2018-03-20 16:26:48 -07:00
Matt Clay
97670c4a82 Update ansible-test default container SHA. 2018-03-20 16:25:58 -07:00
Im0
8c4f349743 Test include role with items in name #36372 (#37001)
* Tests for #36372

* Tests for #36372

* Tests for #36372
2018-03-20 15:39:16 -05:00
Izuke
e02c72d856 Fixes #32146 Fixes reconcile inventory to correctly remove hosts from ungrouped 2018-03-20 15:37:39 -04:00
Matt Clay
775539a8b8 Fix api_profile choices in Azure docs fragment. 2018-03-20 11:07:34 -07:00
Matt Clay
f11986c82a
Update default ansible-test docker container. (#37644)
* Limit cryptography version for Python 2.6 tests.
* Specify pip list format to eliminate warning.
2018-03-20 08:54:16 -07:00
Matt Clay
8232c95f42 Pin httptester SHA. 2018-03-20 07:12:53 -07:00
Aleksander Kovtunenko
f51a6ea832 implemented installroot option (#33613)
* fix

* move version to 2.6
2018-03-20 10:41:50 +00:00
Samer Deeb
a89bafce2e issue:37306 Fix issue with vlan support for onyx version 3.6.6000 (#37310)
* issue:37306 Fix issue with vlan support for onyx version 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-03-20 10:08:35 +00:00
Claes Nästén
6308047dc9 nso_verify handle leaf-list in 4.5 and identityref (#37393)
NSO verify did not handle leaf-list value verification in 4.5 and
later due to changes made for configuration writing made.

map prefix for identityref types in verification.
2018-03-20 10:01:36 +00:00
Matt Clay
1fd9a616a4 Fix uri test on Python 2.6. 2018-03-19 23:11:38 -07:00
Claes Nästén
458a07d5a4 add timeout parameter and increase default timeout for nso modules (#37391)
NSO operations can take much longer than 10 seconds as they operate on
real network equipment, set default timeout to 5 minutes and allow for
user override.
2018-03-19 15:12:58 +00:00
Adrian Likins
e166946a0a Fix redundant yaml error blurbs on ModArgs parse errors (#36923)
* Fix redundant yaml error blurbs on ModArgs parse errors

Some of the AnsibleParserErrors from parsing.mod_args
are created with the obj=some_yaml_ds options but
some are not.

If they were, we don't want to add another yaml_ds to
it, because that will result in double yaml error blurbs.
And since we dont need to add info, we can just re raise it.

But if there is no ._obj, add it here so we get the extra
detail in the error message (see issue #14790) and raise
a new AnsibleParserError instance.

Fixes #36848

* cleanup existing test_tasks pep8/sanity issues
2018-03-19 10:55:29 -04:00
Claes Nästén
f8d20f970f Update Cisco NSO module required versions. (#36736)
NSO modules will now work with older versions of NSO, update version
requirements.
2018-03-19 14:18:44 +00:00
Julien Vey
26d9de6f3e apt_repository: check attribute repo for None value (#36944) 2018-03-19 10:16:43 -04:00