From 7b3fadf17dbaa4b875dab2b9c33679d47e72c081 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Tue, 8 May 2018 21:18:49 +0200 Subject: [PATCH] Test more action modules Recent failures of the shell module during Ansible 2.5 testing shows that we have a test hole there. Change-Id: I5a63a99ad140b832b0b16e839d4fc2b63bd5cd1b --- .../git/org_project/playbooks/command-good.yaml | 4 ++++ .../git/org_project/playbooks/raw-good.yaml | 4 ++++ .../git/org_project/playbooks/shell-good.yaml | 10 ++++++++++ tests/remote/test_remote_action_modules.py | 9 +++++++++ 4 files changed, 27 insertions(+) create mode 100644 tests/fixtures/config/remote-action-modules/git/org_project/playbooks/command-good.yaml create mode 100644 tests/fixtures/config/remote-action-modules/git/org_project/playbooks/raw-good.yaml create mode 100644 tests/fixtures/config/remote-action-modules/git/org_project/playbooks/shell-good.yaml diff --git a/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/command-good.yaml b/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/command-good.yaml new file mode 100644 index 0000000000..a89ba4c0dc --- /dev/null +++ b/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/command-good.yaml @@ -0,0 +1,4 @@ +- hosts: all + tasks: + - name: Some command + command: echo 123 diff --git a/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/raw-good.yaml b/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/raw-good.yaml new file mode 100644 index 0000000000..fc7b301211 --- /dev/null +++ b/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/raw-good.yaml @@ -0,0 +1,4 @@ +- hosts: all + tasks: + - name: Some raw command + raw: echo 123 diff --git a/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/shell-good.yaml b/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/shell-good.yaml new file mode 100644 index 0000000000..05d44b5c24 --- /dev/null +++ b/tests/fixtures/config/remote-action-modules/git/org_project/playbooks/shell-good.yaml @@ -0,0 +1,10 @@ +- hosts: all + tasks: + - name: Normal shell + shell: echo 123 + + - name: Shell with executable + shell: | + echo 123 + args: + executable: /bin/bash diff --git a/tests/remote/test_remote_action_modules.py b/tests/remote/test_remote_action_modules.py index 9933553431..0899e5d14a 100644 --- a/tests/remote/test_remote_action_modules.py +++ b/tests/remote/test_remote_action_modules.py @@ -92,6 +92,9 @@ class TestActionModules(AnsibleZuulTestCase): self._run_job('assemble-bad-dir-with-symlink', 'FAILURE', ERROR_ACCESS_OUTSIDE) + def test_command_module(self): + self._run_job('command-good', 'SUCCESS') + def test_copy_module(self): self._run_job('copy-good', 'SUCCESS') @@ -133,6 +136,9 @@ class TestActionModules(AnsibleZuulTestCase): self._run_job('patch-bad', 'FAILURE', ERROR_ACCESS_OUTSIDE) self._run_job('patch-bad-symlink', 'FAILURE', ERROR_ACCESS_OUTSIDE) + def test_raw_module(self): + self._run_job('raw-good', 'SUCCESS') + def test_script_module(self): self._run_job('script-good', 'SUCCESS') @@ -145,6 +151,9 @@ class TestActionModules(AnsibleZuulTestCase): self._run_job('script-bad', 'FAILURE', ERROR_ACCESS_OUTSIDE) self._run_job('script-bad-symlink', 'FAILURE', ERROR_ACCESS_OUTSIDE) + def test_shell_module(self): + self._run_job('shell-good', 'SUCCESS') + def test_template_module(self): self._run_job('template-good', 'SUCCESS')