<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/19530">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Hoernchen: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ttcn3/lib/testlib.py: implement the concept of test case groups<br><br>Change-Id: I687c221e4a6c7232290509cb11a3158d72b9c2c3<br>---<br>M sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py<br>M sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl<br>M sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py<br>3 files changed, 11 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py b/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py</span><br><span>index 3548333..c3b3f35 100644</span><br><span>--- a/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py</span><br><span>+++ b/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py</span><br><span>@@ -4,7 +4,9 @@</span><br><span> </span><br><span> from osmo_gsm_tester.testenv import *</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-def run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip, ttcn3_test_execute, ttcn3_test_extra_module_params=""):</span><br><span style="color: hsl(120, 100%, 40%);">+def run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip,</span><br><span style="color: hsl(120, 100%, 40%);">+              ttcn3_test_groups = [],</span><br><span style="color: hsl(120, 100%, 40%);">+              ttcn3_test_extra_module_params=""):</span><br><span>     own_dir = testdir</span><br><span>     script_file = os.path.join(testdir, 'scripts', 'run_ttcn3_docker.sh')</span><br><span>     bts_tmpl_file = os.path.join(testdir, 'scripts', 'BTS_Tests.cfg.tmpl')</span><br><span>@@ -23,7 +25,7 @@</span><br><span>     mytemplate = Template(filename=bts_tmpl_file)</span><br><span>     r = mytemplate.render(btsvty_ctrl_hostname=bts.remote_addr(),</span><br><span>                           pcu_available=pcu_available,</span><br><span style="color: hsl(0, 100%, 40%);">-                          ttcn3_test_execute=ttcn3_test_execute,</span><br><span style="color: hsl(120, 100%, 40%);">+                          ttcn3_test_groups=ttcn3_test_groups,</span><br><span>                           ttcn3_test_extra_module_params=ttcn3_test_extra_module_params)</span><br><span>     with open(bts_cfg_file, 'w') as f:</span><br><span>         f.write(r)</span><br><span>diff --git a/sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl</span><br><span>index 510234e..4756ea1 100644</span><br><span>--- a/sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl</span><br><span>+++ b/sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl</span><br><span>@@ -29,4 +29,6 @@</span><br><span> [MAIN_CONTROLLER]</span><br><span> </span><br><span> [EXECUTE]</span><br><span style="color: hsl(0, 100%, 40%);">-${ttcn3_test_execute}</span><br><span style="color: hsl(120, 100%, 40%);">+% for group in ttcn3_test_groups:</span><br><span style="color: hsl(120, 100%, 40%);">+${group}.control</span><br><span style="color: hsl(120, 100%, 40%);">+% endfor</span><br><span>diff --git a/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py b/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py</span><br><span>index 4382454..7f0b24f 100755</span><br><span>--- a/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py</span><br><span>+++ b/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py</span><br><span>@@ -6,7 +6,9 @@</span><br><span> tenv.test_import_modules_register_for_cleanup(testlib)</span><br><span> from testlib import run_ttcn3</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-ttcn3_test_execute="BTS_Tests.control"</span><br><span style="color: hsl(120, 100%, 40%);">+ttcn3_test_groups = [</span><br><span style="color: hsl(120, 100%, 40%);">+    'BTS_Tests',</span><br><span style="color: hsl(120, 100%, 40%);">+]</span><br><span> </span><br><span> hlr_dummy = tenv.hlr()</span><br><span> mgw_dummy = tenv.mgw()</span><br><span>@@ -46,4 +48,4 @@</span><br><span> osmocon.start()</span><br><span> </span><br><span> testdir = os.path.dirname(os.path.realpath(__file__))</span><br><span style="color: hsl(0, 100%, 40%);">-run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip, ttcn3_test_execute)</span><br><span style="color: hsl(120, 100%, 40%);">+run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip, ttcn3_test_groups)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/19530">change 19530</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/osmo-gsm-tester/+/19530"/><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-Change-Id: I687c221e4a6c7232290509cb11a3158d72b9c2c3 </div>
<div style="display:none"> Gerrit-Change-Number: 19530 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Assignee: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>