<p>daniel <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/docker-playground/+/22674">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  daniel: Verified
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">debian-stretch-titan: 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 debian-stretch-titan/ttcn3-docker-run.sh<br>1 file changed, 13 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/debian-stretch-titan/ttcn3-docker-run.sh b/debian-stretch-titan/ttcn3-docker-run.sh</span><br><span>index da3d314..c868220 100755</span><br><span>--- a/debian-stretch-titan/ttcn3-docker-run.sh</span><br><span>+++ b/debian-stretch-titan/ttcn3-docker-run.sh</span><br><span>@@ -14,7 +14,20 @@</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>    pipework --wait -i "$WAIT_FOR_NETDEV"</span><br><span style="color: hsl(120, 100%, 40%);">+</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</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: 5 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Assignee: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>