--- # Run the SDP functional test harness on the target and surface its results. # The harness ships with the SDP at /p4/sdp/test/sdp_test_harness.sh; it must run # as the SDP OS user from a directory that user can read (hence chdir to /p4). - name: "Confirm the SDP test harness is present" ansible.builtin.stat: path: "/p4/sdp/test/sdp_test_harness.sh" register: sdp_harness - name: "Fail if the harness is missing (SDP predates it; reinstall to deploy)" ansible.builtin.fail: msg: "/p4/sdp/test/sdp_test_harness.sh not found. Re-run install to deploy the current SDP." when: not sdp_harness.stat.exists - name: "Run the SDP functional test harness" become: true become_user: "{{ perforce_user }}" ansible.builtin.command: cmd: "/p4/sdp/test/sdp_test_harness.sh {{ perforce_id }}" chdir: "/p4" register: sdp_test_result changed_when: false failed_when: false - name: "SDP test harness results" ansible.builtin.debug: var: sdp_test_result.stdout_lines - name: "Report overall pass/fail" ansible.builtin.assert: that: "sdp_test_result.rc == 0" success_msg: "All SDP tests passed." fail_msg: "SDP test harness reported failures (rc={{ sdp_test_result.rc }}); see output above."