Blob Blame History Raw
# Tests for avocado role
- hosts: localhost
  tags:
  - classic
  - container
  roles:
  - role: standard-test-avocado
    tests:
    - /bin/true
  - role: standard-test-avocado
    tests:
    - /bin/false
    ignore_errors: yes
  tasks:
    - name: Read test.log on test environment
      set_fact:
        test_log: "{{ lookup('file', artifacts + '/test.log') }}"
    - name: Check for FAIL on test.log on test environment
      fail: msg="Could not find expected text on test log"
      when: >
          (test_log.find('/bin/false:  FAIL') == -1) or
          (test_log.find('/bin/true:  PASS') == -1)
      # We should fail when we can not find FAIL string on log
      # -1 means string not found