From 0575d4f89bccfbb4d0b76be7dec47f7d89a261dc Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Fri, 15 Nov 2019 13:54:52 -0500 Subject: [PATCH] Fix zuul-stream-functional tests The pre.yaml playbook for the zuul-stream-functional tests copies the Ansible inventory.yaml file from the executor to the test "controller" node. The controller then runs the specified version of Ansible 2.x against the other nodes. This fails because the executor version of inventory.yaml contains "auto" for the Ansible python interpreter which is valid under the version of Ansible used on the executor, but on the controller node, which runs the older versions of Ansible, this is *not* a valid value. Thus it fails. This change forces the executor to use the version of Ansible being tested on the controller so that the inventory.yaml will be correct. Also, Ansible 2.8 now throws a FileNotFoundError exception instead of OSError when a referenced file is not found. Change-Id: Ibd31f1161df0076ed7498fd1d7b1ae76c802c6e4 --- .zuul.yaml | 12 ++++++++++++ playbooks/zuul-stream/functional.yaml | 16 ++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 546a702215..718c8ee45b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -30,24 +30,36 @@ - job: name: zuul-stream-functional-2.5 parent: zuul-stream-functional + # Force executor to use same Ansible version as "controller" node so + # that the inventory.yaml file will be correct for that version. + ansible-version: 2.5 vars: zuul_ansible_version: 2.5 - job: name: zuul-stream-functional-2.6 parent: zuul-stream-functional + # Force executor to use same Ansible version as "controller" node so + # that the inventory.yaml file will be correct for that version. + ansible-version: 2.6 vars: zuul_ansible_version: 2.6 - job: name: zuul-stream-functional-2.7 parent: zuul-stream-functional + # Force executor to use same Ansible version as "controller" node so + # that the inventory.yaml file will be correct for that version. + ansible-version: 2.7 vars: zuul_ansible_version: 2.7 - job: name: zuul-stream-functional-2.8 parent: zuul-stream-functional + # Force executor to use same Ansible version as "controller" node so + # that the inventory.yaml file will be correct for that version. + ansible-version: 2.8 vars: zuul_ansible_version: 2.8 diff --git a/playbooks/zuul-stream/functional.yaml b/playbooks/zuul-stream/functional.yaml index bf4f10a348..d3a73d7f93 100644 --- a/playbooks/zuul-stream/functional.yaml +++ b/playbooks/zuul-stream/functional.yaml @@ -53,23 +53,23 @@ - name: Validate output - shell task with exception shell: | - egrep "^.+\| node1 \| OSError.+\/shelltask\/" job-output.txt - egrep "^.+\| node2 \| OSError.+\/shelltask\/" job-output.txt + egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/shelltask\/" job-output.txt + egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/shelltask\/" job-output.txt - name: Validate output - item loop with exception shell: | - egrep "^.+\| node1 \| OSError.+\/itemloop\/" job-output.txt - egrep "^.+\| node2 \| OSError.+\/itemloop\/" job-output.txt + egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/itemloop\/" job-output.txt + egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/itemloop\/" job-output.txt - name: Validate output - failure shell task with exception shell: | - egrep "^.+\| node1 \| OSError.+\/failure-shelltask\/" job-output.txt - egrep "^.+\| node2 \| OSError.+\/failure-shelltask\/" job-output.txt + egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/failure-shelltask\/" job-output.txt + egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/failure-shelltask\/" job-output.txt - name: Validate output - failure item loop with exception shell: | - egrep "^.+\| node1 \| OSError.+\/failure-itemloop\/" job-output.txt - egrep "^.+\| node2 \| OSError.+\/failure-itemloop\/" job-output.txt + egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/failure-itemloop\/" job-output.txt + egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/failure-itemloop\/" job-output.txt - name: Validate output - binary data shell: |