laforge has submitted this change. ( 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(a)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(-)
Approvals:
daniel: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
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"
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/30383
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Ib5c3bbe470ce874217437c2518df5ae07f0d8301
Gerrit-Change-Number: 30383
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/30434 )
Change subject: jobs/osmo-gsm-tester virtual: fix permissions
......................................................................
jobs/osmo-gsm-tester virtual: fix permissions
The docker container creates the trial dir and some files inside of it
as root, therefore the rm -rf trial-* line fails. Add logic to fix the
permissions before attempting to remove old trial-* and when the script
exits.
Related: OS#5793
Change-Id: I91bd6656f33667f401247721bb34298a6c66fc62
---
M jobs/osmo-gsm-tester-runner.yml
1 file changed, 25 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/jobs/osmo-gsm-tester-runner.yml b/jobs/osmo-gsm-tester-runner.yml
index 9a57ead..688da38 100644
--- a/jobs/osmo-gsm-tester-runner.yml
+++ b/jobs/osmo-gsm-tester-runner.yml
@@ -218,12 +218,35 @@
- timed: "H 22 * * *"
builders:
- shell: |
- # make sure no test results/bin artifacts from a previous run remain
- rm -rf trial-* *.tgz *.md5
+ # make sure no bin artifacts from a previous run remain
+ rm -rf *.tgz *.md5
- copy_artifact_all
- copy_artifact:
repo: osmo-gsm-tester_build-osmocom-bb
- shell: |
+ # Set a trap to fix workspace permissions on exit
+ fix_permissions() {
+ docker run --rm \
+ -v "$WORKSPACE":/workspace \
+ debian:bullseye \
+ chmod -R a+rwX /workspace/
+ }
+ fix_permissions_trap() {
+ set +x
+ echo
+ echo "### Clean up ###"
+ echo
+ set -x
+
+ trap - EXIT INT TERM 0
+ fix_permissions
+ }
+ trap fix_permissions_trap EXIT INT TERM 0
+
+ # Make sure no test results from a previous run remain
+ fix_permissions
+ rm -rf trial-*
+
# Build the docker image
rm -rf docker-playground
git clone \
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/30434
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I91bd6656f33667f401247721bb34298a6c66fc62
Gerrit-Change-Number: 30434
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged