<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/docker-playground/+/22674">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gbproxy-fr: Wait for interface to be _up_ not just its existance<br><br>I've seen at least one instance where -EIFDOWN was returned when the<br>test suite was coming up.  This is a race condition, as we first<br>have to move the netdev into the namespace and only then can configure<br>it.  "pipework wait" only waits for its existence, not until it is up.<br><br>We cannot revert the order, as the netdev looses its state when it<br>is moved to a different netns.<br><br>Change-Id: I1bfb6eb925bca4e4e1901e06eed831152cddbbe2<br>---<br>M ttcn3-fr-test/docker-entrypoint.sh<br>1 file changed, 14 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/74/22674/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/ttcn3-fr-test/docker-entrypoint.sh b/ttcn3-fr-test/docker-entrypoint.sh</span><br><span>index 132c73c..1215f6a 100755</span><br><span>--- a/ttcn3-fr-test/docker-entrypoint.sh</span><br><span>+++ b/ttcn3-fr-test/docker-entrypoint.sh</span><br><span>@@ -5,7 +5,21 @@</span><br><span> SUITE=$2</span><br><span> </span><br><span> if [[ -n ${WAIT_FOR_NETDEV:-} ]]; then</span><br><span style="color: hsl(120, 100%, 40%);">+    echo Waiting for ${WAIT_FOR_NETDEV} to appear</span><br><span style="color: hsl(120, 100%, 40%);">+ # this unfortunately only waits until the device exists</span><br><span>      /usr/bin/pipework --wait -i ${WAIT_FOR_NETDEV}</span><br><span style="color: hsl(120, 100%, 40%);">+        # here we have to wait until it is up</span><br><span style="color: hsl(120, 100%, 40%);">+ while true; do</span><br><span style="color: hsl(120, 100%, 40%);">+                if [ ! -f /sys/class/net/${WAIT_FOR_NETDEV}/operstate ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+                 exit 23</span><br><span style="color: hsl(120, 100%, 40%);">+               fi</span><br><span style="color: hsl(120, 100%, 40%);">+            OPSTATE=`cat /sys/class/net/${WAIT_FOR_NETDEV}/operstate`</span><br><span style="color: hsl(120, 100%, 40%);">+             if [ "$OPSTATE" == "up" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+                   break</span><br><span style="color: hsl(120, 100%, 40%);">+         fi</span><br><span style="color: hsl(120, 100%, 40%);">+            echo Waiting for ${WAIT_FOR_NETDEV} to become operational</span><br><span style="color: hsl(120, 100%, 40%);">+             sleep 1</span><br><span style="color: hsl(120, 100%, 40%);">+       done</span><br><span> fi</span><br><span> </span><br><span> cd /data && /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/$SUBDIR/$SUITE; \</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/docker-playground/+/22674">change 22674</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/docker-playground/+/22674"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: docker-playground </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I1bfb6eb925bca4e4e1901e06eed831152cddbbe2 </div>
<div style="display:none"> Gerrit-Change-Number: 22674 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>