nftables: change ptest output format

This change adds a simple format for the skip results.
The format selected is the automake "simple test" format:
"result: testname"

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Jiaying Song 2024-07-19 15:30:49 +08:00 committed by Khem Raj
parent 4b990b6dba
commit 60a250c7e2
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -5,14 +5,18 @@ cd ${NFTABLESLIB}/ptest || exit 1
LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log"
NFT=nft
tests/shell/run-tests.sh -v | sed -E '/I: \[OK\]/ s/^/PASS: / ; /W: \[(CHK DUMP|VALGRIND|TAINTED|DUMP FAIL|FAILED)\]/ s/^/FAIL: /' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee -a "${LOG}"
tests/shell/run-tests.sh -v | sed -E '/I: \[OK\]/ s/^/PASS: / ; /W: \[(CHK DUMP|VALGRIND|TAINTED|DUMP FAIL|FAILED)\]/ s/^/FAIL: / ; /I: \[SKIPPED\]/ s/^/SKIP: /' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee -a "${LOG}"
passed=$(grep -c PASS: "${LOG}")
failed=$(grep -c FAIL: "${LOG}")
all=$((passed + failed))
skiped=$(grep -c SKIP: "${LOG}")
all=$((passed + failed + skiped))
( echo "=== Test Summary ==="
echo "TOTAL: ${all}"
echo "PASSED: ${passed}"
echo "FAILED: ${failed}"
echo "SKIPED: ${skiped}"
echo "===================="
) | tee -a "${LOG}"