aboutsummaryrefslogtreecommitdiffstats
path: root/selftest
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-04-27 19:48:09 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-04-27 20:24:50 +0200
commit2694a9d329dfefc01e5e8d0477177589781d9585 (patch)
tree1123e72ebd42332025e507d8bfe075c1b87a0e6c /selftest
parentac45a223560c8b45f872d3de7ab4629a308e2e77 (diff)
fix 'make check'
Apply various fixes that arose from test case code rot. These tests will now be used to verify patches submitted to gerrit, so they need to be up to par. Change-Id: I5277be0c434226d9d02e038f0bc72fd2557350c1 Related: OS#2215
Diffstat (limited to 'selftest')
-rw-r--r--selftest/conf/resources.conf4
-rwxr-xr-xselftest/config_test.py2
-rw-r--r--selftest/resource_test.ok8
-rw-r--r--selftest/suite_test.ok4
-rwxr-xr-xselftest/suite_test.py2
-rw-r--r--selftest/suite_test/resources.conf4
-rwxr-xr-xselftest/template_test.py2
7 files changed, 15 insertions, 11 deletions
diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf
index c17acf5..178e13c 100644
--- a/selftest/conf/resources.conf
+++ b/selftest/conf/resources.conf
@@ -17,7 +17,7 @@ bts:
ipa_unit_id: 5
addr: 10.42.42.115
band: GSM-1800
- trx:
+ trx_list:
- hw_addr: 00:0c:90:32:b5:8a
- label: nanoBTS 1900
@@ -25,7 +25,7 @@ bts:
ipa_unit_id: 1902
addr: 10.42.42.190
band: GSM-1900
- trx:
+ trx_list:
- hw_addr: 00:02:95:00:41:b3
arfcn:
diff --git a/selftest/config_test.py b/selftest/config_test.py
index ce4d939..61ec73a 100755
--- a/selftest/config_test.py
+++ b/selftest/config_test.py
@@ -14,7 +14,7 @@ example_config_file = 'test.cfg'
example_config = os.path.join(_prep.script_dir, 'config_test', example_config_file)
cfg = config.read(example_config)
-pprint.pprint(cfg)
+pprint.pprint(cfg, width=81)
test_schema = {
'modems[].dbus_path': schema.STR,
diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok
index ae31d3b..413e5d0 100644
--- a/selftest/resource_test.ok
+++ b/selftest/resource_test.ok
@@ -51,14 +51,14 @@ ok, caused exception: RuntimeError('Refusing to drop a list of resources from it
'band': 'GSM-1800',
'ipa_unit_id': '5',
'label': 'octBTS 3000',
- 'trx': [{'hw_addr': '00:0c:90:32:b5:8a'}],
+ 'trx_list': [{'hw_addr': '00:0c:90:32:b5:8a'}],
'type': 'oct'},
{'_hash': '0b7fabd512b36aec43d7d496abd00af4e193b0f8',
'addr': '10.42.42.190',
'band': 'GSM-1900',
'ipa_unit_id': '1902',
'label': 'nanoBTS 1900',
- 'trx': [{'hw_addr': '00:02:95:00:41:b3'}],
+ 'trx_list': [{'hw_addr': '00:02:95:00:41:b3'}],
'type': 'nanobts'}],
'modem': [{'_hash': '19c69e45aa090fb511446bd00797690aa82ff52f',
'imsi': '901700000007801',
@@ -168,7 +168,7 @@ ok, caused exception: RuntimeError('Refusing to drop a list of resources from it
band: GSM-1800
ipa_unit_id: '5'
label: octBTS 3000
- trx:
+ trx_list:
- hw_addr: 00:0c:90:32:b5:8a
type: oct
--- (want='modem'): DBG: Looking for 2 x modem , candidates: 16
@@ -209,7 +209,7 @@ bts:
band: GSM-1800
ipa_unit_id: '5'
label: octBTS 3000
- trx:
+ trx_list:
- hw_addr: 00:0c:90:32:b5:8a
type: oct
modem:
diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok
index fe7fbcb..2fad8b3 100644
--- a/selftest/suite_test.ok
+++ b/selftest/suite_test.ok
@@ -16,7 +16,10 @@ resources:
- times: '1'
- run hello world test
+tst test_suite: Suite run start
tst test_suite: reserving resources...
+tst test_suite: DBG: {combining='resources'} [test_suite↪test_suite]
+tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], modem=[{'times': '2'}], nitb_iface=[{'times': '1'}]}} [test_suite↪(combining_scenarios='resources')↪test_suite]
--- (want='bts'): DBG: Looking for 1 x bts , candidates: 3
--- (want='bts'): DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
addr: 10.42.42.114
@@ -48,6 +51,7 @@ tst hello_world.py: PASS [test_suite↪hello_world.py]
pass: all 1 tests passed.
- a test with an error
+tst test_suite: Suite run start [suite.py:191]
tst test_error.py: START [test_suite↪test_error.py] [suite.py:96]
tst test_error.py:3: I am 'test_suite' / 'test_error.py:3' [test_suite↪test_error.py:3] [test_error.py:3]
tst test_error.py:5: FAIL [test_suite↪test_error.py:5] [suite.py:108]
diff --git a/selftest/suite_test.py b/selftest/suite_test.py
index cbbd6be..315c683 100755
--- a/selftest/suite_test.py
+++ b/selftest/suite_test.py
@@ -20,7 +20,7 @@ assert(isinstance(s_def, suite.SuiteDefinition))
print(config.tostr(s_def.conf))
print('- run hello world test')
-s = suite.SuiteRun(None, s_def)
+s = suite.SuiteRun(None, 'test_suite', s_def)
results = s.run_tests('hello_world.py')
print(str(results))
diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf
index c17acf5..178e13c 100644
--- a/selftest/suite_test/resources.conf
+++ b/selftest/suite_test/resources.conf
@@ -17,7 +17,7 @@ bts:
ipa_unit_id: 5
addr: 10.42.42.115
band: GSM-1800
- trx:
+ trx_list:
- hw_addr: 00:0c:90:32:b5:8a
- label: nanoBTS 1900
@@ -25,7 +25,7 @@ bts:
ipa_unit_id: 1902
addr: 10.42.42.190
band: GSM-1900
- trx:
+ trx_list:
- hw_addr: 00:02:95:00:41:b3
arfcn:
diff --git a/selftest/template_test.py b/selftest/template_test.py
index 2b44ae5..31d9e80 100755
--- a/selftest/template_test.py
+++ b/selftest/template_test.py
@@ -19,7 +19,7 @@ mock_timeslot_list=(
)
mock_bts = {
- 'type': 'val_type',
+ 'osmobsc_bts_type': 'val_type',
'band': 'val_band',
'location_area_code': 'val_bts.location_area_code',
'base_station_id_code': 'val_bts.base_station_id_code',