diff options
Diffstat (limited to 'meta-networking/recipes-filter/nftables/nftables/run-ptest')
-rw-r--r-- | meta-networking/recipes-filter/nftables/nftables/run-ptest | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta-networking/recipes-filter/nftables/nftables/run-ptest b/meta-networking/recipes-filter/nftables/nftables/run-ptest new file mode 100644 index 0000000000..32ddf9f455 --- /dev/null +++ b/meta-networking/recipes-filter/nftables/nftables/run-ptest @@ -0,0 +1,18 @@ +#!/bin/sh + +NFTABLESLIB=@libdir@/nftables +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}" + +passed=$(grep -c PASS: "${LOG}") +failed=$(grep -c FAIL: "${LOG}") +all=$((passed + failed)) + +( echo "=== Test Summary ===" + echo "TOTAL: ${all}" + echo "PASSED: ${passed}" + echo "FAILED: ${failed}" +) | tee -a "${LOG}" |