issue #409: more lxc/lxd stub tests, let tests run on vanilla.
This commit is contained in:
parent
54445470e2
commit
144685a327
|
@ -1,3 +1,5 @@
|
|||
- import_playbook: kubectl.yml
|
||||
- import_playbook: lxc.yml
|
||||
- import_playbook: lxd.yml
|
||||
- import_playbook: setns_lxc.yml
|
||||
- import_playbook: setns_lxd.yml
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
gather_facts: false
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- meta: end_play
|
||||
when: ansible_version.full < '2.5'
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
- name: integration/stub_connections/lxc.yml
|
||||
hosts: test-targets
|
||||
gather_facts: false
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- custom_python_detect_environment:
|
||||
vars:
|
||||
ansible_connection: lxc
|
||||
mitogen_lxc_attach_path: stub-lxc-attach.py
|
||||
register: out
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- out.env.THIS_IS_STUB_LXC_ATTACH == '1'
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
- name: integration/stub_connections/lxd.yml
|
||||
hosts: test-targets
|
||||
gather_facts: false
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- custom_python_detect_environment:
|
||||
vars:
|
||||
ansible_connection: lxd
|
||||
mitogen_lxc_path: stub-lxc.py
|
||||
register: out
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- out.env.THIS_IS_STUB_LXC == '1'
|
|
@ -8,6 +8,9 @@
|
|||
any_errors_fatal: false
|
||||
connection: local
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- include_tasks: _end_play_if_not_sudo_linux.yml
|
||||
|
||||
- command: |
|
||||
|
@ -22,9 +25,6 @@
|
|||
args:
|
||||
chdir: ../..
|
||||
warn: false
|
||||
when: |
|
||||
out.ansible_facts.ansible_system == 'Linux'
|
||||
and sudo_available.rc == 0
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -2,12 +2,15 @@
|
|||
# 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
|
||||
- name: integration/stub_connections/setns_lxd.yml
|
||||
hosts: test-targets
|
||||
gather_facts: false
|
||||
any_errors_fatal: false
|
||||
connection: local
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- include_tasks: _end_play_if_not_sudo_linux.yml
|
||||
|
||||
- command: |
|
||||
|
@ -15,7 +18,7 @@
|
|||
-i localhost,
|
||||
-c setns
|
||||
-e mitogen_kind=lxd
|
||||
-e mitogen_lxc_info_path=stub-lxc.py
|
||||
-e mitogen_lxc_path=stub-lxc.py
|
||||
-m shell
|
||||
-a "echo hi"
|
||||
localhost
|
||||
|
|
|
@ -4,4 +4,5 @@ import sys
|
|||
import os
|
||||
|
||||
os.environ['ORIGINAL_ARGV'] = repr(sys.argv)
|
||||
os.environ['THIS_IS_STUB_LXC_ATTACH'] = '1'
|
||||
os.execv(sys.executable, sys.argv[sys.argv.index('--') + 1:])
|
||||
|
|
|
@ -9,4 +9,5 @@ if sys.argv[1] == 'info':
|
|||
sys.exit(0)
|
||||
|
||||
os.environ['ORIGINAL_ARGV'] = repr(sys.argv)
|
||||
os.environ['THIS_IS_STUB_LXC'] = '1'
|
||||
os.execv(sys.executable, sys.argv[sys.argv.index('--') + 1:])
|
||||
|
|
Loading…
Reference in New Issue