aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-11-30 13:33:34 +0100
committerlaforge <laforge@osmocom.org>2022-12-02 11:15:34 +0000
commitc4d1cc59b04cc9e6783bb09ba170f77cd77e75cd (patch)
tree04382819ebc0bea9c7ddce1757143eb581c9dfde
parent36c6ff8f1102e71f784098b24e133ad52c671568 (diff)
ttcn3-docker-run.sh: Use interface "up" flag, not operstate
Don't use the "operstate" sysfs attribute to determine if an interface is "up", use the actual UP-flag (0x01) in the "flags" sysfs attribute. The "operstate" attribute may at least occasionally be "unknown" and remain in that state (causing jenkins jobs to wait indefinitely), while the flags (which we don't look at before this patch) indicates it is "up". This is a fixup to the below commit: commit d2014603a736a17d6b92006b25aa41482365ef3d Author: Harald Welte <laforge@osmocom.org> Date: Wed Feb 3 22:05:43 2021 +0100 debian-stretch-titan: Wait for interface to be _up_ not just its existance Change-Id: Ib5c3bbe470ce874217437c2518df5ae07f0d8301 Closes: OS#5803
-rwxr-xr-xdebian-bullseye-titan/ttcn3-docker-run.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/debian-bullseye-titan/ttcn3-docker-run.sh b/debian-bullseye-titan/ttcn3-docker-run.sh
index c868220..26e291c 100755
--- a/debian-bullseye-titan/ttcn3-docker-run.sh
+++ b/debian-bullseye-titan/ttcn3-docker-run.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
if [ $# -lt 2 ]; then
echo
echo "usage: ttcn3-docker-run SUBDIR SUITE"
@@ -18,11 +18,12 @@ if [ -n "$WAIT_FOR_NETDEV" ]; then
pipework --wait -i "$WAIT_FOR_NETDEV"
while true; do
- if [ ! -f /sys/class/net/${WAIT_FOR_NETDEV}/operstate ]; then
+ if [ ! -f /sys/class/net/${WAIT_FOR_NETDEV}/flags ]; then
exit 23
fi
- OPSTATE=$(cat /sys/class/net/${WAIT_FOR_NETDEV}/operstate)
- if [ "$OPSTATE" = "up" ]; then
+ FLAGS=$(cat /sys/class/net/${WAIT_FOR_NETDEV}/flags)
+ let FLAG_UP=$FLAGS\&1
+ if [ "$FLAG_UP" = "1" ]; then
break
fi
echo "Waiting for ${WAIT_FOR_NETDEV} to become operational"