#!/bin/bash set -u #------------------------------------------------------------------------------ # Usage: # To see a list of test groups: # ./r ls # # To run any single test group, specify the test group name (as displayed by # ./r ls). For example, to run the Usage test group, do: # ./r Usage # # To run all tests groups, do: # ./r declare TestGroup= if [[ "${1:-}" ]]; then case "$1" in ls|list) grep -Ev '^$|^\s|^#' cli_tests.cfg |cut -d'|' -f1|uniq exit 0 ;; *) TestGroup="$1" ;; esac fi cd /opt/perforce/dev/bin # When starting a new test run, which could be a single test group or the entire set, # first blast the /root/install_sdp directory which will contain logs from prior # runs. All install_sdp.sh script logs from the current run appear in this folder. rm -rf /root/install_sdp if [[ -n "$TestGroup" ]]; then /opt/perforce/dev/sdp/test/bsw/run_cli_tests.sh -cd /opt/perforce/dev/bin -no_env -e -g "$TestGroup" else /opt/perforce/dev/sdp/test/bsw/run_cli_tests.sh -cd /opt/perforce/dev/bin -no_env -e fi echo Summary: grep -E '^(PASS|FAIL) Test ' /tmp/run_cli_tests.log ### TO DO: Consider moving this logic to scan for unreported errors into the run_cli_tests.sh script itself. echo Scan for unreported errors: grep -E '^\w+:' /tmp/run_cli_tests.log | grep -Ev '^(C|Calling|Comments|DEBUG|DESC.*|Diagnostics|Error|EXAMPLE.*|Executing|Get|Hit|https|info|NO_OP|OPTION.*|PASS|Protections|Running|See|SUCCESS|TEST_EXIT_CODE|Update|TG|Verified):' | grep -Ev '^exit: 0' | grep -v '^EXIT_CODE: 0'