<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10158">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Add ttcn3-bts-test env<br><br>Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4<br>---<br>M .gitignore<br>M example/resources.conf.prod<br>M example/resources.conf.rnd<br>A src/osmo_gsm_tester/osmocon.py<br>M src/osmo_gsm_tester/resource.py<br>M src/osmo_gsm_tester/suite.py<br>A ttcn3/README.txt<br>A ttcn3/default-suites.conf<br>A ttcn3/defaults.conf<br>A ttcn3/jenkins-run.sh<br>A ttcn3/paths.conf<br>A ttcn3/resources.conf.prod<br>A ttcn3/resources.conf.rnd<br>A ttcn3/scenarios/trx.conf<br>A ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl<br>A ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh<br>A ttcn3/suites/ttcn3_bts_tests/suite.conf<br>A ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py<br>18 files changed, 395 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/10158/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/.gitignore b/.gitignore</span><br><span>index 8d3479b..a85b41a 100644</span><br><span>--- a/.gitignore</span><br><span>+++ b/.gitignore</span><br><span>@@ -10,3 +10,4 @@</span><br><span> *.pyc</span><br><span> selftest/trial_test/</span><br><span> example/resources.conf</span><br><span style="color: hsl(120, 100%, 40%);">+ttcn3/resources.conf</span><br><span>diff --git a/example/resources.conf.prod b/example/resources.conf.prod</span><br><span>index 8a9a534..6481254 100644</span><br><span>--- a/example/resources.conf.prod</span><br><span>+++ b/example/resources.conf.prod</span><br><span>@@ -114,3 +114,6 @@</span><br><span>   auth_algo: 'comp128v1'</span><br><span>   ciphers: [a5_0, a5_1]</span><br><span>   features: ['gprs', 'sim']</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+osmocon_phone:</span><br><span style="color: hsl(120, 100%, 40%);">+  - serial_device: '/dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_00897B41-if00-port0'</span><br><span>diff --git a/example/resources.conf.rnd b/example/resources.conf.rnd</span><br><span>index 7483260..05fce87 100644</span><br><span>--- a/example/resources.conf.rnd</span><br><span>+++ b/example/resources.conf.rnd</span><br><span>@@ -87,3 +87,6 @@</span><br><span>   auth_algo: 'comp128v1'</span><br><span>   ciphers: [a5_0, a5_1]</span><br><span>   features: ['gprs', 'sim']</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+osmocon_phone:</span><br><span style="color: hsl(120, 100%, 40%);">+- serial_device: '/dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_0089279D-if00-port0'</span><br><span>diff --git a/src/osmo_gsm_tester/osmocon.py b/src/osmo_gsm_tester/osmocon.py</span><br><span>new file mode 100644</span><br><span>index 0000000..5b1e145</span><br><span>--- /dev/null</span><br><span>+++ b/src/osmo_gsm_tester/osmocon.py</span><br><span>@@ -0,0 +1,103 @@</span><br><span style="color: hsl(120, 100%, 40%);">+# osmo_gsm_tester: specifics for running an osmocon</span><br><span style="color: hsl(120, 100%, 40%);">+#</span><br><span style="color: hsl(120, 100%, 40%);">+# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH</span><br><span style="color: hsl(120, 100%, 40%);">+#</span><br><span style="color: hsl(120, 100%, 40%);">+# Author: Pau Espin Pedrol <pespin@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+#</span><br><span style="color: hsl(120, 100%, 40%);">+# This program is free software: you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+# it under the terms of the GNU General Public License as</span><br><span style="color: hsl(120, 100%, 40%);">+# published by the Free Software Foundation, either version 3 of the</span><br><span style="color: hsl(120, 100%, 40%);">+# License, or (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+#</span><br><span style="color: hsl(120, 100%, 40%);">+# This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+# but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+# GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+#</span><br><span style="color: hsl(120, 100%, 40%);">+# You should have received a copy of the GNU General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+# along with this program.  If not, see <http://www.gnu.org/licenses/>.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+import os</span><br><span style="color: hsl(120, 100%, 40%);">+import tempfile</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+from . import log, util, process</span><br><span style="color: hsl(120, 100%, 40%);">+from .event_loop import MainLoop</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+class Osmocon(log.Origin):</span><br><span style="color: hsl(120, 100%, 40%);">+    suite_run = None</span><br><span style="color: hsl(120, 100%, 40%);">+    run_dir = None</span><br><span style="color: hsl(120, 100%, 40%);">+    process = None</span><br><span style="color: hsl(120, 100%, 40%);">+    sk_tmp_dir = None</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    FIRMWARE_FILE="opt/osmocom-bb/target/firmware/board/compal_e88/layer1.compalram.bin"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self, suite_run, conf):</span><br><span style="color: hsl(120, 100%, 40%);">+        serial_device = conf.get('serial_device')</span><br><span style="color: hsl(120, 100%, 40%);">+        if serial_device is None:</span><br><span style="color: hsl(120, 100%, 40%);">+            raise log.Error('osmocon_phone contains no attr "serial_device"')</span><br><span style="color: hsl(120, 100%, 40%);">+        self.serial_device = os.path.realpath(serial_device)</span><br><span style="color: hsl(120, 100%, 40%);">+        super().__init__(log.C_RUN, 'osmocon_%s' % os.path.basename(self.serial_device))</span><br><span style="color: hsl(120, 100%, 40%);">+        self.suite_run = suite_run</span><br><span style="color: hsl(120, 100%, 40%);">+        self.conf = conf</span><br><span style="color: hsl(120, 100%, 40%);">+        self.sk_tmp_dir = tempfile.mkdtemp('', 'ogtosmoconsk')</span><br><span style="color: hsl(120, 100%, 40%);">+        if len(self.l2_socket_path().encode()) > 107:</span><br><span style="color: hsl(120, 100%, 40%);">+            raise log.Error('Path for l2 socket is longer than max allowed len for unix socket path (107):', self.l2_socket_path())</span><br><span style="color: hsl(120, 100%, 40%);">+        if len(self.loader_socket_path().encode()) > 107:</span><br><span style="color: hsl(120, 100%, 40%);">+            raise log.Error('Path for loader socket is longer than max allowed len for unix socket path (107):', self.loader_socket_path())</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def l2_socket_path(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        return os.path.join(self.sk_tmp_dir, 'osmocom_l2')</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def loader_socket_path(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        return os.path.join(self.sk_tmp_dir, 'osmocom_loader')</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def start(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        self.log('Resetting the phone')</span><br><span style="color: hsl(120, 100%, 40%);">+        # TODO: make sure the pone is powered off before starting osmocon</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        self.log('Starting osmocon')</span><br><span style="color: hsl(120, 100%, 40%);">+        self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmocom-bb')))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        binary = inst.child('sbin', 'osmocon')</span><br><span style="color: hsl(120, 100%, 40%);">+        if not os.path.isfile(binary):</span><br><span style="color: hsl(120, 100%, 40%);">+            raise RuntimeError('Binary missing: %r' % binary)</span><br><span style="color: hsl(120, 100%, 40%);">+        lib = inst.child('lib')</span><br><span style="color: hsl(120, 100%, 40%);">+        if not os.path.isdir(lib):</span><br><span style="color: hsl(120, 100%, 40%);">+            raise RuntimeError('No lib/ in %r' % inst)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        firmware_path = os.path.join(str(inst), Osmocon.FIRMWARE_FILE)</span><br><span style="color: hsl(120, 100%, 40%);">+        if not os.path.isfile(firmware_path):</span><br><span style="color: hsl(120, 100%, 40%);">+            raise RuntimeError('Binary missing: %r' % firmware_path)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.dbg(run_dir=self.run_dir, binary=binary, env=env)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.process = process.Process(self.name(), self.run_dir,</span><br><span style="color: hsl(120, 100%, 40%);">+                                       (binary, '-p', self.serial_device,</span><br><span style="color: hsl(120, 100%, 40%);">+                                       '-m', 'c123xor',</span><br><span style="color: hsl(120, 100%, 40%);">+                                       '-s', self.l2_socket_path(),</span><br><span style="color: hsl(120, 100%, 40%);">+                                       '-l', self.loader_socket_path(),</span><br><span style="color: hsl(120, 100%, 40%);">+                                        firmware_path),</span><br><span style="color: hsl(120, 100%, 40%);">+                                       env=env)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.suite_run.remember_to_stop(self.process)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.process.launch()</span><br><span style="color: hsl(120, 100%, 40%);">+        self.log('Waiting for osmocon to be up and running')</span><br><span style="color: hsl(120, 100%, 40%);">+        MainLoop.wait(self, os.path.exists, self.l2_socket_path())</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def running(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        return not self.process.terminated()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def cleanup(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        if self.sk_tmp_dir:</span><br><span style="color: hsl(120, 100%, 40%);">+            try:</span><br><span style="color: hsl(120, 100%, 40%);">+                os.remove(self.l2_socket_path())</span><br><span style="color: hsl(120, 100%, 40%);">+            except OSError:</span><br><span style="color: hsl(120, 100%, 40%);">+                pass</span><br><span style="color: hsl(120, 100%, 40%);">+            try:</span><br><span style="color: hsl(120, 100%, 40%);">+                os.remove(self.loader_socket_path())</span><br><span style="color: hsl(120, 100%, 40%);">+            except OSError:</span><br><span style="color: hsl(120, 100%, 40%);">+                pass</span><br><span style="color: hsl(120, 100%, 40%);">+            os.rmdir(self.sk_tmp_dir)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# vim: expandtab tabstop=4 shiftwidth=4</span><br><span>diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py</span><br><span>index 70d6e8a..28c4117 100644</span><br><span>--- a/src/osmo_gsm_tester/resource.py</span><br><span>+++ b/src/osmo_gsm_tester/resource.py</span><br><span>@@ -44,7 +44,8 @@</span><br><span> R_BTS = 'bts'</span><br><span> R_ARFCN = 'arfcn'</span><br><span> R_MODEM = 'modem'</span><br><span style="color: hsl(0, 100%, 40%);">-R_ALL = (R_IP_ADDRESS, R_BTS, R_ARFCN, R_MODEM)</span><br><span style="color: hsl(120, 100%, 40%);">+R_OSMOCON = 'osmocon_phone'</span><br><span style="color: hsl(120, 100%, 40%);">+R_ALL = (R_IP_ADDRESS, R_BTS, R_ARFCN, R_MODEM, R_OSMOCON)</span><br><span> </span><br><span> RESOURCES_SCHEMA = {</span><br><span>         'ip_address[].addr': schema.IPV4,</span><br><span>@@ -76,6 +77,7 @@</span><br><span>         'modem[].auth_algo': schema.AUTH_ALGO,</span><br><span>         'modem[].ciphers[]': schema.CIPHER,</span><br><span>         'modem[].features[]': schema.MODEM_FEATURE,</span><br><span style="color: hsl(120, 100%, 40%);">+        'osmocon_phone[].serial_device': schema.STR,</span><br><span>     }</span><br><span> </span><br><span> WANT_SCHEMA = util.dict_add(</span><br><span>diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py</span><br><span>index 618a39b..db4a8dc 100644</span><br><span>--- a/src/osmo_gsm_tester/suite.py</span><br><span>+++ b/src/osmo_gsm_tester/suite.py</span><br><span>@@ -23,7 +23,7 @@</span><br><span> import pprint</span><br><span> from . import config, log, template, util, resource, schema, test</span><br><span> from .event_loop import MainLoop</span><br><span style="color: hsl(0, 100%, 40%);">-from . import osmo_nitb, osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp, osmo_ggsn, osmo_sgsn, modem, esme</span><br><span style="color: hsl(120, 100%, 40%);">+from . import osmo_nitb, osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp, osmo_ggsn, osmo_sgsn, modem, esme, osmocon</span><br><span> </span><br><span> class Timeout(Exception):</span><br><span>     pass</span><br><span>@@ -332,6 +332,12 @@</span><br><span>         self.register_for_cleanup(esme_obj)</span><br><span>         return esme_obj</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    def osmocon(self, specifics=None):</span><br><span style="color: hsl(120, 100%, 40%);">+        conf = self.reserved_resources.get(resource.R_OSMOCON, specifics=specifics)</span><br><span style="color: hsl(120, 100%, 40%);">+        osmocon_obj = osmocon.Osmocon(self, conf=conf)</span><br><span style="color: hsl(120, 100%, 40%);">+        self.register_for_cleanup(osmocon_obj)</span><br><span style="color: hsl(120, 100%, 40%);">+        return osmocon_obj</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>     def msisdn(self):</span><br><span>         msisdn = self.resources_pool.next_msisdn(self)</span><br><span>         self.log('using MSISDN', msisdn)</span><br><span>diff --git a/ttcn3/README.txt b/ttcn3/README.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..3886c80</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/README.txt</span><br><span>@@ -0,0 +1,20 @@</span><br><span style="color: hsl(120, 100%, 40%);">+This directory contains a set of scripts and osmo-gsm-tester testsuites to run</span><br><span style="color: hsl(120, 100%, 40%);">+osmo-ttcn3-hacks.git BTS_tests.ttcn (https://git.osmocom.org/osmo-ttcn3-hacks/tree/bts).</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The idea is to set up automatically the following components:</span><br><span style="color: hsl(120, 100%, 40%);">+TTCN3 <-> osmocon (osmocom-bb) <-> motorola C123 <-> RF network <-> BTS_TO_TEST <-> TTCN3 + osmo-bsc</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+* A jenkins job builds a docker image containing a built BTS_tests TTCN testsuite.</span><br><span style="color: hsl(120, 100%, 40%);">+* Another jenkins job retrieves the artifacts from osmo-gsm-tester-build jobs</span><br><span style="color: hsl(120, 100%, 40%);">+  plus one for required osmocon binary. This job then calls osmo-gsm-tester/ttcn3/jenkins-run.sh, which will:</span><br><span style="color: hsl(120, 100%, 40%);">+** Pull the above mentioned docker image containing BTS_Tests.</span><br><span style="color: hsl(120, 100%, 40%);">+** Start osmo-gsm-tester with OSMO_GSM_TESTER_OPTS=osmo-gsm-tester/ttcn3/paths.conf,</span><br><span style="color: hsl(120, 100%, 40%);">+   that contains mostly same stuff as regular osmo-gsm-tester jobs, but with a</span><br><span style="color: hsl(120, 100%, 40%);">+   different testsuite containing 1 test "ttcn3_bts_tests.py".</span><br><span style="color: hsl(120, 100%, 40%);">+** The test "ttcn3_bts_tests.py" does the following:</span><br><span style="color: hsl(120, 100%, 40%);">+*** Start and manage all osmocom required components to run BTS_Tests: osmo-bts, osmo-bsc, osmocon, etc.</span><br><span style="color: hsl(120, 100%, 40%);">+*** Generate the BTS_Tests.cfg required by BTS_Tests from a template to adapt to dynamic bits set by osmo-gsm-tester.</span><br><span style="color: hsl(120, 100%, 40%);">+*** Launch script osmo-gsm-tester/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh with parameters and wait for it to finish.</span><br><span style="color: hsl(120, 100%, 40%);">+    This script will start and manage the lifecycle of the docker container running BTS_Tests</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+See OS#3155 for more information regarding this topic.</span><br><span>diff --git a/ttcn3/default-suites.conf b/ttcn3/default-suites.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..80f14e6</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/default-suites.conf</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+- ttcn3_bts_tests:trx</span><br><span>diff --git a/ttcn3/defaults.conf b/ttcn3/defaults.conf</span><br><span>new file mode 120000</span><br><span>index 0000000..e47699d</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/defaults.conf</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+../example/defaults.conf</span><br><span>\ No newline at end of file</span><br><span>diff --git a/ttcn3/jenkins-run.sh b/ttcn3/jenkins-run.sh</span><br><span>new file mode 100755</span><br><span>index 0000000..c744606</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/jenkins-run.sh</span><br><span>@@ -0,0 +1,58 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/sh</span><br><span style="color: hsl(120, 100%, 40%);">+set -e -x</span><br><span style="color: hsl(120, 100%, 40%);">+base="$PWD"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+time_start="$(date '+%F %T')"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+prepare_docker() {</span><br><span style="color: hsl(120, 100%, 40%);">+        OLDPWD=$PWD</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        # update docker-playground and update the BSC and bsc-test containers (if needed)</span><br><span style="color: hsl(120, 100%, 40%);">+        DIR=~/jenkins/docker-playground</span><br><span style="color: hsl(120, 100%, 40%);">+        if [ ! -d "$DIR" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+                mkdir -p ~/jenkins/ && cd ~/jenkins</span><br><span style="color: hsl(120, 100%, 40%);">+                git clone git://git.osmocom.org/docker-playground</span><br><span style="color: hsl(120, 100%, 40%);">+        fi</span><br><span style="color: hsl(120, 100%, 40%);">+        cd $DIR</span><br><span style="color: hsl(120, 100%, 40%);">+        git remote prune origin; git fetch; git checkout -f -B master origin/master</span><br><span style="color: hsl(120, 100%, 40%);">+        cd $DIR/debian-stretch-titan && make</span><br><span style="color: hsl(120, 100%, 40%);">+        docker pull laforge/debian-stretch-titan:latest # HACK</span><br><span style="color: hsl(120, 100%, 40%);">+        cd $DIR/ttcn3-bts-test && make</span><br><span style="color: hsl(120, 100%, 40%);">+        # execute the script to start containers, read results, ...</span><br><span style="color: hsl(120, 100%, 40%);">+        #cd $DIR/ttcn3-bts-test && sh -x ./jenkins.sh</span><br><span style="color: hsl(120, 100%, 40%);">+        PWD=$OLDPWD</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+docker pull registry.sysmocom.de/ttcn3-bts-test</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# remove older trial dirs and *-run.tgz, if any</span><br><span style="color: hsl(120, 100%, 40%);">+trial_dir_prefix="trial-"</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf "$trial_dir_prefix"* || true</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Expecting *.tgz artifacts to be copied to this workspace from the various</span><br><span style="color: hsl(120, 100%, 40%);">+# jenkins-*.sh runs, via jenkins job configuration. Compose a trial dir:</span><br><span style="color: hsl(120, 100%, 40%);">+trial_dir="${trial_dir_prefix}$BUILD_NUMBER"</span><br><span style="color: hsl(120, 100%, 40%);">+mkdir -p "$trial_dir"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+mv *.tgz "$trial_dir"</span><br><span style="color: hsl(120, 100%, 40%);">+cat *.md5 >> "$trial_dir/checksums.md5"</span><br><span style="color: hsl(120, 100%, 40%);">+rm *.md5</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# OSMO_GSM_TESTER_OPTS is a way to pass in e.g. logging preferences from the</span><br><span style="color: hsl(120, 100%, 40%);">+# jenkins build job.</span><br><span style="color: hsl(120, 100%, 40%);">+# On failure, first clean up below and then return the exit code.</span><br><span style="color: hsl(120, 100%, 40%);">+exit_code="1"</span><br><span style="color: hsl(120, 100%, 40%);">+if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then</span><br><span style="color: hsl(120, 100%, 40%);">+  exit_code="0"</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# no need to keep extracted binaries</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf "$trial_dir/inst" || true</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# tar up all results for archiving (optional)</span><br><span style="color: hsl(120, 100%, 40%);">+cd "$trial_dir"</span><br><span style="color: hsl(120, 100%, 40%);">+journalctl -u ofono -o short-precise --since "${time_start}" > "$(readlink last_run)/ofono.log"</span><br><span style="color: hsl(120, 100%, 40%);">+tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)"</span><br><span style="color: hsl(120, 100%, 40%);">+tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exit $exit_code</span><br><span>diff --git a/ttcn3/paths.conf b/ttcn3/paths.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..27c5818</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/paths.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+state_dir: '/var/tmp/osmo-gsm-tester/state'</span><br><span style="color: hsl(120, 100%, 40%);">+suites_dir: './suites'</span><br><span style="color: hsl(120, 100%, 40%);">+scenarios_dir: './scenarios'</span><br><span>diff --git a/ttcn3/resources.conf.prod b/ttcn3/resources.conf.prod</span><br><span>new file mode 120000</span><br><span>index 0000000..3e40e89</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/resources.conf.prod</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+../example/resources.conf.prod</span><br><span>\ No newline at end of file</span><br><span>diff --git a/ttcn3/resources.conf.rnd b/ttcn3/resources.conf.rnd</span><br><span>new file mode 120000</span><br><span>index 0000000..6f98474</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/resources.conf.rnd</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+../example/resources.conf.rnd</span><br><span>\ No newline at end of file</span><br><span>diff --git a/ttcn3/scenarios/trx.conf b/ttcn3/scenarios/trx.conf</span><br><span>new file mode 120000</span><br><span>index 0000000..d72ddb2</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/scenarios/trx.conf</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+../../example/scenarios/trx.conf</span><br><span>\ No newline at end of file</span><br><span>diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl</span><br><span>new file mode 100644</span><br><span>index 0000000..7379528</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[ORDERED_INCLUDE]</span><br><span style="color: hsl(120, 100%, 40%);">+"/osmo-ttcn3-hacks/Common.cfg"</span><br><span style="color: hsl(120, 100%, 40%);">+"/osmo-ttcn3-hacks/bts/BTS_Tests.default"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[LOGGING]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[TESTPORT_PARAMETERS]</span><br><span style="color: hsl(120, 100%, 40%);">+*.BTSVTY.CTRL_HOSTNAME := "${btsvty_ctrl_hostname}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[MODULE_PARAMETERS]</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_rsl_ip := "172.18.9.10"</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_bb_trxc_ip := "127.0.0.1"</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_pcu_socket := "/data/unix_pcu/pcu_bts"</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_bb_trxc_port := -1</span><br><span style="color: hsl(120, 100%, 40%);">+L1CTL_PortType.m_l1ctl_sock_path := "/data/unix_l2/osmocom_l2"</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_ctrl_ip   := "${btsvty_ctrl_hostname}"</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_rxlev_exp := 1</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_tolerance_rxlev := 10;</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_tolerance_rxqual := 1;</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.mp_trx0_arfcn := 868</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[MAIN_CONTROLLER]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[EXECUTE]</span><br><span style="color: hsl(120, 100%, 40%);">+BTS_Tests.control</span><br><span>diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh b/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh</span><br><span>new file mode 100755</span><br><span>index 0000000..64987b3</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh</span><br><span>@@ -0,0 +1,86 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/sh</span><br><span style="color: hsl(120, 100%, 40%);">+set -x</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+RUNDIR="$1"</span><br><span style="color: hsl(120, 100%, 40%);">+JUNIT_TTCN3_DST_FILE="$2"</span><br><span style="color: hsl(120, 100%, 40%);">+L2_SOCKET_PATH="$3"</span><br><span style="color: hsl(120, 100%, 40%);">+PCU_SOCKET_PATH="$4"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Absolute path to this script</span><br><span style="color: hsl(120, 100%, 40%);">+SCRIPT=$(readlink -f "$0")</span><br><span style="color: hsl(120, 100%, 40%);">+# Absolute path this script is in</span><br><span style="color: hsl(120, 100%, 40%);">+SCRIPTPATH=$(dirname "$SCRIPT")</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+VOL_BASE_DIR="$RUNDIR/logs"</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf "$VOL_BASE_DIR"</span><br><span style="color: hsl(120, 100%, 40%);">+mkdir -p "$VOL_BASE_DIR"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if [ "x$BUILD_TAG" = "x" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+       BUILD_TAG=nonjenkins</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+REPO_USER="registry.sysmocom.de"</span><br><span style="color: hsl(120, 100%, 40%);">+SUITE_NAME="ttcn3-bts-test"</span><br><span style="color: hsl(120, 100%, 40%);">+NET_NAME=$SUITE_NAME</span><br><span style="color: hsl(120, 100%, 40%);">+DOCKER_NAME="$BUILD_TAG-$SUITE_NAME"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+network_create() {</span><br><span style="color: hsl(120, 100%, 40%);">+     NET=$1</span><br><span style="color: hsl(120, 100%, 40%);">+        echo Creating network $NET_NAME</span><br><span style="color: hsl(120, 100%, 40%);">+       docker network create --internal --subnet $NET $NET_NAME</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+network_remove() {</span><br><span style="color: hsl(120, 100%, 40%);">+     echo Removing network $NET_NAME</span><br><span style="color: hsl(120, 100%, 40%);">+       docker network remove $NET_NAME</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+child_ps=0</span><br><span style="color: hsl(120, 100%, 40%);">+forward_kill() {</span><br><span style="color: hsl(120, 100%, 40%);">+    sig="$1"</span><br><span style="color: hsl(120, 100%, 40%);">+    echo "Caught signal SIG$sig!"</span><br><span style="color: hsl(120, 100%, 40%);">+       if [ "$child_ps" != "0" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+           echo "Killing $child_ps with SIG$sig!"</span><br><span style="color: hsl(120, 100%, 40%);">+              docker kill ${DOCKER_NAME}</span><br><span style="color: hsl(120, 100%, 40%);">+    fi</span><br><span style="color: hsl(120, 100%, 40%);">+    exit 130</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+forward_kill_int() {</span><br><span style="color: hsl(120, 100%, 40%);">+     forward_kill "INT"</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+forward_kill_term() {</span><br><span style="color: hsl(120, 100%, 40%);">+        forward_kill "TERM"</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+# Don't use 'set -e', otherwise traps are not triggered!</span><br><span style="color: hsl(120, 100%, 40%);">+trap forward_kill_int INT</span><br><span style="color: hsl(120, 100%, 40%);">+trap forward_kill_term TERM</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+network_create 172.18.9.0/24</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+mkdir $VOL_BASE_DIR/bts-tester</span><br><span style="color: hsl(120, 100%, 40%);">+echo "SCRIPTPATH=$SCRIPTPATH PWD=$PWD"</span><br><span style="color: hsl(120, 100%, 40%);">+cp $RUNDIR/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester/</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+echo Starting container with BTS testsuite</span><br><span style="color: hsl(120, 100%, 40%);">+docker kill ${DOCKER_NAME}</span><br><span style="color: hsl(120, 100%, 40%);">+docker run    --rm \</span><br><span style="color: hsl(120, 100%, 40%);">+                --network $NET_NAME --ip 172.18.9.10 \</span><br><span style="color: hsl(120, 100%, 40%);">+                -e "TTCN3_PCAP_PATH=/data" \</span><br><span style="color: hsl(120, 100%, 40%);">+                --mount type=bind,source=$VOL_BASE_DIR/bts-tester,destination=/data \</span><br><span style="color: hsl(120, 100%, 40%);">+         --mount type=bind,source="$(dirname "$L2_SOCKET_PATH")",destination=/data/unix_l2 \</span><br><span style="color: hsl(120, 100%, 40%);">+               --mount type=bind,source="$(dirname "$PCU_SOCKET_PATH")",destination=/data/unix_pcu \</span><br><span style="color: hsl(120, 100%, 40%);">+             --name ${DOCKER_NAME} \</span><br><span style="color: hsl(120, 100%, 40%);">+               $REPO_USER/${SUITE_NAME} &</span><br><span style="color: hsl(120, 100%, 40%);">+child_ps=$!</span><br><span style="color: hsl(120, 100%, 40%);">+echo "$$: waiting for $child_ps"</span><br><span style="color: hsl(120, 100%, 40%);">+wait "$child_ps"</span><br><span style="color: hsl(120, 100%, 40%);">+child_exit_code="$?"</span><br><span style="color: hsl(120, 100%, 40%);">+echo "ttcn3 docker exited with code $child_exit_code"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+network_remove</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+echo "Copying TTCN3 junit file to $JUNIT_TTCN3_DST_FILE"</span><br><span style="color: hsl(120, 100%, 40%);">+cp $VOL_BASE_DIR/bts-tester/junit-xml-*.log $JUNIT_TTCN3_DST_FILE</span><br><span style="color: hsl(120, 100%, 40%);">+sed -i "s#classname='BTS_Tests'#classname='$(basename $JUNIT_TTCN3_DST_FILE)'#g" $JUNIT_TTCN3_DST_FILE</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exit $child_exit_code</span><br><span>diff --git a/ttcn3/suites/ttcn3_bts_tests/suite.conf b/ttcn3/suites/ttcn3_bts_tests/suite.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..1eb0a02</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/suites/ttcn3_bts_tests/suite.conf</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+resources:</span><br><span style="color: hsl(120, 100%, 40%);">+  ip_address:</span><br><span style="color: hsl(120, 100%, 40%);">+  - times: 7 # msc, bsc, hlr, stp, mgw, sgsn, ggsn</span><br><span style="color: hsl(120, 100%, 40%);">+  bts:</span><br><span style="color: hsl(120, 100%, 40%);">+  - times: 1</span><br><span style="color: hsl(120, 100%, 40%);">+  osmocon_phone:</span><br><span style="color: hsl(120, 100%, 40%);">+  - times: 1</span><br><span>diff --git a/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py b/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py</span><br><span>new file mode 100755</span><br><span>index 0000000..b3ca946</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py</span><br><span>@@ -0,0 +1,71 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/env python3</span><br><span style="color: hsl(120, 100%, 40%);">+import os</span><br><span style="color: hsl(120, 100%, 40%);">+from mako.template import Template</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.testenv import *</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+hlr_dummy = suite.hlr()</span><br><span style="color: hsl(120, 100%, 40%);">+mgw_dummy = suite.mgw()</span><br><span style="color: hsl(120, 100%, 40%);">+stp_dummy = suite.stp()</span><br><span style="color: hsl(120, 100%, 40%);">+msc_dummy = suite.msc(hlr_dummy, mgw_dummy, stp_dummy)</span><br><span style="color: hsl(120, 100%, 40%);">+ggsn_dummy = suite.ggsn()</span><br><span style="color: hsl(120, 100%, 40%);">+sgsn_dummy = suite.sgsn(hlr_dummy, ggsn_dummy)</span><br><span style="color: hsl(120, 100%, 40%);">+bsc = suite.bsc(msc_dummy, mgw_dummy, stp_dummy)</span><br><span style="color: hsl(120, 100%, 40%);">+bts = suite.bts()</span><br><span style="color: hsl(120, 100%, 40%);">+osmocon = suite.osmocon()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_num_trx(1)</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 0, 'CCCH+SDCCH4')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 1, 'TCH/F')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 2, 'TCH/F')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 3, 'TCH/F_PDCH')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 4, 'TCH/F_TCH/H_PDCH')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 5, 'TCH/H')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 6, 'SDCCH8')</span><br><span style="color: hsl(120, 100%, 40%);">+bts.set_trx_phy_channel(0, 7, 'PDCH')</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+print('Starting CNI')</span><br><span style="color: hsl(120, 100%, 40%);">+hlr_dummy.start()</span><br><span style="color: hsl(120, 100%, 40%);">+stp_dummy.start()</span><br><span style="color: hsl(120, 100%, 40%);">+msc_dummy.start()</span><br><span style="color: hsl(120, 100%, 40%);">+mgw_dummy.start()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+bsc.set_rsl_ip('172.18.9.10')</span><br><span style="color: hsl(120, 100%, 40%);">+bsc.bts_add(bts)</span><br><span style="color: hsl(120, 100%, 40%);">+sgsn_dummy.bts_add(bts)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+bsc.start()</span><br><span style="color: hsl(120, 100%, 40%);">+bts.start(keepalive=True)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+print('Starting osmocon')</span><br><span style="color: hsl(120, 100%, 40%);">+osmocon.start()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+own_dir = os.path.dirname(os.path.realpath(__file__))</span><br><span style="color: hsl(120, 100%, 40%);">+script_file = os.path.join(own_dir, 'scripts', 'run_ttcn3_docker.sh')</span><br><span style="color: hsl(120, 100%, 40%);">+bts_tmpl_file = os.path.join(own_dir, 'scripts', 'BTS_Tests.cfg.tmpl')</span><br><span style="color: hsl(120, 100%, 40%);">+script_run_dir = test.get_run_dir().new_dir('ttcn3')</span><br><span style="color: hsl(120, 100%, 40%);">+bts_cfg_file = os.path.join(str(script_run_dir), 'BTS_Tests.cfg')</span><br><span style="color: hsl(120, 100%, 40%);">+junit_ttcn3_dst_file = os.path.join(str(suite.trial.get_run_dir()), 'trial-') + suite.name() + '.xml'</span><br><span style="color: hsl(120, 100%, 40%);">+docker_cmd = (script_file, str(script_run_dir), junit_ttcn3_dst_file, osmocon.l2_socket_path(), bts.pcu_socket_path())</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+print('Creating template')</span><br><span style="color: hsl(120, 100%, 40%);">+mytemplate = Template(filename=bts_tmpl_file)</span><br><span style="color: hsl(120, 100%, 40%);">+r = mytemplate.render(btsvty_ctrl_hostname=bts.remote_addr())</span><br><span style="color: hsl(120, 100%, 40%);">+with open(bts_cfg_file, 'w') as f:</span><br><span style="color: hsl(120, 100%, 40%);">+    f.write(r)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+print('Starting TTCN3 tests')</span><br><span style="color: hsl(120, 100%, 40%);">+proc = process.Process('ttcn3', script_run_dir, docker_cmd)</span><br><span style="color: hsl(120, 100%, 40%);">+try:</span><br><span style="color: hsl(120, 100%, 40%);">+    proc.launch()</span><br><span style="color: hsl(120, 100%, 40%);">+    print('Starting TTCN3 launched, waiting until it finishes')</span><br><span style="color: hsl(120, 100%, 40%);">+    proc.wait(timeout=3600)</span><br><span style="color: hsl(120, 100%, 40%);">+except Exception as e:</span><br><span style="color: hsl(120, 100%, 40%);">+    proc.terminate()</span><br><span style="color: hsl(120, 100%, 40%);">+    raise e</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if proc.result != 0:</span><br><span style="color: hsl(120, 100%, 40%);">+    raise RuntimeError("run_ttcn3_docker.sh exited with error code %d" % proc.result)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+print('Done')</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10158">change 10158</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/10158"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 </div>
<div style="display:none"> Gerrit-Change-Number: 10158 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>