Commit Graph

1830 Commits (6ffd494efb146714fc4b297706ade5823118a6b1)

Author SHA1 Message Date
Lumír 'Frenzy' Balhar 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.
8 years ago
John R Barker b915e790d3 veos-dut-01 is down, so use veos01 (#19299) 8 years ago
John R Barker bdc4fa6b99 Add group_vars/ops.yaml (#19288)
Authentication details for ops modules. Was missed during porting
8 years ago
Robin Roth 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.
8 years ago
Clark Boylan 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.
8 years ago
Matt Clay f9c4158ff8 Remove core/extras dirs from old PRs during CI. 8 years ago
John R Barker 39af9b5a86 Make it clearer where the network tests live (#19242) 8 years ago
Matt Clay cd47cb2a15 Remove remnants of obsolete fireball mode. 8 years ago
Matt Clay ac7edef2be Fix modules with documentation errors. 8 years ago
Robin Roth e18bc0d6f0 Add test for auto_import_keys in zypper_repository (#17898)
* tests the bug found in ansible/ansible-modules-extras#3086
8 years ago
Matt Clay 1c9a58a885 Run all tests when no last successful commit.
(cherry picked from commit 2e56035fddfd04eb084bd977fc1ee2f35c2f5283)
8 years ago
Matt Davis cb1888125d add metadata to doc support (#18802)
fix broken module docs
change doc AST id extraction to use == instead of in
8 years ago
Matt Clay 5628e260f2 Relocate module unit tests. (#18812)
* Relocate module unit tests.
* Fix classification of unit test changes.
8 years ago
Matt Clay 573078fc6b Fix unit test directory path target. 8 years ago
Matt Clay 75c281debc Fix compile errors in scripts. 8 years ago
Matt Clay 47083f145a Don't error if pytest skips all unit tests. 8 years ago
Matt Clay 8e951b9f98 Remove legacy `test/samples` directory. 8 years ago
Matt Clay 580401c02b Remove legacy test code. 8 years ago
Matt Clay 851b264fb0 Add missing znode module description. 8 years ago
Matt Clay 7d3e2b2121 Verify path before assigning to sanity test. 8 years ago
Matt Clay bd7ce0696e Fix tests after repo merge. 8 years ago
Peter Sprygada 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
8 years ago
Matt Clay 14a2757116 Correct change classification for network plugins. 8 years ago
Toshio Kuratomi 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.
8 years ago
Peter Sprygada 06f5bf980e adds unit test for network_cli connection plugin (#18729) 8 years ago
Matt Clay d2af88ba8a Do not replace existing test skip lists. 8 years ago
Matt Clay c0695ffa41 Add `unify_repos.sh` to shellcheck skip list. 8 years ago
Adrian Likins 47a7cb733a use log attribute %(process)d instead of os.getpid (#18691) 8 years ago
Adrian Likins ba56c87566 Add SSH_AUTH_SOCK to default env
So ssh-agent works when using locally.
8 years ago
Matt Clay bee58fe890 Fix compile skip path handling for targeted tests. 8 years ago
John R Barker d22f7b4919 vyos: Don't run show commands that are over ANSIBLE_VYOS_TERMINAL_LENGTH (#18682) 8 years ago
Matt Clay 4da7a7ce0e Update coverage exclusions. (#18675)
* Update coverage exclusions.
* Fix logic error in Windows change detection.
8 years ago
Matt Clay 6bbd92e422 Initial ansible-test implementation. (#18556) 8 years ago
Virgil Dupras 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
8 years ago
Adrian Likins 9b1ce5dfb9 add integration tests for authorized_key (#18130)
Primarily for behavior related to
https://github.com/ansible/ansible-modules-core/issues/4780
8 years ago
John R Barker 2b6d5f9f95 Update network-test-runner.sh (#18672) 8 years ago
Adrian Likins a1ca10f7fc Add lots of test cases to inventory/test_host.py (#17827) 8 years ago
Brian Coca ca1514cf2a unified boolean function
optimized boolean function
fixes #17815
8 years ago
Adrian Likins 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
8 years ago
Adrian Likins f0c71ad68d More test coverage for plugins/callback/__init__ (#18020) 8 years ago
John R Barker 4875824357 Network dut (#18668)
* Use dedicated account for testing

This also avoids any instance of "vyos" being masked by no_log

* use vyos-dut-01
8 years ago
John R Barker 366b7c7691 Network test runner - Phase 1 (#18524)
* Initial commit of network-test-runner

* remove gist link

* Correctly source hackenv and improve logging

* Remove debug

* Log location
8 years ago
Daniel Miranda 57f4a9885e Make sure include_role inherit variables from parent role (#18627)
* Make sure include_role inherit variables from parent role

Setting the parent of task blocks generated by include_role after they
have been produced is not sufficient - it means the tasks don't have the
correct dependency chain set afterwards, and therefore, don't properly
inherit variables from outer roles.

In addition to manually setting the parents, pass the dep_chain when
compiling the role, such that variables are correctly imported.

Fixes #18540.

* Add tests for include_role

* Fix include_role variable inheritance for multiple parent levels
8 years ago
John R Barker 54c5ea29bb Update inventory.network (#18654) 8 years ago
John R Barker 0793cf3599 HACK test on older vyos machine (#18653) 8 years ago
John R Barker 09550e4f46 Ops (#18652)
* Link to missing ops.yaml

* Add missing ops.yaml
8 years ago
John R Barker a51d79c7a9 Tests are required for Network modules (#18618)
* Tests are required for Network modules

Also detail how to get help

* Update README.md

* Update README.md
8 years ago
John R Barker 4c1bb31611 Use DUT instance for veos (#18608) 8 years ago
Matt Clay 089ffae107 Make ansible-pull integration tests more robust. 8 years ago
Brian Coca 778c983ef9 ansible_playbook_python (#18530)
* ansible_playbook_python

fixes #18471

* fix tests

* removed dupe
8 years ago