Change in docker-playground[master]: ttcn3: move shared run code to script

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Thu Feb 11 15:06:10 UTC 2021


osmith has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/22822 )

Change subject: ttcn3: move shared run code to script
......................................................................

ttcn3: move shared run code to script

While I'm at it with tidying up the Dockerfiles, create a
ttcn3-docker-run.sh with shared run code.

Related: OS#5017
Change-Id: Id90769707158f0488eca2313c57b99ea7a4a27c8
---
M debian-stretch-titan/Dockerfile
A debian-stretch-titan/ttcn3-docker-run.sh
M ttcn3-bsc-test/Dockerfile
M ttcn3-bscnat-test/Dockerfile
M ttcn3-bts-test/Dockerfile
M ttcn3-ggsn-test/Dockerfile
M ttcn3-hlr-test/Dockerfile
M ttcn3-mgw-test/Dockerfile
M ttcn3-msc-test/Dockerfile
M ttcn3-nitb-sysinfo/Dockerfile
M ttcn3-pcu-test/Dockerfile
M ttcn3-remsim-test/Dockerfile
M ttcn3-sccp-test/Dockerfile
M ttcn3-sgsn-test/Dockerfile
M ttcn3-sip-test/Dockerfile
M ttcn3-smlc-test/Dockerfile
M ttcn3-stp-test/Dockerfile
17 files changed, 39 insertions(+), 75 deletions(-)

Approvals:
  osmith: Looks good to me, approved; Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve



diff --git a/debian-stretch-titan/Dockerfile b/debian-stretch-titan/Dockerfile
index daa0f8c..512b4ac 100644
--- a/debian-stretch-titan/Dockerfile
+++ b/debian-stretch-titan/Dockerfile
@@ -63,3 +63,4 @@
 	fi
 
 ADD	ttcn3-docker-prepare.sh /usr/local/bin/ttcn3-docker-prepare
+ADD	ttcn3-docker-run.sh /usr/local/bin/ttcn3-docker-run
diff --git a/debian-stretch-titan/ttcn3-docker-run.sh b/debian-stretch-titan/ttcn3-docker-run.sh
new file mode 100755
index 0000000..0cda8a5
--- /dev/null
+++ b/debian-stretch-titan/ttcn3-docker-run.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+if [ $# -lt 2 ]; then
+	echo
+	echo "usage: ttcn3-docker-run SUBDIR SUITE"
+	echo "arguments:"
+	echo "  SUBDIR: directory in osmo-ttcn3-hacks, e.g. 'msc'"
+	echo "  SUITE: name of the testsuite, e.g. 'MSC_Tests'"
+	echo
+	exit 1
+fi
+
+set -x
+SUBDIR=$1
+SUITE=$2
+
+cd /data
+
+/osmo-ttcn3-hacks/start-testsuite.sh "/osmo-ttcn3-hacks/$SUBDIR/$SUITE"
+exit_code=$?
+
+/osmo-ttcn3-hacks/log_merge.sh "$SUITE" --rm
+
+exit $exit_code
diff --git a/ttcn3-bsc-test/Dockerfile b/ttcn3-bsc-test/Dockerfile
index c56f3a5..10b7267 100644
--- a/ttcn3-bsc-test/Dockerfile
+++ b/ttcn3-bsc-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	BSC_Tests.cfg /data/BSC_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc/BSC_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh BSC_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run bsc BSC_Tests
diff --git a/ttcn3-bscnat-test/Dockerfile b/ttcn3-bscnat-test/Dockerfile
index 405c0a6..d970482 100644
--- a/ttcn3-bscnat-test/Dockerfile
+++ b/ttcn3-bscnat-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	BSCNAT_Tests.cfg /data/BSCNAT_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc-nat/BSCNAT_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh BSCNAT_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run bsc-nat BSCNAT_Tests
diff --git a/ttcn3-bts-test/Dockerfile b/ttcn3-bts-test/Dockerfile
index 4aa3825..7abf1a9 100644
--- a/ttcn3-bts-test/Dockerfile
+++ b/ttcn3-bts-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	BTS_Tests.cfg /data/BTS_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bts/BTS_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run bts BTS_Tests
diff --git a/ttcn3-ggsn-test/Dockerfile b/ttcn3-ggsn-test/Dockerfile
index e38e9d5..e67dc9f 100644
--- a/ttcn3-ggsn-test/Dockerfile
+++ b/ttcn3-ggsn-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	GGSN_Tests.cfg /data/GGSN_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/ggsn_tests/GGSN_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh GGSN_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run ggsn_tests GGSN_Tests
diff --git a/ttcn3-hlr-test/Dockerfile b/ttcn3-hlr-test/Dockerfile
index b180567..36761a7 100644
--- a/ttcn3-hlr-test/Dockerfile
+++ b/ttcn3-hlr-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	HLR_Tests.cfg /data/HLR_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/hlr/HLR_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh HLR_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run hlr HLR_Tests
diff --git a/ttcn3-mgw-test/Dockerfile b/ttcn3-mgw-test/Dockerfile
index b05fa21..bd74f79 100644
--- a/ttcn3-mgw-test/Dockerfile
+++ b/ttcn3-mgw-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	MGCP_Test.cfg /data/MGCP_Test.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/mgw/MGCP_Test; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh MGCP_Test --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run mgw MGCP_Test
diff --git a/ttcn3-msc-test/Dockerfile b/ttcn3-msc-test/Dockerfile
index 06c07ca..8ce9828 100644
--- a/ttcn3-msc-test/Dockerfile
+++ b/ttcn3-msc-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	MSC_Tests.cfg /data/MSC_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/msc/MSC_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh MSC_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run msc MSC_Tests
diff --git a/ttcn3-nitb-sysinfo/Dockerfile b/ttcn3-nitb-sysinfo/Dockerfile
index 4d0cf73..026a465 100644
--- a/ttcn3-nitb-sysinfo/Dockerfile
+++ b/ttcn3-nitb-sysinfo/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	Test.cfg /data/Test.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh Test --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run sysinfo Test
diff --git a/ttcn3-pcu-test/Dockerfile b/ttcn3-pcu-test/Dockerfile
index 2c7d52f..2a35db3 100644
--- a/ttcn3-pcu-test/Dockerfile
+++ b/ttcn3-pcu-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	PCU_Tests.cfg /data/PCU_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/pcu/PCU_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh PCU_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run pcu PCU_Tests
diff --git a/ttcn3-remsim-test/Dockerfile b/ttcn3-remsim-test/Dockerfile
index c826d7c..0391d0a 100644
--- a/ttcn3-remsim-test/Dockerfile
+++ b/ttcn3-remsim-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	REMSIM_Tests.cfg /data/REMSIM_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/remsim/REMSIM_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh REMSIM_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run remsim REMSIM_Tests
diff --git a/ttcn3-sccp-test/Dockerfile b/ttcn3-sccp-test/Dockerfile
index 3fc4ca3..a818d8b 100644
--- a/ttcn3-sccp-test/Dockerfile
+++ b/ttcn3-sccp-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	SCCP_Tests.cfg /data/SCCP_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sccp/SCCP_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh SCCP_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run sccp SCCP_Tests
diff --git a/ttcn3-sgsn-test/Dockerfile b/ttcn3-sgsn-test/Dockerfile
index 2cc9778..2a2e66e 100644
--- a/ttcn3-sgsn-test/Dockerfile
+++ b/ttcn3-sgsn-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	SGSN_Tests.cfg /data/SGSN_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sgsn/SGSN_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run sgsn SGSN_Tests
diff --git a/ttcn3-sip-test/Dockerfile b/ttcn3-sip-test/Dockerfile
index 4d138ce..bce215a 100644
--- a/ttcn3-sip-test/Dockerfile
+++ b/ttcn3-sip-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	SIP_Tests.cfg /data/SIP_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sip/SIP_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh SIP_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run sip SIP_Tests
diff --git a/ttcn3-smlc-test/Dockerfile b/ttcn3-smlc-test/Dockerfile
index d2a081f..21d77a4 100644
--- a/ttcn3-smlc-test/Dockerfile
+++ b/ttcn3-smlc-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	SMLC_Tests.cfg /data/SMLC_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/smlc/SMLC_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh SMLC_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run smlc SMLC_Tests
diff --git a/ttcn3-stp-test/Dockerfile b/ttcn3-stp-test/Dockerfile
index 0ae2c5e..073753b 100644
--- a/ttcn3-stp-test/Dockerfile
+++ b/ttcn3-stp-test/Dockerfile
@@ -9,8 +9,4 @@
 
 COPY	STP_Tests.cfg /data/STP_Tests.cfg
 
-CMD	cd /data && \
-	/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/stp/STP_Tests; \
-	exit_code=$?; \
-	/osmo-ttcn3-hacks/log_merge.sh STP_Tests --rm; \
-	exit $exit_code
+CMD	ttcn3-docker-run stp STP_Tests

-- 
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/22822
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Id90769707158f0488eca2313c57b99ea7a4a27c8
Gerrit-Change-Number: 22822
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210211/69c21a43/attachment.htm>


More information about the gerrit-log mailing list