Commit Graph

398 Commits (072c4bed1d47559827fb55be345f8317c885aa53)

Author SHA1 Message Date
jctanner 238c6461f6 Add a function to check for killed processes in all strategies (#16684)
* Add a function to check for killed processes so that if any
threads are sigkilled or sigtermed, the entire playbook execution is aborted.
8 years ago
Toshio Kuratomi c8a8f546d4 A little unittest refactoring (#16704)
A little unittest refactoring

* Add a class decorator to generate tests when using a unittest.TestCase base class
* Add a TestCase subclass with setUp() and tearDown() that sets up
  module parameter parsing
* Move test_safe_eval to use the class decorator and ModuleTestCase base
  class
* Move testing of set_mode_if_different into its own file and separate
  some test methods out so we get better errors and more coverage in
  case of errors.
* Naming convention for test cases doesn't need to duplicate information
  that's already in the file path.
8 years ago
James Cammarata 221520cbad Fixing type in 293723f (mock_handler -> mock_handler_task) 8 years ago
James Cammarata 0ea2b2a6af Fix unit test for base strategy in regards to handler changes 8 years ago
s-hertel e84ab95733 Fixing bug in GalaxyCLI test; creates temp dir for role_path instead … (#16689)
* Fixing bug in GalaxyCLI test; creates temp dir for role_path instead of installing to /etc/ansible/roles

* Update test_galaxy.py
8 years ago
nitzmahone de549ad675 update action unit test for powershell shebang behavior 8 years ago
s-hertel 9c925eeeab Adding a test for GalaxyCLI and two methods on which it depends. Tes… (#16651)
* Adding a test for GalaxyCLI and two methods on which it depends. Tests execute_info method.

*  Adding a test for GalaxyCLI and two methods on which it depends. Tests execute_remove method.

* Update test_galaxy.py

* Revising test for GalaxyCLI execute_remove.

* Removing mocks
8 years ago
Robin Roth 1f04130c00 add more distribution version tests (#16563)
* ubuntu 16.04
* solaris 10, 11
* fedora 22, 25

Thanks Peter Oliver for providing the test data
8 years ago
Matt Clay 292785ff2b Parse async response in async action. (#16534)
* Parse async response in async action.
* Add async test for non-JSON data before module output.
* Fix existing async unit test.

Resolves #16156
8 years ago
jctanner 4ba60d00c8 Refactor the parameter splitting in ini lookup to handle more path formats (#16477)
Refactor the parameter splitting in ini lookup to handle more path formats.

Fixes #16468
8 years ago
James Cammarata ca6ee4c789 FEATURE: handler listeners
Fixes ansible/proposals#8
8 years ago
James Cammarata 8218591fec Track notified handlers by object rather than simply their name
Due to the fact that roles may be instantiated with different sets of
params (multiple inclusions of the same role or via role dependencies),
simply tracking notified handlers by name does not work. This patch
changes the way we track handler notifications by using the handler
object itself instead of just the name, allowing for multiple internal
instances. Normally this would be bad, but we also modify the way we
search for handlers by first looking at the notifying tasks dependency
chain (ensuring that roles find their own handlers first) and then at
the main list of handlers, using the first match it finds.

This patch also modifies the way we setup the internal list of handlers,
which should allow us to correctly identify if a notified handler exists
more easily.

Fixes #15084
8 years ago
Nate Coraor 706778ee7f Fix distro detection for Solaris derivatives 8 years ago
jctanner 587d3c368b Fix synchronize+vagrant dest assertions that were incorrect. (#16291)
Addresses #16284
8 years ago
Dag Wieers d91df20620 Fix unit tests for module_name commit #16087 8 years ago
Brian Coca a529a60478 raw should not use default executable (#16085)
also removed unused cruft in script
8 years ago
James Cammarata fbec2d9692 Expand return code values returned by TQM and strategies
This allows the PlaybookExecutor to receive more information regarding
what happened internal to the TaskQueueManager and strategy, to determine
things like whether or not the play iteration should stop.

Fixes #15523
8 years ago
James Cammarata 61f132a609 Adding unit tests for playbook group/host vars 8 years ago
Toshio Kuratomi 5a3493be5f Port urls.py to python3 and other byte vs text fixes (#16124)
* Port urls.py to python3

Fixes (largely normalizing byte vs text strings) for python3

* Rework what we do with attributes that aren't set already.

* Comments
8 years ago
Matt Clay 7a533406f9 Merge pull request #13145 from Mic92/devel
lxc connection plugin
8 years ago
Saran Ahluwalia fda927a14b added failing test for testing if executable is not empty string 8 years ago
Toshio Kuratomi f86df7c88b Test that task.args are also set properly (#15950) 8 years ago
Adrian Likins 644f0fb190 Merge pull request #15178 from alikins/galaxy_info_output
galaxy info displayed 'galaxy_info' section wrong [fix for #15177]
8 years ago
jctanner c52cea8db3 Add a framework, fixtures and test for common synchronize scenarios. (#15983)
* Add a framework, fixtures and test for common synchronize scenarios.

Addresses #15905
8 years ago
jctanner 373b23cc24 Fix mock loader for osx /etc symlinks (#16074)
Fix role based unit tests for osx via mock.patch
8 years ago
Adrian Likins 1468538414 galaxy info displayed 'galaxy_info' section wrong
The output of 'ansible-galaxy info' was formatting the
'galaxy_info' key with one char per line.

Previously, when building the output string, items in
role_info that had a dict for value, the label for
it's key ('galaxy_info' for ex) was being added to
the text list in addition to being appended. Only
the append is needed.

Also added a unit test in test/units/cli/test_galaxy.py,
but skip it on py3 until galaxy is py3 compatible.

fixes #15177
8 years ago
jctanner 018d3c3118 Add a new vmware inventory script backed by pyvmomi (#15967)
Add a new dynamic vmware inventory script backed by pyvmomi
8 years ago
Jörg Thalheim 88482234e6
lxc connection plugin 8 years ago
Brian Coca 329c62e914 docker was deprecated, test now reflects new name 8 years ago
Toshio Kuratomi b41b6b2ec5 Update test off make_become for ssh pty race mitigation (#15931) 8 years ago
Robin Roth 85477fa215 Don't use 'from ansible.module_utils import foo' style here as it breaks (#15756)
py.test"
8 years ago
Toshio Kuratomi c1cc9f1f23 Merge pull request #15845 from abadger/ziploader-constants
Ship constants to the modules via internal module params rather than a secondary dict
8 years ago
Toshio Kuratomi 186337db28 Ship constants to the modules via internal module params rather than a secondary dict. 8 years ago
Matt Davis bc7405efc9 Merge pull request #15797 from robinro/patch-1
reduce async timeout in unittests
8 years ago
Matt Martz 196453b9b2 Merge pull request #13771 from sivel/binary-modules
First pass at allowing binary modules
8 years ago
Matt Martz 0faddfa168 Move binary module detection into executor/module_common.py 8 years ago
Matt Martz 3466e73c50 Resolve test failures 8 years ago
Toshio Kuratomi 292f0ed0d6 If we can't squash for any reason, then simply do not optimize the items loop.
Also add more squashing testcases

Fixes #15649
8 years ago
Toshio Kuratomi 8a184381af Strip junk after JSON return. (#15822)
Fixes #15601
8 years ago
Toshio Kuratomi c730af5dc2 Remove reload from arg related tests. Changes to how ziploader passes args mean we don't need reload anymore. (#15782) 8 years ago
Robin Roth 254cf9ea68 reduce async timeout
reduce from 3 sec to 0.1 sec; the 3 sec sleep was about half of the total unittest time on my development machine...
8 years ago
Toshio Kuratomi 5c7ad654db Add some more tests for item squashing 8 years ago
nitzmahone 133395db30 add jimi-c's unit test for squashed skip results, tweaked is_skipped() logic to pass 8 years ago
Robin Roth 1d6608e84f Dist version fix for Red Hat and more tests (#15663)
* add tests for centos6, rhel6 and rhel7

* gen_distribution_version_testcase with python2.6

* remove unused imports

* fix redhat/vmware/... parsing

* add centos7 test case
8 years ago
Toshio Kuratomi 487e6562ca Fix ziploader for the cornercase of ansible invoking ansible.
* Make ziploader's ansible and ansible.module_utils libraries into
  namespace packages.
* Move __version__ and __author__ from ansible/__init__ to
  ansible/release.py.  This is because namespace packages only load one
  __init__.py.  If that is not the __init__.py with the author and
  version info then those won't be available.
* In ziplaoder, move the version ito ANSIBLE_CONSTANTS.
* Change PluginLoader to properly construct the path to the plugins even
  when namespace packages are present.
8 years ago
Toshio Kuratomi d652b2edc0 Fix for unittests on python2.6 or less 8 years ago
Toshio Kuratomi 7e1fbe2e03 Some algorithmic unittests for the apt and docker modules 8 years ago
Tegan Snyder bf0da4aa3c add centrify dzdo escalation (#15219)
add dzdo context, and test
8 years ago
Toshio Kuratomi 44e21f7062 Allow AnsibleModules to be instantiated more than once in a module
Fix SELINUX monkeypatch in test_basic
8 years ago
Toshio Kuratomi 03126f7097 Fix cut and paste error of test code 8 years ago