Jon Hall | 6e70975 | 2016-02-01 13:38:46 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e -o pipefail |
| 4 | |
| 5 | if [ "$#" -lt 1 ]; then |
Jon Hall | 9ed8f37 | 2016-02-24 17:34:07 -0800 | [diff] [blame] | 6 | ls -t ~/OnosSystemTest/TestON/logs/*/*Summary.txt | head -1 | xargs cat | grep -E "^|FAIL" |
Jon Hall | 6e70975 | 2016-02-01 13:38:46 -0800 | [diff] [blame] | 7 | exit 1 |
| 8 | fi |
| 9 | if [ "$1" = "-f" ]; then |
| 10 | # NOTE: This is blocking |
Jon Hall | 9ed8f37 | 2016-02-24 17:34:07 -0800 | [diff] [blame] | 11 | ls -t ~/OnosSystemTest/TestON/logs/*/*Summary.txt | head -1 | xargs tail -n+1 -f |
Jon Hall | 6e70975 | 2016-02-01 13:38:46 -0800 | [diff] [blame] | 12 | else |
| 13 | printf "usage: $(basename $0) [options]\n\n" |
| 14 | printf "Simple command to print the latest test summary file.\n" |
| 15 | printf "\noptions:\n\t--help : Displays this message and exits\n" |
| 16 | printf "\t-f : Tails the summary file and updates as the file is written to.\n\n" |
| 17 | exit 1 |
| 18 | fi |