summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tc-testing/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/tc-testing/scripts')
-rwxr-xr-xtools/testing/selftests/tc-testing/scripts/taprio_wait_for_admin.sh16
1 files changed, 16 insertions, 0 deletions
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
new file mode 100755
index 0000000000..f5335e8ad6
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/scripts/taprio_wait_for_admin.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+TC="$1"; shift
+ETH="$1"; shift
+
+# 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.
+while :; do
+ has_admin="$($TC -j qdisc show dev $ETH root | jq '.[].options | has("admin")')"
+ if [ "$has_admin" = "false" ]; then
+ break;
+ fi
+
+ sleep 1
+done