laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/30383 )
Change subject: ttcn3-docker-run.sh: Use interface "up" flag, not operstate ......................................................................
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 --- M debian-bullseye-titan/ttcn3-docker-run.sh 1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/83/30383/1
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 @@ 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"