diff mbox series

[meta-networking,1/3] nftables: Fix ptest output format issues

Message ID 20240402133400.3347547-1-William.Lyu@windriver.com
State Accepted
Headers show
Series [meta-networking,1/3] nftables: Fix ptest output format issues | expand

Commit Message

Lyu, William April 2, 2024, 1:33 p.m. UTC
From: William Lyu <William.Lyu@windriver.com>

Fix the following ptest output format issues:

-   For "sed" command, change "-e" option to "-E" option. I believe the
    previous "-e" option is a typo based on the manual page of "sed":

        -e script, --expression=script
            add the script to the commands to be executed

    "-E" option, on the other hand, makes "sed" "use extended regular
    expressions in the script" according to the manual page.

-   The test result summary line is being treated as both a passed
    testcase and a failed testcase due to this line containing substring
    "[OK]" and "[FAILED]". The following is a sample test result summary
    line:

        I: results: [OK] 379 [SKIPPED] 1 [FAILED] 0 [TOTAL] 380

    The fix is to change run-ptest to look for "I: [OK]" and
    "W: [FAILED]" when determining which lines correspond to
    passed/failed testcases.

-   Previously, only "W: [FAILED]" out of the following testcase failure
    prompts is parsed:

        W: [CHK DUMP]
        W: [VALGRIND]
        W: [TAINTED]
        W: [DUMP FAIL]
        W: [FAILED]

    Adding parsing for all testcase failure prompts.

Signed-off-by: William Lyu <William.Lyu@windriver.com>
---
 meta-networking/recipes-filter/nftables/nftables/run-ptest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-networking/recipes-filter/nftables/nftables/run-ptest b/meta-networking/recipes-filter/nftables/nftables/run-ptest
index 27d780ace..3217c743d 100644
--- a/meta-networking/recipes-filter/nftables/nftables/run-ptest
+++ b/meta-networking/recipes-filter/nftables/nftables/run-ptest
@@ -4,7 +4,7 @@  NFTABLESLIB=@libdir@/nftables
 cd ${NFTABLESLIB}/ptest
 
 LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log"
-tests/shell/run-tests.sh -v | sed  -e '/OK/ s/^/PASS: / ; /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: /' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee -a ${LOG}
 
 passed=`grep PASS: ${LOG}|wc -l`
 failed=`grep FAIL: ${LOG}|wc -l`