issue #409: add new stub_connections/ test type.
parent
429832b8f7
commit
f2294c1678
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# `stub_connections/`
|
||||||
|
|
||||||
|
The playbooks in this directory use stub implementations of various third party
|
||||||
|
tools (kubectl etc.) to verify arguments passed by Ansible to Mitogen and
|
||||||
|
subsequently onward to the tool result in something that looks sane.
|
||||||
|
|
||||||
|
These are bare minimum tests just to ensure sporadically tested connection
|
||||||
|
methods haven't broken in embarrasingly obvious ways.
|
@ -0,0 +1,2 @@
|
|||||||
|
- import_playbook: kubectl.yml
|
||||||
|
- import_playbook: setns_lxc.yml
|
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
- name: integration/stub_connections/kubectl.yml
|
||||||
|
hosts: test-targets
|
||||||
|
gather_facts: false
|
||||||
|
any_errors_fatal: true
|
||||||
|
tasks:
|
||||||
|
- custom_python_detect_environment:
|
||||||
|
vars:
|
||||||
|
ansible_connection: kubectl
|
||||||
|
mitogen_kubectl_path: stub-kubectl.py
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- out.env.THIS_IS_STUB_KUBECTL == '1'
|
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
# issue #409.
|
||||||
|
# setns is hard -- it wants to do superuser syscalls, so we must run it in a
|
||||||
|
# child Ansible via sudo. But that only works if sudo works.
|
||||||
|
|
||||||
|
- name: integration/stub_connections/setns_lxc.yml
|
||||||
|
hosts: test-targets
|
||||||
|
gather_facts: false
|
||||||
|
any_errors_fatal: true
|
||||||
|
connection: local
|
||||||
|
tasks:
|
||||||
|
- setup:
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- command: |
|
||||||
|
sudo -E ansible
|
||||||
|
-i localhost,
|
||||||
|
-c setns
|
||||||
|
-e mitogen_kind=lxc
|
||||||
|
-e mitogen_lxc_info_path=stub-lxc-info.py
|
||||||
|
-m shell
|
||||||
|
-a "echo hi"
|
||||||
|
localhost
|
||||||
|
args:
|
||||||
|
chdir: ../..
|
||||||
|
warn: false
|
||||||
|
|
||||||
|
# TODO: we don't know if sudo works on this machine, so hard wire it for
|
||||||
|
# me and for Travis CI.
|
||||||
|
when: out.ansible_facts.ansible_user_id in ['dmw', 'travis']
|
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# Mainly for use in stubconnections/kubectl.yml
|
||||||
|
|
||||||
|
print 'PID: 1'
|
Loading…
Reference in New Issue