Commit Graph

213 Commits (1f4c65ab9a36f46d215636eb75385691d8faccbc)

Author SHA1 Message Date
James Cammarata bbe8f48a46 Update role unit tests for changes made to require a play during loading 9 years ago
marconius 79394f5c8f Added tests for `taggable` module 9 years ago
James Cammarata bfbb88b4a9 Fix strategy plugin unit tests related to earlier changes 9 years ago
Toshio Kuratomi f44f9569e1 Test unquote works as expected and fix two bugs:
* escaped end quote
* a single quote character
9 years ago
Brian Coca aa6486778f fixed become test to match new expected output 9 years ago
James Cammarata 53cd96befe Updating unit tests to account for new magic variable 'vars' 9 years ago
Matt Martz 2cd3a1be00 assertRaises should be given an exception type. Fixes 11441 9 years ago
James Cammarata 4fbd4ae18b Update VariableManager test for additional magic variable playbook_dir 9 years ago
Brian Coca 5bac17de51 fixed pfexec test 9 years ago
Brian Coca 091caf6279 added missing error class import 9 years ago
Brian Coca e9cf67004b updated fail_on_undefined test to new function signatures 9 years ago
Matt Martz 230be812ba Don't test for play.become_pass any longer 9 years ago
Matt Martz 49d19e82ab Get tests passing
The largest failure in the tests was due to selinux not being installed.
The tests don't require it to be installed, so mock the import.
9 years ago
James Cammarata 9ac624d2c9 Fix mock DictDataLoader _get_file_contents to match real code 9 years ago
James Cammarata fe41f109a9 Merge branch 'v2_final' into devel_switch_v2 9 years ago
James Cammarata 4bc7703db3 Fixing some small bugs related to integration tests (v2) 9 years ago
James Cammarata 0828028c71 Fixing unit test for included file changes 9 years ago
James Cammarata 2bad888f28 Merge branch 'v2_final' into devel_switch_v2
Conflicts:
	lib/ansible/inventory/__init__.py
	lib/ansible/modules/core
	lib/ansible/utils/__init__.py
	lib/ansible/utils/module_docs.py
9 years ago
James Cammarata e59d4f3b51 More module_utils/basic.py unit tests for v2 9 years ago
James Cammarata 339a02c384 Started reworking module_utils/basic unit tests (v2) 9 years ago
James Cammarata d4a31e8d26 Adding unit tests for TaskExecutor (v2) 10 years ago
Serge van Ginderachter b92d70c5b6 tests files extensions in group/host_vars dir
only files with extensions as per
C.YAML_FILENAME_EXTENSIONS should be parsed
10 years ago
James Cammarata 838ff32001 Fix unit test for conn_info (v2)
The default user expected in the connection information is the current
user, not root
10 years ago
James Cammarata ecd5eb902d Adding unit tests for ConnectionInformation (v2) 10 years ago
James Cammarata 9921a1d2be Unit tests for base strategy class (v2) 10 years ago
James Cammarata 21fa385ce7 Reorganizing plugin unit tests and adding start of strategy tests (v2) 10 years ago
James Cammarata a960fcd569 Adding module_utils tests from v1 to v2 10 years ago
James Cammarata 398b1d3e60 Cleaning up template test syntax a bit 10 years ago
James Cammarata 9aa8676bdd More template unit tests for v2 10 years ago
James Cammarata 23cd3294d0 Starting to add v2 tests for template 10 years ago
James Cammarata 48d62fd934 Cleaning up VariableManager tests (v2) 10 years ago
James Cammarata a0509cda1e Fix test_role unit tests to use unique role names to avoid role caching errors 10 years ago
James Cammarata 1ca8cb8553 Fixing up v2 unit tests 10 years ago
Toshio Kuratomi f9f8af06fc Change asserts to assertIsInstance for better error messages 10 years ago
Matt Martz a0fc8bb0bd Testing additions and fixes
* Fix import pathing for units.mock
* Add some additional requirements
* Use compileall to test compatiblity with different python versions
10 years ago
James Cammarata ce3ef7f4c1 Making the switch to v2 10 years ago
Jesse Rusak 652cd6cd5e Fix --force-handlers, and allow it in plays and ansible.cfg
The --force-handlers command line argument was not correctly running
handlers on hosts which had tasks that later failed. This corrects that,
and also allows you to specify force_handlers in ansible.cfg or in a
play.
10 years ago
James Laska 60acdee0dc Enable assert_raises_regexp on py26 10 years ago
Toshio Kuratomi f05cda6ffc Comma is also dependent on position within the hash 10 years ago
Brian Coca 74bf59082d fixed and reintroduced syncronize test, fakerunner object needed become_method to be it's default 'sudo' 10 years ago
Toshio Kuratomi 644e50fe34 Hash randomization makes one of the heuristic_log_sanitize checks not work.
Nothing we can do, when it sanitizes ssh_urls it's simply overzealous.
10 years ago
Brian Coca 587ab17f10 fixes password error detection for ssh connection plugin
removes sycnronize test that does not work with current sudo setup
Fixes #10434
10 years ago
Brian Coca 5f6db0e164 preliminary privlege escalation unification + pbrun
- become constants inherit existing sudo/su ones
- become command line options, marked sudo/su as deprecated and moved sudo/su passwords to runas group
- changed method signatures as privlege escalation is collapsed to become
- added tests for su and become, diabled su for lack of support in local.py
- updated playbook,play and task objects to become
- added become to runner
- added whoami test for become/sudo/su
- added home override dir for plugins
- removed useless method from ask pass
- forced become pass to always be string also uses to_bytes
- fixed fakerunner for tests
- corrected reference in synchronize action plugin
- added pfexec (needs testing)
- removed unused sudo/su in runner init
- removed deprecated info
- updated pe tests to allow to run under sudo and not need root
- normalized become options into a funciton to avoid duplication and inconsistencies
- pushed suppored list to connection classs property
- updated all connection plugins to latest 'become' pe

- includes fixes from feedback (including typos)
- added draft docs
- stub of become_exe, leaving for future v2 fixes
10 years ago
Toshio Kuratomi ffb281d96c Merge pull request #9600 from msabramo/make_AnsibleError_a_plain_ol_exception
Make AnsibleError a plain ol' exception
10 years ago
Alejandro Guirao b8cf131375 Bug fix: Search only for files as candidates 10 years ago
Brian Coca 8872bba21f rearranged math filters 10 years ago
Brian Coca 2642738646 changed jsonify test to ignore whitespace 10 years ago
Brian Coca bc5d0a8cd4 fixed jsonify test 10 years ago
Brian Coca 5f2d5abeea ensure proper strings/unicodestrings for passwords
updated to correct to_bytes function
removed old to_bytes/to_unicode and repointed clients to new location
fixed unicode test
10 years ago
Toshio Kuratomi 4902c06304 Obfuscate passwords in more places where it is displayed 10 years ago
Marc Abramowitz 372a29744b Make AnsibleError a plain ol' exception
Python's Exception constructor already takes a `message` as a parameter,
which you can then get at by doing str(e) (e.message was deprecated).

The reason I bothered to make this change was because I was debugging
with pdb and I noticed that AnsibleErrors don't give useful information
in pdb (probably because they don't have a __repr__ method that prints
the `msg` attribute).

    (Pdb) c
    > /Users/marca/dev/git-repos/ansible/lib/ansible/runner/__init__.py(599)_executor()
    -> msg = str(ae)
    (Pdb) ae
    AnsibleError()
10 years ago
Björn Andersson 65e4f2b2bc Add filter to turn a string into a UUID
This filter was made because I needed to create idempotent UUIDs when
installing the agent for Go (http://go.cd), which uses UUIds to
distinguish the agents from each other.

It uses a newly created Ansible namespace to distinguish UUIDs created
by Ansible from any other source. The new namespace is a random one
created by uuidgen on OSX.
10 years ago
Michael DeHaan d4da58e102 Merge pull request #9720 from vlajos/typofixes-vlajos-20141204
typofixes - https://github.com/vlajos/misspell_fixer
10 years ago
Veres Lajos bf5d8ee678 typofixes - https://github.com/vlajos/misspell_fixer 10 years ago
Brian Coca 97408fe5b2 Revert "Make listify respect the global setting for undefined variables."
This 'mostly' reverts commit 2769098fe7.

Conflicts:
	lib/ansible/utils/__init__.py
	test/units/TestUtils.py
10 years ago
Brian Coca 7d2937b1cc minor fixes to template function
- make sure it calls itself correctly, now passes same params as it recieves
- vars is reserved, changed for templatevars to avoid confustion
- forcing mustaches again since the removal broke 'listification' as per #9622
- fixes incorrectly successful tests using undefined var, now it is defined
- now returns empty list if items is None to avoid errors
10 years ago
Toshio Kuratomi d36c38c35e Exception message changes 10 years ago
Toshio Kuratomi 067112b5ee Code for modules to perform more robust quoting of database identifiers 10 years ago
Toshio Kuratomi 4ae2d58d72 Fix detection of fips mode in test_do_encrypt_md5 10 years ago
James Cammarata 9a0f8f0158 Split out various vars-related things to avoid merging too early
Fixes #9498
10 years ago
Toshio Kuratomi d14dcdc222 Docker test does not require the mock module 10 years ago
Toshio Kuratomi b95475c1f9 Unittest the get_split_image_tag function in the docker module 10 years ago
Toshio Kuratomi 6030be3835 Add unittest for discrete functions in the apt module 10 years ago
Toshio Kuratomi 44eb19d553 Make VaultEditor Tests compatible with FIPS mode
Migrate one test to vault-1.1.  Skip the two other vault 1.0 tests if
running on a FIPS enabled system
10 years ago
Toshio Kuratomi e05b22e0d1 Skip some md5 related unit tests when running in fips mode 10 years ago
Toshio Kuratomi f1267c0b05 Move from md5 to sha1 to work on fips-140 enabled systems 10 years ago
Toshio Kuratomi 48a308a87c Allow both old-style and new-style role dependencies to be valid.
Fixes #9173
10 years ago
Rob Howard 2769098fe7 Make listify respect the global setting for undefined variables.
(Fixes #9008.)

With credit to jimi-c for the initial pass in this commit:
b18bd6b98e
10 years ago
Michael DeHaan 4cb7f654b6 Add stub tests for module args parsing. 10 years ago
Michael DeHaan 6db1b4dfd2 WIP on refactoring changes 10 years ago
Toshio Kuratomi e6fcd90342 Merge pull request #9224 from drawks/iss9223
Resolve #9223 Fix test for python 2.6
10 years ago
Toshio Kuratomi e00d657362 Make unittest compatible with python <= 2.6 10 years ago
Dave Rawks 5f54b57b6d Corrected indentation 10 years ago
Toshio Kuratomi 0af750e3e5 Merge pull request #9182 from bbasleeper/feature_sudo_exe_from_inventory
Add a new inventory parameter (ansible_sudo_exe) to specify sudo command...
10 years ago
Dave Rawks c070ab69f7 Resolve #9223 Fix test for python 2.6
* trivial test refactor to allow for python 2.6 compat
10 years ago
Bruno BAILLUET a25da4af05 Add a new inventory parameter (ansible_sudo_exe) to specify sudo command path. 10 years ago
Michael DeHaan f35ed8a6c0 Update module test code to avoid pycs (that are not used) 10 years ago
Michael DeHaan d6e6d2a6ca Remove regex related to baby-JSON parsing only. 10 years ago
Michael DeHaan 26cdddaebf Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules. 10 years ago
James Cammarata 317ab06bc6 Fixing multiline parsing to preserve newlines
Fixes #8813
10 years ago
James Cammarata 8cc3543918 Re-allow templating of complex_args, but count params to prevent injection
Fixes #8810
10 years ago
Toshio Kuratomi 8233522a7a Reduce commenting as basic.py is copied to the remote host with every module transfer.
Move some comments to the unittest as we might look at that if we decide
to refactor the code.
10 years ago
Toshio Kuratomi d293a46994 Unittests to detect speed regressions in password obfuscation and that
the passwords are correctly hidden in the output.
10 years ago
Michael DeHaan 8a0045baad Update tests for ansible-galaxy CLI additions. 10 years ago
Michael DeHaan d87830e1cc Merge branch 'galaxy_github_archive' of git://github.com/willthames/ansible into devel
Conflicts:
	lib/ansible/utils/__init__.py
10 years ago
James Cammarata d01188033f Checking for localized versions of the su password prompt
Fixes #8681
10 years ago
Will Thames 850963790d Allow roles to be installed from archives on github
Ensure that the automated scm determination for github.com
repos still copes with .tar.gz archive files.

Handling .zip archives is left as an exercise for the interested reader
10 years ago
Michael DeHaan bcb44276fe Assume github.com URLs are git protocol if not specified. 10 years ago
Will Thames 6e9abefc11 Corrected bug where role_path was wrong for roles in subdirectories
Fixed role name for
    - { role: 'lives/in/a/subdirectory' }
Should be 'lives/in/a/subdirectory', not just 'subdirectory'
10 years ago
Will Thames 46b59b02ed Friendly Role Names and roles from URLs
* Roles can now be given a friendly name as third field in role spec csv
* Roles can be installed from URL (not just from archived SCMs)
* Integration tests to demonstrate this
* Unit tests to ensure that role spec parsing works as expected
10 years ago
Will Thames 4803e923ff Improved handling of role_version in repo_url_to_role_name 10 years ago
Will Thames c2fe33f9f4 Tidied up a little, added tests
Moved repo_url_to_role_name to common method in ansible.utils
Added unit test for repo_url_to_role_name
Added integration tests for galaxy
10 years ago
James Cammarata 8a1fbed5d6 Correct variable blending from vars_files with hostvars in them
Fixes #8638
10 years ago
Michael DeHaan 99c39b1ff3 By popular request, make the no_log attribute also censor tasks from callbacks. 10 years ago
James Cammarata 5a128ca286 Adding extra member to mock inventory for unittests 10 years ago
Michael DeHaan 2629cd3fce Fix some copyrights, fix a misc test. 10 years ago
James Cammarata 25e9d1197e Merge branch 'optimise_utils_clean_data' of https://github.com/leth/ansible into leth-optimise_utils_clean_data 10 years ago
Marcus Cobden e3dbca9378 Test escaping strings with two variables 10 years ago
Michael DeHaan 3bead39c75 Merge branch 'spelling' of git://github.com/cgar/ansible into devel
Conflicts:
	docsite/rst/guide_rax.rst
	plugins/callbacks/mail.py
10 years ago
James Cammarata 63bf2f6d9a Preserve all line breaks in literal blocks
Fixes #8512
10 years ago