f86345f777
* basic plugin loading working (with many hacks) * task collections working * play/block-level collection module/action working * implement PEP302 loader * implicit package support (no need for __init.py__ in collections) * provides future options for secure loading of content that shouldn't execute inside controller (eg, actively ignore __init__.py on content/module paths) * provide hook for synthetic collection setup (eg ansible.core pseudo-collection for specifying built-in plugins without legacy path, etc) * synthetic package support * ansible.core.plugins mapping works, others don't * synthetic collections working for modules/actions * fix direct-load legacy * change base package name to ansible_collections * note * collection role loading * expand paths from installed content root vars * feature complete? * rename ansible.core to ansible.builtin * and various sanity fixes * sanity tweaks * unittest fixes * less grabby error handler on has_plugin * probably need to replace with a or harden callers * fix win_ping test * disable module test with explicit file extension; might be able to support in some scenarios, but can't see any other tests that verify that behavior... * fix unicode conversion issues on py2 * attempt to keep things working-ish on py2.6 * python2.6 test fun round 2 * rename dirs/configs to "collections" * add wrapper dir for content-adjacent * fix pythoncheck to use localhost * unicode tweaks, native/bytes string prefixing * rename COLLECTION_PATHS to COLLECTIONS_PATHS * switch to pathspec * path handling cleanup * change expensive `all` back to or chain * unused import cleanup * quotes tweak * use wrapped iter/len in Jinja proxy * var name expansion * comment seemingly overcomplicated playbook_paths resolution * drop unnecessary conditional nesting * eliminate extraneous local * zap superfluous validation function * use slice for rolespec NS assembly * misc naming/unicode fixes * collection callback loader asks if valid FQ name instead of just '.' * switch collection role resolution behavior to be internally `text` as much as possible * misc fixmes * to_native in exception constructor * (slightly) detangle tuple accumulation mess in module_utils __init__ walker * more misc fixmes * tighten up action dispatch, add unqualified action test * rename Collection mixin to CollectionSearch * (attempt to) avoid potential confusion/conflict with builtin collections, etc * stale fixmes * tighten up pluginloader collections determination * sanity test fixes * ditch regex escape * clarify comment * update default collections paths config entry * use PATH format instead of list * skip integration tests on Python 2.6 ci_complete
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
# test code for the win_ping module
|
|
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
|
|
|
|
# This file is part of Ansible
|
|
#
|
|
# Ansible is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Ansible is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
- name: test win_ping
|
|
action: win_ping
|
|
register: win_ping_result
|
|
|
|
- name: check win_ping result
|
|
assert:
|
|
that:
|
|
- win_ping_result is not failed
|
|
- win_ping_result is not changed
|
|
- win_ping_result.ping == 'pong'
|
|
|
|
- name: test win_ping with data
|
|
win_ping:
|
|
data: ☠
|
|
register: win_ping_with_data_result
|
|
|
|
- name: check win_ping result with data
|
|
assert:
|
|
that:
|
|
- win_ping_with_data_result is not failed
|
|
- win_ping_with_data_result is not changed
|
|
- win_ping_with_data_result.ping == '☠'
|
|
|
|
- name: test win_ping.ps1 with data as complex args
|
|
# win_ping.ps1: # TODO: do we want to actually support this? no other tests that I can see...
|
|
win_ping:
|
|
data: bleep
|
|
register: win_ping_ps1_result
|
|
|
|
- name: check win_ping.ps1 result with data
|
|
assert:
|
|
that:
|
|
- win_ping_ps1_result is not failed
|
|
- win_ping_ps1_result is not changed
|
|
- win_ping_ps1_result.ping == 'bleep'
|
|
|
|
- name: test win_ping using data=crash so that it throws an exception
|
|
win_ping:
|
|
data: crash
|
|
register: win_ping_crash_result
|
|
ignore_errors: yes
|
|
|
|
- name: check win_ping_crash result
|
|
assert:
|
|
that:
|
|
- win_ping_crash_result is failed
|
|
- win_ping_crash_result is not changed
|
|
- 'win_ping_crash_result.msg == "Unhandled exception while executing module: boom"'
|
|
- '"throw \"boom\"" in win_ping_crash_result.exception'
|