[PATCH net-next 2/4] selftests: tc-testing: check if 'jq' is available in taprio script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If 'jq' is not available the taprio tests that use this script will
run forever. Check if it exists before entering the while loop.

Signed-off-by: Pedro Tammela <pctammela@xxxxxxxxxxxx>
---
 .../selftests/tc-testing/scripts/taprio_wait_for_admin.sh    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/tc-testing/scripts/taprio_wait_for_admin.sh b/tools/testing/selftests/tc-testing/scripts/taprio_wait_for_admin.sh
index f5335e8ad6b4..68f2c6eaa802 100755
--- a/tools/testing/selftests/tc-testing/scripts/taprio_wait_for_admin.sh
+++ b/tools/testing/selftests/tc-testing/scripts/taprio_wait_for_admin.sh
@@ -3,6 +3,11 @@
 TC="$1"; shift
 ETH="$1"; shift
 
+if ! command -v jq &> /dev/null; then
+    echo "Please install jq"
+    exit 1
+fi
+
 # The taprio architecture changes the admin schedule from a hrtimer and not
 # from process context, so we need to wait in order to make sure that any
 # schedule change actually took place.
-- 
2.40.1





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux