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 | 17673bf | 2016-03-04 13:01:40 -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 | 17673bf | 2016-03-04 13:01:40 -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 |