Commit Graph

1841 Commits

Author SHA1 Message Date
dd46cb7b05 Add a code-smell test for iterkeys (#18589)
* Add a code-smell test for iterkeys
* Add a message on how to port iterkeys problems and make the grep more robust
2016-12-13 16:39:03 -08:00
f789a20f29 Update log download url. 2016-12-13 16:26:10 -08:00
45772b961f Add private fork CI support to ansible-test. 2016-12-13 15:49:57 -08:00
c6b42028c4 Fixes for uri under python3 and local (non-httptester) testing 2016-12-13 15:46:07 -08:00
dab2bf7e13 Skip test_uri on python 3. 2016-12-13 13:51:57 -08:00
c693ba19f9 unit tests for playbook/conditional.py (#18586)
Start of unit tests for playbook/conditional.py
2016-12-13 14:38:16 -05:00
3efef40822 Add unit tests for playbook/helpers.py (#18709) 2016-12-13 14:36:04 -05:00
1653a77f1d add unit tests for playbook/included_file.py (#18710) 2016-12-13 14:35:27 -05:00
08a5d506bb Fix errors on 'ansible-playbook --flush-cache' (#18754)
Add a unit test, and split out the flush cache logic to
it's own method.
Fixes #18708
2016-12-13 14:35:15 -05:00
6c4f554f5a Provide slightly better msg on fact cache error (#18759)
If the configured fact_cache plugin (fact_caching config)
fails, raise a fatal error instead of failing mysteriously
later.

Fixes #18751
2016-12-13 14:34:58 -05:00
0b8011436d minor spelling changes 2016-12-13 13:51:13 -05:00
84544ee8fd Fix AST nodes for Python 3 and enable dependent test_uri (#18597)
* Enable tests on python 3 for uri

* Added one more node type to SAFE_NODES into safe_eval module.

ast.USub represents unary operators. This is necessary for
parsing some unusual but still valid JSON files during testing
with Python 3.
2016-12-13 07:37:39 -08:00
b915e790d3 veos-dut-01 is down, so use veos01 (#19299) 2016-12-13 14:40:52 +00:00
bdc4fa6b99 Add group_vars/ops.yaml (#19288)
Authentication details for ops modules. Was missed during porting
2016-12-13 11:54:51 +00:00
5bf07454cb Test apache2 force (#18500)
* Use native yaml for apache2 test

* Test removal of default modules with force

a2enmod on debian has `-f`, but not on SUSE (runs there without force).
Therefore don't test that option on SUSE.
The docs already specify that the option is intended for Debian systems
only.
2016-12-12 14:19:47 -08:00
a65e34ce77 Fix synchronize retries (#18535)
* Fix synchronize retries

The synchronize module munges its task args on every invocation of
run(). This was problematic because the munged data was not fit for use
by a second pass of the synchronize module. Correct this by using a copy
of the task args on every invocation of run() so that the original args
are not affected.

Local testing using this playbook seems to confirm that things work as
expected:

  - hosts: all
  tasks:
    - delay: 2
      register: task_result
      retries: 1
      until: task_result.rc == 0
      synchronize:
        dest: /tmp/out
        mode: pull
        src: /tmp/nonexistent/

fixes #18281

* Update synchroncization fixture assertions

When we started operating on a copy of the task args the test assertions
were no longer asserting things about the munged state but of the
pristine state. Convert the copy of task args to a class member so that
it can be compared against later in testing and update the assertions to
check this munged copy.
* Shuffle objects around for cleaner testing

Attach the temporary args dict to the task rather than the action as
this makes updating the existing tests cleaner.
2016-12-12 13:33:30 -08:00
f9c4158ff8 Remove core/extras dirs from old PRs during CI. 2016-12-12 12:41:26 -08:00
39af9b5a86 Make it clearer where the network tests live (#19242) 2016-12-12 18:09:10 +00:00
cd47cb2a15 Remove remnants of obsolete fireball mode. 2016-12-09 16:56:34 -07:00
ac7edef2be Fix modules with documentation errors. 2016-12-09 16:08:26 -07:00
e18bc0d6f0 Add test for auto_import_keys in zypper_repository (#17898)
* tests the bug found in ansible/ansible-modules-extras#3086
2016-12-09 09:47:56 -05:00
1c9a58a885 Run all tests when no last successful commit.
(cherry picked from commit 2e56035fddfd04eb084bd977fc1ee2f35c2f5283)
2016-12-08 11:35:20 -05:00
cb1888125d add metadata to doc support (#18802)
fix broken module docs
change doc AST id extraction to use == instead of in
2016-12-08 11:35:20 -05:00
5628e260f2 Relocate module unit tests. (#18812)
* Relocate module unit tests.
* Fix classification of unit test changes.
2016-12-08 11:35:20 -05:00
573078fc6b Fix unit test directory path target. 2016-12-08 11:35:20 -05:00
75c281debc Fix compile errors in scripts. 2016-12-08 11:35:20 -05:00
47083f145a Don't error if pytest skips all unit tests. 2016-12-08 11:35:20 -05:00
8e951b9f98 Remove legacy test/samples directory. 2016-12-08 11:35:20 -05:00
580401c02b Remove legacy test code. 2016-12-08 11:35:20 -05:00
851b264fb0 Add missing znode module description. 2016-12-08 11:35:20 -05:00
7d3e2b2121 Verify path before assigning to sanity test. 2016-12-08 11:35:19 -05:00
bd7ce0696e Fix tests after repo merge. 2016-12-08 11:35:19 -05:00
dc23667cc2 add back reverted change to network_cli (#18761)
This adds back the change to the network_cli plugin.  Ths change adds
the ensure_connect decorator to the open_shell() method to make sure
the connection is valid before trying to open a shell.

The issue was due to the addition of the decorator that will call
_connect() when there is no connection.  The _connect() method should
have been mocked in the test case.  This commit fixes the test
case as well

Change was originally reverted in c414ded69a
2016-12-05 21:42:09 -05:00
14a2757116 Correct change classification for network plugins. 2016-12-05 20:07:18 -05:00
5f5ea06ca4 make hash_params more robust in the face of many corner cases (#18701)
* make hash_params more robust in the face of many corner cases

Fixes #18680
Alternative fix to #18681

* add test case for role.hash_params

* Add role.hash_params test for more types

A set, a generator/iterable, and a Container that
is not Iterable.
2016-12-05 04:01:45 -08:00
06f5bf980e adds unit test for network_cli connection plugin (#18729) 2016-12-03 20:38:41 -05:00
d2af88ba8a Do not replace existing test skip lists. 2016-12-01 08:45:11 -08:00
c0695ffa41 Add unify_repos.sh to shellcheck skip list. 2016-11-30 23:44:17 -08:00
47a7cb733a use log attribute %(process)d instead of os.getpid (#18691) 2016-11-30 16:26:47 -08:00
ba56c87566 Add SSH_AUTH_SOCK to default env
So ssh-agent works when using locally.
2016-11-30 15:53:15 -08:00
bee58fe890 Fix compile skip path handling for targeted tests. 2016-11-30 09:47:56 -08:00
d22f7b4919 vyos: Don't run show commands that are over ANSIBLE_VYOS_TERMINAL_LENGTH (#18682) 2016-11-30 17:08:52 +00:00
4da7a7ce0e Update coverage exclusions. (#18675)
* Update coverage exclusions.
* Fix logic error in Windows change detection.
2016-11-29 22:46:56 -08:00
6bbd92e422 Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00
bf48383610 Fix regression in jinja2 include search path (#18617)
* Fix regression in jinja2 include search path

Since commit 3c39bb5, the 'ansible_search_path' variable is used to set
jinja2's search path for {% include %} directives. However, this path is
the the proper one because our templates live in 'templates' subdirs in
our search path.

This is a regression because previously, our include search path would
include the dirname of the currently interpreted file, which worked most
of the time.

fixes #18526

* Fix template lookup search path

Improve fix in commit c96c853 so that the search path contain both
template-suffixed paths as well as original paths.

ref PR #18617

* Add integration test for template lookups

Tests regression at #18526

This test fails on current devel branch and succeeds on PR #18617
2016-11-29 16:23:06 -05:00
9b1ce5dfb9 add integration tests for authorized_key (#18130)
Primarily for behavior related to
https://github.com/ansible/ansible-modules-core/issues/4780
2016-11-29 14:47:22 -05:00
2b6d5f9f95 Update network-test-runner.sh (#18672) 2016-11-29 18:44:31 +00:00
a1ca10f7fc Add lots of test cases to inventory/test_host.py (#17827) 2016-11-29 13:38:04 -05:00
ca1514cf2a unified boolean function
optimized boolean function
fixes #17815
2016-11-29 12:34:30 -05:00
d6e2f1846a add a unit test for playbook/base.py (#17688)
* wip: add a unit test for playbook/base.py

This commit include a failing test
TestBaseSubClass.test_attr_class_post_validate

It fails with the error:
Traceback (most recent call last):
  File "/home/adrian/src/ansible/test/units/playbook/test_base.py", line 264, in test_attr_class_post_validate
    bsc = self._base_validate(ds)
  File "/home/adrian/src/ansible/test/units/playbook/test_base.py", line 206, in _base_validate
    bsc.post_validate(templar)
  File "/home/adrian/src/ansible/lib/ansible/playbook/base.py", line 450, in post_validate
    " Error was: %s" % (name, value, attribute.isa, e), obj=self.get_ds())
AnsibleParserError: the field 'test_attr_class_post_validate' has an invalid value (<class 'units.playbook.test_base.ExampleSubClass'>), and could not be converted to an class. Error was: test_attr_class_post_validate is not a valid <class 'units.playbook.test_base.ExampleSubClass'> (got a <class 'ansible.playbook.base.BaseMeta'> instead)

* wip, test refactoring

* wip, trying to add a parent->child

* wip, fix isa=class.

the ds the base using needs an instance of the class
(ie, whats normally created by the yaml loaders)

* wip, theres no need to argue, I just dont understand parents

* stub a _preprocess_data for coverage

* cleanup, required, parent, etc
2016-11-29 10:42:25 -05:00