diff options
| author | William Lyu <William.Lyu@windriver.com> | 2024-04-02 06:33:59 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-04-03 17:44:22 -0700 |
| commit | 32f5f091dd105a316adaa6ea06b017829a585c08 (patch) | |
| tree | 2667fcc13d208a223d4cd58e8238482800a42fc8 | |
| parent | 6f723efdc624f7710649ede83568b2a2a20cee57 (diff) | |
| download | meta-openembedded-32f5f091dd105a316adaa6ea06b017829a585c08.tar.gz | |
nftables: Fix ShellCheck violations in ptest wrapper script "run-ptest"
The following ShellCheck violations in "run-ptest" are fixed:
- line 4:
SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
- line 7:
SC2086: Double quote to prevent globbing and word splitting.
- line 9:
SC2006: Use $(...) notation instead of legacy backticks `...`.
SC2086: Double quote to prevent globbing and word splitting.
SC2126: Consider using 'grep -c' instead of 'grep|wc -l'.
- line 10:
SC2006: Use $(...) notation instead of legacy backticks `...`.
SC2086: Double quote to prevent globbing and word splitting.
SC2126: Consider using 'grep -c' instead of 'grep|wc -l'.
- line 17:
SC2086: Double quote to prevent globbing and word splitting.
Signed-off-by: William Lyu <William.Lyu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-networking/recipes-filter/nftables/nftables/run-ptest | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/meta-networking/recipes-filter/nftables/nftables/run-ptest b/meta-networking/recipes-filter/nftables/nftables/run-ptest index 3217c743dd..363a1ee25a 100644 --- a/meta-networking/recipes-filter/nftables/nftables/run-ptest +++ b/meta-networking/recipes-filter/nftables/nftables/run-ptest | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | NFTABLESLIB=@libdir@/nftables | 3 | NFTABLESLIB=@libdir@/nftables |
| 4 | cd ${NFTABLESLIB}/ptest | 4 | cd ${NFTABLESLIB}/ptest || exit 1 |
| 5 | 5 | ||
| 6 | LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log" | 6 | LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log" |
| 7 | 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} | 7 | 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}" |
| 8 | 8 | ||
| 9 | passed=`grep PASS: ${LOG}|wc -l` | 9 | passed=$(grep -c PASS: "${LOG}") |
| 10 | failed=`grep FAIL: ${LOG}|wc -l` | 10 | failed=$(grep -c FAIL: "${LOG}") |
| 11 | all=$((passed + failed)) | 11 | all=$((passed + failed)) |
| 12 | 12 | ||
| 13 | ( echo "=== Test Summary ===" | 13 | ( echo "=== Test Summary ===" |
| 14 | echo "TOTAL: ${all}" | 14 | echo "TOTAL: ${all}" |
| 15 | echo "PASSED: ${passed}" | 15 | echo "PASSED: ${passed}" |
| 16 | echo "FAILED: ${failed}" | 16 | echo "FAILED: ${failed}" |
| 17 | ) | tee -a ${LOG} | 17 | ) | tee -a "${LOG}" |
