The Gatekeeper, or a project gating system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
3.2KB

  1. - hosts: controller
  2. tasks:
  3. - name: Set python path fact
  4. set_fact:
  5. python_path: "/usr/local/lib/python3.5/dist-packages"
  6. - name: Run ansible that should succeed
  7. command: >
  8. /usr/lib/zuul/ansible/{{ zuul_ansible_version }}/bin/ansible-playbook
  9. src/opendev.org/zuul/zuul/playbooks/zuul-stream/fixtures/test-stream.yaml
  10. environment:
  11. ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
  12. ZUUL_JOBDIR: "{{ ansible_user_dir}}"
  13. ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
  14. PYTHONPATH: "{{ python_path }}"
  15. - name: Run ansible playbook that should fail
  16. command: >
  17. /usr/lib/zuul/ansible/{{ zuul_ansible_version }}/bin/ansible-playbook
  18. src/opendev.org/zuul/zuul/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
  19. register: failed_results
  20. failed_when: "failed_results.rc != 2"
  21. environment:
  22. ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
  23. ZUUL_JOBDIR: "{{ ansible_user_dir}}"
  24. ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
  25. PYTHONPATH: "{{ python_path }}"
  26. - name: Validate output - setupvar
  27. shell: |
  28. egrep "^.*\| node1 \|\s+\"setupvar\": {" job-output.txt
  29. egrep "^.*\| node2 \|\s+\"setupvar\": {" job-output.txt
  30. - name: Validate output - shell task
  31. shell: |
  32. egrep "^.*\| node1 \| 1: lo:" job-output.txt
  33. egrep "^.*\| node2 \| 1: lo:" job-output.txt
  34. - name: Validate output - loop with items
  35. shell: |
  36. egrep "^.+\| node1 \| ok: Item: item1" job-output.txt
  37. egrep "^.+\| node1 \| ok: Item: item2" job-output.txt
  38. egrep "^.+\| node1 \| ok: Item: item3" job-output.txt
  39. egrep "^.+\| node2 \| ok: Item: item1" job-output.txt
  40. egrep "^.+\| node2 \| ok: Item: item2" job-output.txt
  41. egrep "^.+\| node2 \| ok: Item: item3" job-output.txt
  42. - name: Validate output - loop with complex items
  43. shell: |
  44. egrep "^.+\| node1 \| ok: Item: Runtime" job-output.txt
  45. egrep "^.+\| node2 \| ok: Item: Runtime" job-output.txt
  46. - name: Validate output - shell task with exception
  47. shell: |
  48. egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/shelltask\/" job-output.txt
  49. egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/shelltask\/" job-output.txt
  50. - name: Validate output - item loop with exception
  51. shell: |
  52. egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/itemloop\/" job-output.txt
  53. egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/itemloop\/" job-output.txt
  54. - name: Validate output - failure shell task with exception
  55. shell: |
  56. egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/failure-shelltask\/" job-output.txt
  57. egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/failure-shelltask\/" job-output.txt
  58. - name: Validate output - failure item loop with exception
  59. shell: |
  60. egrep "^.+\| node1 \| (OSError|FileNotFoundError).+\/failure-itemloop\/" job-output.txt
  61. egrep "^.+\| node2 \| (OSError|FileNotFoundError).+\/failure-itemloop\/" job-output.txt
  62. - name: Validate output - binary data
  63. shell: |
  64. egrep "^.*\| node1 \| \\\\x80abc" job-output.txt
  65. egrep "^.*\| node2 \| \\\\x80abc" job-output.txt