diff --git a/playbooks/ansible-role-functional/pre.yaml b/playbooks/ansible-role-functional/pre.yaml new file mode 100644 index 00000000..987315cc --- /dev/null +++ b/playbooks/ansible-role-functional/pre.yaml @@ -0,0 +1,13 @@ +- hosts: all + name: Set up SSH login + tasks: + + - name: Allow ssh login into localhost + shell: + cmd: | + # Allow user to ssh into localhost + ssh-keygen -f ~/.ssh/id_rsa -N "" + cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys + ssh-keyscan localhost >> ~/.ssh/known_hosts + ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts + chdir: '{{ zuul.project.src_dir }}' diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 543b67ad..9265328a 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -397,28 +397,6 @@ vars: tox_envlist: functional -- job: - name: openstack-tox-functional-centos-7 - parent: openstack-tox-functional - description: | - Run tox-based functional tests for an OpenStack Python project. - - Uses tox with the ``functional`` environment. - - Runs on CentOS 7 node. - nodeset: centos-7 - -- job: - name: openstack-tox-functional-fedora-26 - parent: openstack-tox-functional - description: | - Run tox-based functional tests for an OpenStack Python project. - - Uses tox with the ``functional`` environment. - - Runs on a Fedora 26 node. - nodeset: fedora-26 - - job: name: openstack-tox-functional-py35 parent: openstack-tox @@ -1032,3 +1010,29 @@ tox_envlist: linters tox_environment: ANSIBLE_ROLES_PATH: ~/src/git.openstack.org/openstack-infra/zuul-jobs/roles:~/src/git.openstack.org/openstack-infra/openstack-zuul-jobs/roles:~/src/git.openstack.org/openstack-infra/project-config/roles + +- job: + name: ansible-role-functional-base + parent: tox + description: | + Run functional functional tests for ansible-role projects. + + Uses tox with the ``functional`` environment. + pre-run: playbooks/ansible-role-functional/pre.yaml + run: playbooks/tox-with-sudo/run.yaml + vars: + tox_envlist: functional + +- job: + name: ansible-role-functional-centos-7 + parent: ansible-role-functional-base + nodeset: centos-7 + +- job: + name: ansible-role-functional-fedora-26 + parent: ansible-role-functional-base + nodeset: fedora-26 + +- job: + name: ansible-role-functional-ubuntu-xenial + parent: ansible-role-functional-base diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index ae7649fc..f0c2092e 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -965,10 +965,10 @@ CentOS 7 nodes. check: jobs: - - openstack-tox-functional-centos-7 + - ansible-role-functional-centos-7 gate: jobs: - - openstack-tox-functional-centos-7 + - ansible-role-functional-centos-7 - project-template: name: ansible-role-functional-jobs-fedora-26 @@ -977,10 +977,10 @@ Fedora 26 nodes. check: jobs: - - openstack-tox-functional-fedora-26 + - ansible-role-functional-fedora-26 gate: jobs: - - openstack-tox-functional-fedora-26 + - ansible-role-functional-fedora-26 - project-template: name: ansible-role-functional-jobs-xenial @@ -989,10 +989,10 @@ Ubuntu Xenial nodes. check: jobs: - - openstack-tox-functional + - ansible-role-functional-ubuntu-xenial gate: jobs: - - openstack-tox-functional + - ansible-role-functional-ubuntu-xenial - project-template: name: ansible-role-functional-jobs-xenial-nv @@ -1001,5 +1001,5 @@ Ubuntu Xenial nodes. The tests are non-voting. check: jobs: - - openstack-tox-functional: + - ansible-role-functional-ubuntu-xenial: voting: false