diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-07-30 17:26:53 +0100 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-07-30 17:26:53 +0100 |
commit | 10962ada4c67683e5a76155a74a654281f15114d (patch) | |
tree | d22db7846bc8ab312bef5793ba55f006eba3fb66 /test | |
parent | 35aeadeb3f8781670e99f66a8d0a90f21a7a37b6 (diff) |
Major changes to ping parsing code
Make it more suitable for logging sanely - don't print everything as
we go. Print out an overall PASS/FAIL message that others can parse
readily, and summarise the failures if any.
Change-Id: Idf2168bc9f8861fbe19c6a958bf0a6beaf1b6b4e
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-common | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/test/test-common b/test/test-common index aa50ab1..01aae1c 100755 --- a/test/test-common +++ b/test/test-common @@ -168,6 +168,7 @@ check_test_steps () { check_test_step () { STEP=$1 sort -u ${LOGFILE} | awk -v STEP=$1 " + BEGIN { fails = \"\" } /CHECK $STEP START/ { running=1 } /CHECK $STEP END/ { running=0 } /CHECK $STEP CHECK/ { @@ -177,28 +178,18 @@ check_test_step () { test[mach_list[1]][mach_list[j]] = 1 } } - if (0 == 1) { - for (group in test) { - printf(\" $STEP test group %s contains: \", group) - for (host in test[group]) { - printf(\"%s \", host) - } - printf(\"\n\") - } - } } /UP/ { if(running) { OK=0 for (group in test) { if (test[group][\$2] && test[group][\$4]) { - #printf(\"GOOD UP: %s to %s (%s)\n\",\$2,\$4,group) OK=1 success++ } } if (OK == 0) { - printf(\" BAD UP: %s to %s\n\",\$2,\$4) + fails = sprintf(\"%s{BAD UP: %s to %s} \",fails,\$2,\$4) fail++ } } @@ -208,19 +199,22 @@ check_test_step () { OK=1 for (group in test) { if (test[group][\$2] && test[group][\$4]) { - printf(\" BAD DOWN: %s to %s (%s)\n\",\$2,\$4,group) + fails = sprintf(\"%s{BAD DOWN: %s to %s (%s)} \",fails,\$2,\$4,group) OK=0 fail++ } } if (OK == 1) { - # printf(\"GOOD DOWN: %s to %s\n\",\$2,\$4) success++ } } } END { - if (fail > 0) { print \"FAIL\" } else { print \"PASS\" } + if (fail > 0) { + printf(\"FAIL: success %d, fail %d (%s)\n\", success, fail, fails) + } else { + printf(\"PASS: success %d, fail %d\n\", success, fail) + } } " } |