Commit graph

2305 commits

Author SHA1 Message Date
Matt Clay
da8963d788 Temporary work-around for setuptools 36.0.0 bug. (#25243)
* Temporary work-around for setuptools 36.0.0 bug.
* Use older setuptools for pip integration test.
* Limit isort version to avoid new test failures.

(cherry picked from commit 9d8aa43c67)
2017-06-01 12:14:24 -05:00
Ricardo Carrillo Cruz
ec545d7b42 Add provider param to prepare_iosxr_tests role tasks (#25163)
This will avoid passing -u -k to ansible-playbook
(cherry picked from commit 69efb61008)
2017-06-01 12:14:23 -05:00
John R Barker
d07ab49904 Update main.yml 2017-06-01 12:14:23 -05:00
bengerman13
f9d781bcab add xattr integration tests to ci (#24950)
* add xattr integration tests to ci

* fix package syntax

* remove unnecessary become, disable xattr for bsd and osx

(cherry picked from commit 4b6db5db7c)
2017-06-01 12:14:21 -05:00
bengerman13
081e98739e add integration tests for xattr module (#24947)
* add integration tests for xattr module

* fix whitespace

(cherry picked from commit 25aac6151f)
2017-06-01 12:14:21 -05:00
kkjang
dd20427db9 Fix expect for python 3 (#24912)
* Fix expect for python 3

- Change generator next to python 3 compatible
- Added tests for expect

* Add pexpect to integration.txt

- add pexpect library to requirements for integration tests

* Use ansible_python_interpreter in integration tests for expect

* Use double-quotes for expect integration tests

* Cast user input to string for expect integration tests

* Cast user input to string earlier in expect integration tests

* Use ansible.module_utils.six.moves input for expect integration tests

* Fix yamllint errors in the expect test

* Use cat to trigger timeout for expect integration tests

* Use realpath filter in expect integration tests

(cherry picked from commit daada2000c)
2017-06-01 12:14:21 -05:00
Toshio Kuratomi
c57e5e1305 Remove vertica_schema from the pep8 legacy files 2017-06-01 12:14:21 -05:00
jhawkesworth
8d0ea29df0 Added win_copy recursive integration test with trailing path separator. (#24523)
This is a reproducer for https://github.com/ansible/ansible/issues/23559

Tests will fail until https://github.com/ansible/ansible/pull/23581 is merged

Note that I believe another commit is also needed for this to work,
specifically the change from: https://github.com/ansible/ansible/pull/23326
(cherry picked from commit b46c098581)
2017-05-23 11:05:41 -07:00
pdasilva
daf2b5e5fb Changed assemble_from_fragments to use os.path.join (#24909)
Fixes #19437
(cherry picked from commit f8e47e2204)
2017-05-22 15:42:17 -07:00
Matt Clay
3a6fd9448e Limit sphinx version on python 2.6. (#24678)
* Limit sphinx version on python 2.6.
* Fix issues identified by rstcheck.

(cherry picked from commit 9178e176b5)
2017-05-17 01:07:41 +08:00
Abhijeet Kasurde
4506da6a6f Fix UnboundLocalError in basic.py
* Fix for UnboundLocalError while accessing deprecations
  in result
* Add Unit test

Fixes #24592

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 764b4b20ec)
2017-05-15 09:32:35 -04:00
Brian Coca
1f3f4cf702 deal with null/none connections
fixes #23621
pushed 'connection resolution' to play_context
override fieldattribute getter

(cherry picked from commit c50cf22d52)
2017-05-11 15:47:09 -04:00
Matt Davis
5f0be9dcd0 slightly increase win_async_wrapper fire and forget sleeptime
* should fix Shippable timeouts when AWS CPU credits are low- right on the bubble of failure w/ 5s execution
(cherry picked from commit ead23783be)
2017-05-09 11:23:05 -07:00
Toshio Kuratomi
af018b75f0 Add integration test that modules are loaded from the expected locations (#24170)
* Add integration test that modules are loaded from the expected locations
* Fix ping module to pass PEP8

(cherry picked from commit 3428f42120)
2017-05-01 08:57:31 -07:00
Matt Martz
778173ec07 Fix password prompt matching (#24081)
* Fix password prompt matching

* Add some tests for check_password_prompt

* Prevent pep8 line ends with a space error

(cherry picked from commit 040fb4435a)
2017-05-01 11:18:38 -04:00
Toshio Kuratomi
98d223a51b Facts Timeout was not settable via ansible.cfg
The timeout for gathering facts needs to be settable from three places
(highest precedence to lowest):

* programmatically
* ansible.cfg (equivalent to the user specifying it explicitly when
  calling setup)
* from the default value

The code was changed in b4bd6c80de to
allow programmatically and the default value to work correctly but
setting via ansible.cfg/parameter was broken.

This change should fix setting via ansible.cfg and adds unittests for
all three cases

Fixes #23753

(cherry picked from commit d088030fa6)
2017-05-01 08:00:11 -07:00
Nathaniel Case
b4380432f6 Run save inside config mode. (#23977)
* Run `save` before exiting config mode.

* Fix unit tests for `save`

* Allow `save` to be on its own again and introspect success

* Introspecting `compare running` makes this a lot harder.

Move `save` tests to integration tests

(cherry picked from commit fc0bf87c20)
2017-04-27 11:09:38 -04:00
Matt Clay
126878488f Fix bugs in ansible-test units command. (#24044)
* Handle old versions of coverage.
* Handle old versions of setuptools.
* Detect python version for docker/remote units.
* Add sanity override for test constraints.

(cherry picked from commit d662f6f0db)
2017-04-27 11:22:44 +08:00
Matt Clay
19c4e1a992 Use Shippable image: drydock/u16pytall:master
* Use Shippable image: drydock/u16pytall:master
* Do not install python 3.6 on Shippable.
2017-04-26 15:49:21 +08:00
Brian Coca
d1c14e8aa4 moved to exceptions for basic skip/fails
better handling of checkmode and async
fix test to follow new flow control

(cherry picked from commit e29dc49a49)
2017-04-25 14:51:22 -04:00
Brian Coca
0878f45a6c keep unsafe .. unsafe (#23742)
* keep unsafe .. unsafe

fixes #23734, which was broken in previous fix that allowed non string types to be templated
use new 'is_template' function vs bastardizing others
refactored clean_data to allow for arbitrary data structures to clean
fixed/removed some tests

(cherry picked from commit 4594bee65a)
2017-04-21 16:09:48 -04:00
Ricardo Carrillo Cruz
a1c0c1582b Add assertion on test_iosxr_facts (#23852)
We hit bug #23737 due to bad coverage on test_iosxr_facts, we
were not checking memory facts at all.
(cherry picked from commit 60de93c31d)
2017-04-21 11:21:40 +02:00
Ricardo Carrillo Cruz
81efc176f4 Add missing provider to eos_banner basic-motd eapi test (#23396)
Otherwise this stalls and timeouts, it doesn't have creds to run.
(cherry picked from commit 2cc2b8fb4d)
2017-04-20 10:57:54 +02:00
Ricardo Carrillo Cruz
a769f0b0f4 Do not assert session name on idempotent eos banner (#23402)
* Check for proper response key on eos_banner map_config_to_obj

If we run the task with 'login' banner, the 'show banner' command
will return a dict containing key 'loginBanner'.
However for motd, it will just return 'motd'.
Yay naming consistency!

* Do not assert session exists on eos_banner response not changing device

(cherry picked from commit 13b2f11139)
2017-04-20 10:57:05 +02:00
Adrian Likins
32be9a9273 Fix vault reading from stdin (avoid realpath() on non-links) (#23583)
* Fix vault reading from stdin (avoid realpath() on non-links)

os.path.realpath() is used to find the target of file paths that
are symlinks so vault operations happen directly on the target.

However, in addition to resolving symlinks, realpath() also returns
a full path. when reading from stdin, vault cli uses '-' as a special
file path so VaultEditor() will replace with stdin.
realpath() was expanding '-' with the CWD to something like
'/home/user/playbooks/-' causing errors like:

        ERROR! [Errno 2] No such file or directory: u'/home/user/ansible/-'

Fix is to specialcase '-' to not use realpath()

Fixes #23567

* to_text decrypt output when writing to stdout

(cherry picked from commit ae3d7fb29e)
2017-04-18 13:08:59 -04:00
Nathaniel Case
c4b6b87344 nxos_vlan tweaks (#23194)
* Remove commented code

Remove a lot of unnecessary output

* Tests

* Sort vlan ids _after_ running set operations, so order is not lost
(cherry picked from commit 0b4cebfb8b)
2017-04-18 10:52:56 -04:00
Matt Clay
06be3c56a9 Add rstcheck to ansible-test and correct issues. (#23550)
* Add rstcheck to ansible-test.
* Fix rst code-block languages and syntax errors.
* Fix rst inline literals.
* Update python 2 code block to pass tests on py 3.

(cherry picked from commit cb1f57d4e5)
2017-04-13 13:18:53 -07:00
Matt Clay
92bdd13bb1 Fix var precedence check to support python 3. (#23552)
* Fix var precedence check to support python 3.
* Run CI sanity tests using python 3.5.
* Disable pylint non-iterator-returned test to pass on python 3.5.

(cherry picked from commit e7bb508ad6)
2017-04-13 13:15:43 -07:00
Matt Clay
69562c5d20 Fix module validator blacklist handling.
Process the blacklist before creating a validator instance.

(cherry picked from commit 442768c45e)
2017-04-13 13:15:36 -07:00
Lumír 'Frenzy' Balhar
4452429b45 Add Python 3 support for validate-modules test. (#21195)
* Improve PEP8 compatibility

* Fix Python 3 incompatibility

Is prohibited to mutate OrderedDict during iteration through it so
is better to add records with error or warning to empty dictionary
instead of delete records from copy of dictionary during iterating.

* Decode output of subprocess from bytes to unicode.

* Add Python 3 support for validate-modules test.

Fix #18367

(cherry picked from commit 9d41aefd71)
2017-04-13 13:15:29 -07:00
Ryan Brown
a256745eae fix validate-module sanity error per https://app.shippable.com/github/ansible/ansible/runs/16493/1/console (#22711)
(cherry picked from commit d791665559)
2017-04-13 13:15:21 -07:00
Matt Clay
345749884d Fix module validation without base branch.
(cherry picked from commit 672e9a2f61)
2017-04-13 13:15:13 -07:00
Matt Clay
5667fe6746 Support module alias and rename validation. (#22675)
Cache git ls-tree output to speed up validation.
(cherry picked from commit 1f337b6421)
2017-04-13 13:14:58 -07:00
Matt Clay
6883cad07e Temporarily cap pylint version < 1.7.0 in tests.
(cherry picked from commit 4ee96b20a3)
2017-04-13 11:27:30 -07:00
Matt Clay
45c2887b19 Fix ansible-test handling of import/syntax errors.
(cherry picked from commit 0cf1e8e061)
2017-04-13 11:27:30 -07:00
Matt Clay
84d5e6e645 Fix errors reported by pylint. (#23282)
* Fix pylint misplaced-bare-raise errors.
* Fix pylint return-in-init error.
* Fix pylint bad-format-character error.
* Fix pylint too-many-format-args errors.
* Fix pylint too-few-format-args errors.
* Fix pylint truncated-format-string error.

(cherry picked from commit 48eeab8a53)
2017-04-13 11:27:30 -07:00
Matt Clay
92c4a3319c Initial pylint support for ansible-test sanity.
(cherry picked from commit 1daa69d685)
2017-04-13 11:27:30 -07:00
Matt Clay
f57d0bab32 Set IO encoding for ansible-test on Shippable.
(cherry picked from commit eec01e2137)
2017-04-13 11:27:30 -07:00
Matt Clay
a491adc425 Fix ansible-test empty diff handling on Shippable.
(cherry picked from commit 92ad9a19b6)
2017-04-13 11:27:30 -07:00
Matt Martz
b96407be86 Extra deps needed for building cryptography
(cherry picked from commit ac61f09203)
2017-04-13 11:27:30 -07:00
Matt Martz
bdf46e928f Fallback to old ssl_wrap_socket
(cherry picked from commit 13ac993d25)
2017-04-13 11:27:30 -07:00
Matt Martz
9acba3fa68 Update install deps for SNI tests
(cherry picked from commit b4b76bab14)
2017-04-13 11:27:30 -07:00
Strahinja Kustudić
701a47c850 Ignores ControlPersist broken pipe errors. Fixes #16731
Ansible will now automatically retry a connection if SSH returns an error:

mux_client_hello_exchange: write packet: Broken pipe

This is probably a bug in SSH, but because it's safe to retry this
connection there is no need for Ansible to fail because of it.

(cherry picked from commit 9f0be5a556)
2017-04-13 11:27:30 -07:00
Brian Coca
e1c1c19a9b added test emulating #23180 use case
(cherry picked from commit 8382ed7200)
2017-04-13 11:01:34 -04:00
Chris Alfonso
292ee29275 Fixes loginBanner plucking over eapi transport when loginBanner isn't set. (#23368) 2017-04-06 11:02:01 -06:00
Nathaniel Case
e2a1ea09dc Attempt to clear up nxos_mtu tests and documentation (#23361)
nxos_system wasn't added until 2.3, so nxos_mtu should have been deprecated
then.
(cherry picked from commit 98c23a3342)
2017-04-06 12:27:06 -04:00
John R Barker
c6e9039b23 fix iosxr commands to encode json (#23346) (#23355)
the command dict in the iosxr module_utils wasn't encoding the request
to json.  this patch will fix that problem
(cherry picked from commit f0008248d4)
2017-04-06 16:18:58 +01:00
Ricardo Carrillo Cruz
5e09ddb6a4 Fix eapi basic-login asserts (#23318)
The asserts where not checking the commands sent to the device
(cherry picked from commit 4571ff0b52)
2017-04-05 20:39:59 +02:00
Ricardo Carrillo Cruz
ebda0bebfc Fix basic-login eapi tests for eos_banner (#23304)
We should be passing the provider dict, not the transport.
(cherry picked from commit d268471739)
2017-04-05 20:02:37 +02:00
Ricardo Carrillo Cruz
6969bef70a Fix asserts on ios_banner tests (#23315)
The contain assert was broken.
(cherry picked from commit cf30f0f27d)
2017-04-05 20:02:24 +02:00