ttcn3/lib/testlib.py: implement the concept of test case groups

Change-Id: I687c221e4a6c7232290509cb11a3158d72b9c2c3
diff --git a/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py b/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py
index 3548333..c3b3f35 100644
--- a/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py
+++ b/sysmocom/ttcn3/suites/ttcn3_bts_tests/lib/testlib.py
@@ -4,7 +4,9 @@
 
 from osmo_gsm_tester.testenv import *
 
-def run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip, ttcn3_test_execute, ttcn3_test_extra_module_params=""):
+def run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip,
+              ttcn3_test_groups = [],
+              ttcn3_test_extra_module_params=""):
     own_dir = testdir
     script_file = os.path.join(testdir, 'scripts', 'run_ttcn3_docker.sh')
     bts_tmpl_file = os.path.join(testdir, 'scripts', 'BTS_Tests.cfg.tmpl')
@@ -23,7 +25,7 @@
     mytemplate = Template(filename=bts_tmpl_file)
     r = mytemplate.render(btsvty_ctrl_hostname=bts.remote_addr(),
                           pcu_available=pcu_available,
-                          ttcn3_test_execute=ttcn3_test_execute,
+                          ttcn3_test_groups=ttcn3_test_groups,
                           ttcn3_test_extra_module_params=ttcn3_test_extra_module_params)
     with open(bts_cfg_file, 'w') as f:
         f.write(r)
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
index 510234e..4756ea1 100644
--- a/sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl
+++ b/sysmocom/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl
@@ -29,4 +29,6 @@
 [MAIN_CONTROLLER]
 
 [EXECUTE]
-${ttcn3_test_execute}
+% for group in ttcn3_test_groups:
+${group}.control
+% endfor
diff --git a/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py b/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py
index 4382454..7f0b24f 100755
--- a/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py
+++ b/sysmocom/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py
@@ -6,7 +6,9 @@
 tenv.test_import_modules_register_for_cleanup(testlib)
 from testlib import run_ttcn3
 
-ttcn3_test_execute="BTS_Tests.control"
+ttcn3_test_groups = [
+    'BTS_Tests',
+]
 
 hlr_dummy = tenv.hlr()
 mgw_dummy = tenv.mgw()
@@ -46,4 +48,4 @@
 osmocon.start()
 
 testdir = os.path.dirname(os.path.realpath(__file__))
-run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip, ttcn3_test_execute)
+run_ttcn3(tenv, testdir, bts, osmocon, nat_rsl_ip, ttcn3_test_groups)