summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorWilliam Lyu <William.Lyu@windriver.com>2024-04-02 06:33:59 -0700
committerKhem Raj <raj.khem@gmail.com>2024-04-02 17:54:04 -0700
commitc3541b903fed3d8bebefaf219e432e5162c54ede (patch)
tree58742e2ac88fb82d92db02a6579984f4847667c8 /meta-networking
parent77fcf5acd7f9839218d2f26c5e1ffbca405776cc (diff)
downloadmeta-openembedded-c3541b903fed3d8bebefaf219e432e5162c54ede.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>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-filter/nftables/nftables/run-ptest10
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 3217c743d..363a1ee25 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
3NFTABLESLIB=@libdir@/nftables 3NFTABLESLIB=@libdir@/nftables
4cd ${NFTABLESLIB}/ptest 4cd ${NFTABLESLIB}/ptest || exit 1
5 5
6LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log" 6LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log"
7tests/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} 7tests/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
9passed=`grep PASS: ${LOG}|wc -l` 9passed=$(grep -c PASS: "${LOG}")
10failed=`grep FAIL: ${LOG}|wc -l` 10failed=$(grep -c FAIL: "${LOG}")
11all=$((passed + failed)) 11all=$((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}"