aboutsummaryrefslogtreecommitdiffstats
path: root/selftest
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-05-25 13:26:41 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-05-25 13:33:50 +0200
commit66ef9457cba0c2b311a7f57a5dc2a4b68a00e0cb (patch)
tree38fed3fce6fa20d2c79145138734a252d2983401 /selftest
parent3a0dea682e73c605c2a4d45f0e7a8a39fba3bb6b (diff)
config: suites_dir and scenarios_dir are now a list of paths
This allows inheriting suites or scenarios from eg. sysmocom/ dir, while still allowing to apply new suites and scenarios on top. Change-Id: Icecdae32d400a6b6da2ebf167c1c795f7a74ae96
Diffstat (limited to 'selftest')
-rw-r--r--selftest/resource_test/conf/paths.conf2
-rw-r--r--selftest/resource_test/resource_test.ok4
-rw-r--r--selftest/scenario_test/paths.conf4
-rw-r--r--selftest/scenario_test/scenario_test.ok10
-rw-r--r--selftest/suite_test/paths.conf2
-rw-r--r--selftest/suite_test/suite_test.ok9
-rw-r--r--selftest/suite_test/suitedirA/empty_dir/.unrelated_file (renamed from selftest/suite_test/empty_dir/.unrelated_file)0
-rw-r--r--selftest/suite_test/suitedirA/test_suite/hello_world.py (renamed from selftest/suite_test/test_suite/hello_world.py)0
-rw-r--r--selftest/suite_test/suitedirA/test_suite/mo_mt_sms.py (renamed from selftest/suite_test/test_suite/mo_mt_sms.py)0
-rw-r--r--selftest/suite_test/suitedirA/test_suite/mo_sms.py (renamed from selftest/suite_test/test_suite/mo_sms.py)0
-rw-r--r--selftest/suite_test/suitedirA/test_suite/suite.conf (renamed from selftest/suite_test/test_suite/suite.conf)0
-rwxr-xr-xselftest/suite_test/suitedirA/test_suite/test_error.py (renamed from selftest/suite_test/test_suite/test_error.py)0
-rwxr-xr-xselftest/suite_test/suitedirA/test_suite/test_fail.py (renamed from selftest/suite_test/test_suite/test_fail.py)0
-rwxr-xr-xselftest/suite_test/suitedirA/test_suite/test_fail_raise.py (renamed from selftest/suite_test/test_suite/test_fail_raise.py)0
-rw-r--r--selftest/suite_test/suitedirA/test_suite/test_suite_params.py (renamed from selftest/suite_test/test_suite/test_suite_params.py)0
-rw-r--r--selftest/suite_test/suitedirB/suiteB/suite.conf4
-rwxr-xr-xselftest/suite_test/suitedirB/suiteB/test_success.py5
17 files changed, 25 insertions, 15 deletions
diff --git a/selftest/resource_test/conf/paths.conf b/selftest/resource_test/conf/paths.conf
index 0b2d035..3280a12 100644
--- a/selftest/resource_test/conf/paths.conf
+++ b/selftest/resource_test/conf/paths.conf
@@ -1,2 +1,2 @@
state_dir: ./test_work/state_dir
-suites_dir: ./suite_test
+suites_dir: ['./suite_test']
diff --git a/selftest/resource_test/resource_test.ok b/selftest/resource_test/resource_test.ok
index 0ad760e..91acaaf 100644
--- a/selftest/resource_test/resource_test.ok
+++ b/selftest/resource_test/resource_test.ok
@@ -14,9 +14,9 @@ cnf -: DBG: MAIN CONFIG:
{'default_suites_conf_path': '[PATH]/selftest/resource_test/conf/default-suites.conf',
'defaults_conf_path': '[PATH]/selftest/resource_test/conf/defaults.conf',
'resource_conf_path': '[PATH]/selftest/resource_test/conf/resources.conf',
- 'scenarios_dir': '[PATH]/selftest/resource_test/conf/scenarios',
+ 'scenarios_dir': ['[PATH]/selftest/resource_test/conf/scenarios'],
'state_dir': '[PATH]/selftest/resource_test/conf/test_work/state_dir',
- 'suites_dir': '[PATH]/selftest/resource_test/conf/suite_test',
+ 'suites_dir': ['[PATH]/selftest/resource_test/conf/suite_test'],
'trial_dir': '[PATH]/selftest/resource_test/conf/trial'}
*** all resources:
{'arfcn': [{'_hash': 'e620569450f8259b3f0212ec19c285dd07df063c',
diff --git a/selftest/scenario_test/paths.conf b/selftest/scenario_test/paths.conf
index c7df5ac..11e59bf 100644
--- a/selftest/scenario_test/paths.conf
+++ b/selftest/scenario_test/paths.conf
@@ -1,3 +1,3 @@
state_dir: ./test_work/state_dir
-suites_dir: .
-scenarios_dir: .
+suites_dir: ['.']
+scenarios_dir: ['.']
diff --git a/selftest/scenario_test/scenario_test.ok b/selftest/scenario_test/scenario_test.ok
index e845f4c..06db4f4 100644
--- a/selftest/scenario_test/scenario_test.ok
+++ b/selftest/scenario_test/scenario_test.ok
@@ -3,9 +3,9 @@ cnf -: DBG: MAIN CONFIG:
{'default_suites_conf_path': '[PATH]/selftest/scenario_test/default-suites.conf',
'defaults_conf_path': '[PATH]/selftest/scenario_test/defaults.conf',
'resource_conf_path': '[PATH]/selftest/scenario_test/resources.conf',
- 'scenarios_dir': '[PATH]/selftest/scenario_test',
+ 'scenarios_dir': ['[PATH]/selftest/scenario_test'],
'state_dir': '[PATH]/selftest/scenario_test/test_work/state_dir',
- 'suites_dir': '[PATH]/selftest/scenario_test',
+ 'suites_dir': ['[PATH]/selftest/scenario_test'],
'trial_dir': '[PATH]/selftest/scenario_test/trial'}
scenario_case_01.conf
{'anotherlist': ['4', '0'],
@@ -19,11 +19,11 @@ scenario_case_01.conf
'somelist': [{'somelistitem': 'firststring'},
{'somelistitem': 'secondstring'},
{'somelistitem': 'thirdstring'}]}
-OK: expected RuntimeError: No such scenario file: '[PATH]/selftest/scenario_test/scenario_case_01@.conf' (nor scenario_case_01@.conf)
+OK: expected RuntimeError: No such scenario file 'scenario_case_01@.conf' (nor scenario_case_01@.conf) in [[PATH]/selftest/scenario_test]
OK: expected ValueError
OK: expected ValueError
-OK: expected RuntimeError: No such scenario file: '[PATH]/selftest/scenario_test/scenario_case_03.conf'
-OK: expected RuntimeError: No such scenario file: '[PATH]/selftest/scenario_test/scenario_case_03.conf'
+OK: expected RuntimeError: No such scenario file scenario_case_03.conf in [[PATH]/selftest/scenario_test]
+OK: expected RuntimeError: No such scenario file scenario_case_03.conf in [[PATH]/selftest/scenario_test]
tst scenario_case_03@heyho,1,yes.conf: DBG: {param_dict={param1='heyho', param2='1', param3='yes'}}
scenario_case_03@heyho,1,yes.conf
{'anotherlist': ['1', '0'],
diff --git a/selftest/suite_test/paths.conf b/selftest/suite_test/paths.conf
index 2b0a274..a2f9124 100644
--- a/selftest/suite_test/paths.conf
+++ b/selftest/suite_test/paths.conf
@@ -1,2 +1,2 @@
state_dir: ./test_work/state_dir
-suites_dir: .
+suites_dir: ['suitedirA', 'suitedirB']
diff --git a/selftest/suite_test/suite_test.ok b/selftest/suite_test/suite_test.ok
index d55317b..fee07d0 100644
--- a/selftest/suite_test/suite_test.ok
+++ b/selftest/suite_test/suite_test.ok
@@ -4,14 +4,15 @@ cnf -: DBG: MAIN CONFIG:
{'default_suites_conf_path': '[PATH]/selftest/suite_test/default-suites.conf',
'defaults_conf_path': '[PATH]/selftest/suite_test/defaults.conf',
'resource_conf_path': '[PATH]/selftest/suite_test/resources.conf',
- 'scenarios_dir': '[PATH]/selftest/suite_test/scenarios',
+ 'scenarios_dir': ['[PATH]/selftest/suite_test/scenarios'],
'state_dir': '[PATH]/selftest/suite_test/test_work/state_dir',
- 'suites_dir': '[PATH]/selftest/suite_test',
+ 'suites_dir': ['[PATH]/selftest/suite_test/suitedirA',
+ '[PATH]/selftest/suite_test/suitedirB'],
'trial_dir': '[PATH]/selftest/suite_test/trial'}
---- -: ERR: RuntimeError: Suite not found: 'does_not_exist' in [PATH]/selftest/suite_test
+--- -: ERR: RuntimeError: Suite not found: 'does_not_exist' in [[PATH]/selftest/suite_test/suitedirA, [PATH]/selftest/suite_test/suitedirB]
- no suite.conf
cnf empty_dir: DBG: reading suite.conf
-cnf [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir↪[PATH]/selftest/suite_test/empty_dir/suite.conf]
+cnf [PATH]/selftest/suite_test/suitedirA/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/suitedirA/empty_dir/suite.conf' [empty_dir↪[PATH]/selftest/suite_test/suitedirA/empty_dir/suite.conf]
- valid suite dir
cnf test_suite: DBG: reading suite.conf
defaults:
diff --git a/selftest/suite_test/empty_dir/.unrelated_file b/selftest/suite_test/suitedirA/empty_dir/.unrelated_file
index e69de29..e69de29 100644
--- a/selftest/suite_test/empty_dir/.unrelated_file
+++ b/selftest/suite_test/suitedirA/empty_dir/.unrelated_file
diff --git a/selftest/suite_test/test_suite/hello_world.py b/selftest/suite_test/suitedirA/test_suite/hello_world.py
index 81a9624..81a9624 100644
--- a/selftest/suite_test/test_suite/hello_world.py
+++ b/selftest/suite_test/suitedirA/test_suite/hello_world.py
diff --git a/selftest/suite_test/test_suite/mo_mt_sms.py b/selftest/suite_test/suitedirA/test_suite/mo_mt_sms.py
index c9558d8..c9558d8 100644
--- a/selftest/suite_test/test_suite/mo_mt_sms.py
+++ b/selftest/suite_test/suitedirA/test_suite/mo_mt_sms.py
diff --git a/selftest/suite_test/test_suite/mo_sms.py b/selftest/suite_test/suitedirA/test_suite/mo_sms.py
index 768a99c..768a99c 100644
--- a/selftest/suite_test/test_suite/mo_sms.py
+++ b/selftest/suite_test/suitedirA/test_suite/mo_sms.py
diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/suitedirA/test_suite/suite.conf
index 4b70be8..4b70be8 100644
--- a/selftest/suite_test/test_suite/suite.conf
+++ b/selftest/suite_test/suitedirA/test_suite/suite.conf
diff --git a/selftest/suite_test/test_suite/test_error.py b/selftest/suite_test/suitedirA/test_suite/test_error.py
index 6a258e3..6a258e3 100755
--- a/selftest/suite_test/test_suite/test_error.py
+++ b/selftest/suite_test/suitedirA/test_suite/test_error.py
diff --git a/selftest/suite_test/test_suite/test_fail.py b/selftest/suite_test/suitedirA/test_suite/test_fail.py
index 83c9b44..83c9b44 100755
--- a/selftest/suite_test/test_suite/test_fail.py
+++ b/selftest/suite_test/suitedirA/test_suite/test_fail.py
diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/suitedirA/test_suite/test_fail_raise.py
index 4e5eddb..4e5eddb 100755
--- a/selftest/suite_test/test_suite/test_fail_raise.py
+++ b/selftest/suite_test/suitedirA/test_suite/test_fail_raise.py
diff --git a/selftest/suite_test/test_suite/test_suite_params.py b/selftest/suite_test/suitedirA/test_suite/test_suite_params.py
index 2cb89d7..2cb89d7 100644
--- a/selftest/suite_test/test_suite/test_suite_params.py
+++ b/selftest/suite_test/suitedirA/test_suite/test_suite_params.py
diff --git a/selftest/suite_test/suitedirB/suiteB/suite.conf b/selftest/suite_test/suitedirB/suiteB/suite.conf
new file mode 100644
index 0000000..3645cd9
--- /dev/null
+++ b/selftest/suite_test/suitedirB/suiteB/suite.conf
@@ -0,0 +1,4 @@
+resources:
+
+defaults:
+ timeout: 60s
diff --git a/selftest/suite_test/suitedirB/suiteB/test_success.py b/selftest/suite_test/suitedirB/suiteB/test_success.py
new file mode 100755
index 0000000..97bb915
--- /dev/null
+++ b/selftest/suite_test/suitedirB/suiteB/test_success.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.testenv import *
+
+print('I am %r / %r' % (tenv.suite().name(), test.name()))
+