summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-09-08 21:30:00 +0000
committerGerrit Code Review <review@openstack.org>2022-09-08 21:30:00 +0000
commit3d60914a0e2cbc6017abce7caa9a16cc1e49bcc3 (patch)
treeffed75fe4ad6109c2e0b418d9ba9e9bd152c95b7 /tests
parent47227b743f0daeac5a870ab10a29ace8ecfedaf3 (diff)
parent7949efd255e76dd63412a13edac3927bf2939b84 (diff)
downloadzuul-3d60914a0e2cbc6017abce7caa9a16cc1e49bcc3.tar.gz
Merge "Add Ansible 6"
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/config/ansible-callbacks/main6.yaml7
-rw-r--r--tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml10
-rw-r--r--tests/fixtures/config/ansible/main6.yaml11
-rw-r--r--tests/fixtures/config/executor-facts/main6.yaml9
-rw-r--r--tests/fixtures/config/inventory/git/common-config/zuul.yaml9
-rw-r--r--tests/fixtures/config/inventory/git/org_project/.zuul.yaml1
-rwxr-xr-xtests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py2
-rwxr-xr-xtests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py2
-rw-r--r--tests/remote/test_remote_action_modules.py8
-rw-r--r--tests/remote/test_remote_zuul_json.py8
-rw-r--r--tests/remote/test_remote_zuul_stream.py9
-rw-r--r--tests/unit/test_executor.py12
-rw-r--r--tests/unit/test_inventory.py24
-rw-r--r--tests/unit/test_v3.py7
14 files changed, 117 insertions, 2 deletions
diff --git a/tests/fixtures/config/ansible-callbacks/main6.yaml b/tests/fixtures/config/ansible-callbacks/main6.yaml
new file mode 100644
index 000000000..2467362bb
--- /dev/null
+++ b/tests/fixtures/config/ansible-callbacks/main6.yaml
@@ -0,0 +1,7 @@
+- tenant:
+ name: tenant-one
+ default-ansible-version: '6'
+ source:
+ gerrit:
+ config-projects:
+ - common-config
diff --git a/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml b/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml
index 3a34a1d86..e1bac5e01 100644
--- a/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/ansible-versions/git/common-config/zuul.yaml
@@ -60,6 +60,14 @@
test_ansible_version_major: 2
test_ansible_version_minor: 12
+- job:
+ name: ansible-6
+ parent: ansible-version
+ ansible-version: 6
+ vars:
+ test_ansible_version_major: 2
+ test_ansible_version_minor: 13
+
- project:
name: common-config
check:
@@ -68,6 +76,7 @@
- ansible-28
- ansible-29
- ansible-5
+ - ansible-6
- project:
name: org/project
@@ -77,3 +86,4 @@
- ansible-28
- ansible-29
- ansible-5
+ - ansible-6
diff --git a/tests/fixtures/config/ansible/main6.yaml b/tests/fixtures/config/ansible/main6.yaml
new file mode 100644
index 000000000..7db6af6da
--- /dev/null
+++ b/tests/fixtures/config/ansible/main6.yaml
@@ -0,0 +1,11 @@
+- tenant:
+ name: tenant-one
+ default-ansible-version: '6'
+ source:
+ gerrit:
+ config-projects:
+ - common-config
+ untrusted-projects:
+ - org/project
+ - bare-role
+ - org/ansible
diff --git a/tests/fixtures/config/executor-facts/main6.yaml b/tests/fixtures/config/executor-facts/main6.yaml
new file mode 100644
index 000000000..792f13402
--- /dev/null
+++ b/tests/fixtures/config/executor-facts/main6.yaml
@@ -0,0 +1,9 @@
+- tenant:
+ name: tenant-one
+ default-ansible-version: '6'
+ source:
+ gerrit:
+ config-projects:
+ - common-config
+ untrusted-projects:
+ - org/project
diff --git a/tests/fixtures/config/inventory/git/common-config/zuul.yaml b/tests/fixtures/config/inventory/git/common-config/zuul.yaml
index 6b5fe67d0..ca687139d 100644
--- a/tests/fixtures/config/inventory/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/inventory/git/common-config/zuul.yaml
@@ -140,3 +140,12 @@
label: ubuntu-xenial
ansible-version: '5'
run: playbooks/ansible-version.yaml
+
+- job:
+ name: ansible-version6-inventory
+ nodeset:
+ nodes:
+ - name: ubuntu-xenial
+ label: ubuntu-xenial
+ ansible-version: '6'
+ run: playbooks/ansible-version.yaml
diff --git a/tests/fixtures/config/inventory/git/org_project/.zuul.yaml b/tests/fixtures/config/inventory/git/org_project/.zuul.yaml
index 1028a0ff2..69ec3127e 100644
--- a/tests/fixtures/config/inventory/git/org_project/.zuul.yaml
+++ b/tests/fixtures/config/inventory/git/org_project/.zuul.yaml
@@ -10,3 +10,4 @@
- ansible-version28-inventory
- ansible-version29-inventory
- ansible-version5-inventory
+ - ansible-version6-inventory
diff --git a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py
index 6cfa0a3d0..7933f15a8 100755
--- a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py
+++ b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_exception.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
def main():
diff --git a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py
index 065509d0d..0bdced5eb 100755
--- a/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py
+++ b/tests/fixtures/config/remote-zuul-stream/git/org_project/playbooks/library/broken_module_no_result.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
def main():
diff --git a/tests/remote/test_remote_action_modules.py b/tests/remote/test_remote_action_modules.py
index bbe6db0a0..30e430b74 100644
--- a/tests/remote/test_remote_action_modules.py
+++ b/tests/remote/test_remote_action_modules.py
@@ -109,3 +109,11 @@ class TestActionModules5(AnsibleZuulTestCase, FunctionalActionModulesMixIn):
def setUp(self):
super().setUp()
self._setUp()
+
+
+class TestActionModules6(AnsibleZuulTestCase, FunctionalActionModulesMixIn):
+ ansible_version = '6'
+
+ def setUp(self):
+ super().setUp()
+ self._setUp()
diff --git a/tests/remote/test_remote_zuul_json.py b/tests/remote/test_remote_zuul_json.py
index 120235ec9..e4510e7d1 100644
--- a/tests/remote/test_remote_zuul_json.py
+++ b/tests/remote/test_remote_zuul_json.py
@@ -166,3 +166,11 @@ class TestZuulJSON5(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
def setUp(self):
super().setUp()
self._setUp()
+
+
+class TestZuulJSON6(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
+ ansible_version = '6'
+
+ def setUp(self):
+ super().setUp()
+ self._setUp()
diff --git a/tests/remote/test_remote_zuul_stream.py b/tests/remote/test_remote_zuul_stream.py
index 225c88e96..b84c4b0d8 100644
--- a/tests/remote/test_remote_zuul_stream.py
+++ b/tests/remote/test_remote_zuul_stream.py
@@ -280,3 +280,12 @@ class TestZuulStream5(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
def setUp(self):
super().setUp()
self._setUp()
+
+
+class TestZuulStream6(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
+ ansible_version = '6'
+ ansible_core_version = '2.13'
+
+ def setUp(self):
+ super().setUp()
+ self._setUp()
diff --git a/tests/unit/test_executor.py b/tests/unit/test_executor.py
index 6296ebe59..27ca75531 100644
--- a/tests/unit/test_executor.py
+++ b/tests/unit/test_executor.py
@@ -885,6 +885,11 @@ class TestExecutorFacts5(AnsibleZuulTestCase, ExecutorFactsMixin):
ansible_major_minor = '2.12'
+class TestExecutorFacts6(AnsibleZuulTestCase, ExecutorFactsMixin):
+ tenant_config_file = 'config/executor-facts/main6.yaml'
+ ansible_major_minor = '2.13'
+
+
class AnsibleCallbackConfigsMixin:
config_file = 'zuul-executor-ansible-callback.conf'
@@ -957,6 +962,13 @@ class TestAnsibleCallbackConfigs5(AnsibleZuulTestCase,
ansible_major_minor = '2.12'
+class TestAnsibleCallbackConfigs6(AnsibleZuulTestCase,
+ AnsibleCallbackConfigsMixin):
+ config_file = 'zuul-executor-ansible-callback.conf'
+ tenant_config_file = 'config/ansible-callbacks/main6.yaml'
+ ansible_major_minor = '2.13'
+
+
class TestExecutorEnvironment(AnsibleZuulTestCase):
tenant_config_file = 'config/zuul-environment-filter/main.yaml'
diff --git a/tests/unit/test_inventory.py b/tests/unit/test_inventory.py
index 9dc1b3692..83a62a0e7 100644
--- a/tests/unit/test_inventory.py
+++ b/tests/unit/test_inventory.py
@@ -255,6 +255,30 @@ class TestInventoryAutoPython(TestInventoryBase):
self.executor_server.release()
self.waitUntilSettled()
+ def test_auto_python_ansible6_inventory(self):
+ inventory = self._get_build_inventory('ansible-version6-inventory')
+
+ all_nodes = ('ubuntu-xenial',)
+ self.assertIn('all', inventory)
+ self.assertIn('hosts', inventory['all'])
+ self.assertIn('vars', inventory['all'])
+ for node_name in all_nodes:
+ self.assertIn(node_name, inventory['all']['hosts'])
+ node_vars = inventory['all']['hosts'][node_name]
+ self.assertEqual(
+ 'auto', node_vars['ansible_python_interpreter'])
+
+ self.assertIn('zuul', inventory['all']['vars'])
+ z_vars = inventory['all']['vars']['zuul']
+ self.assertIn('executor', z_vars)
+ self.assertIn('src_root', z_vars['executor'])
+ self.assertIn('job', z_vars)
+ self.assertEqual(z_vars['job'], 'ansible-version6-inventory')
+ self.assertEqual(z_vars['message'], 'QQ==')
+
+ self.executor_server.release()
+ self.waitUntilSettled()
+
class TestInventory(TestInventoryBase):
diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py
index 4c2befd61..d35b23285 100644
--- a/tests/unit/test_v3.py
+++ b/tests/unit/test_v3.py
@@ -3858,6 +3858,11 @@ class TestAnsible5(AnsibleZuulTestCase, FunctionalAnsibleMixIn):
ansible_major_minor = '2.12'
+class TestAnsible6(AnsibleZuulTestCase, FunctionalAnsibleMixIn):
+ tenant_config_file = 'config/ansible/main6.yaml'
+ ansible_major_minor = '2.13'
+
+
class TestPrePlaybooks(AnsibleZuulTestCase):
# A temporary class to hold new tests while others are disabled
@@ -7951,6 +7956,7 @@ class TestAnsibleVersion(AnsibleZuulTestCase):
dict(name='ansible-28', result='SUCCESS', changes='1,1'),
dict(name='ansible-29', result='SUCCESS', changes='1,1'),
dict(name='ansible-5', result='SUCCESS', changes='1,1'),
+ dict(name='ansible-6', result='SUCCESS', changes='1,1'),
], ordered=False)
@@ -7972,6 +7978,7 @@ class TestDefaultAnsibleVersion(AnsibleZuulTestCase):
dict(name='ansible-28', result='SUCCESS', changes='1,1'),
dict(name='ansible-29', result='SUCCESS', changes='1,1'),
dict(name='ansible-5', result='SUCCESS', changes='1,1'),
+ dict(name='ansible-6', result='SUCCESS', changes='1,1'),
], ordered=False)