summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-09-14 13:52:28 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-09-14 14:28:56 +0200
commit29e456787bb11f139db6bd065516c2d7c047a31f (patch)
treee615c1fa57d893efc3d411f3f970e8d89e2515ed
parentbc27fd4a7c7c4a65b538b8932c7a341aa2364dcf (diff)
nominal_power and max_power_red attrs can now be set per resource
Before this commit, only max_power_red was specified and it could only be used as a defaults and could not be set per object. Together with nominal_power, it can be useful to be able to set them to different values for different objects, as for example different osmo-bts-trx objects can require different values. Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd
-rw-r--r--example/defaults.conf3
-rw-r--r--selftest/suite_test.ok2
-rw-r--r--selftest/suite_test/resources.conf30
-rw-r--r--selftest/template_test.ok8
-rwxr-xr-xselftest/template_test.py2
-rw-r--r--src/osmo_gsm_tester/resource.py2
-rw-r--r--src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl2
-rw-r--r--src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl2
8 files changed, 43 insertions, 8 deletions
diff --git a/example/defaults.conf b/example/defaults.conf
index 082f159..f6ecedd 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -33,7 +33,8 @@ bsc_bts:
stream_id: 255
osmobsc_bts_type: sysmobts
trx_list:
- - max_power_red: 0
+ - nominal_power: 23
+ max_power_red: 0
arfcn: 868
timeslot_list:
- phys_chan_config: CCCH+SDCCH4
diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok
index 2808474..049f7b4 100644
--- a/selftest/suite_test.ok
+++ b/selftest/suite_test.ok
@@ -31,7 +31,7 @@ trial test_suite
tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ...
tst test_suite: DBG: {combining='resources'}
tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite↪{combining_scenarios='resources'}]
-tst test_suite: Reserving 1 x bts (candidates: 3)
+tst test_suite: Reserving 1 x bts (candidates: 6)
tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
addr: 10.42.42.114
band: GSM-1800
diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf
index 2005590..001d286 100644
--- a/selftest/suite_test/resources.conf
+++ b/selftest/suite_test/resources.conf
@@ -28,6 +28,36 @@ bts:
trx_list:
- hw_addr: 00:02:95:00:41:b3
+- label: Ettus B200
+ type: osmo-bts-trx
+ ipa_unit_id: 6
+ addr: 10.42.42.52
+ band: GSM-1800
+ launch_trx: true
+ trx_list:
+ - nominal_power: 10
+ - nominal_power: 12
+
+- label: sysmoCell 5000
+ type: osmo-bts-trx
+ ipa_unit_id: 7
+ addr: 10.42.42.53
+ band: GSM-1800
+ trx_remote_ip: 10.42.42.112
+ trx_list:
+ - nominal_power: 10
+ - nominal_power: 12
+
+- label: sysmoCell 5000
+ type: osmo-bts-trx
+ ipa_unit_id: 7
+ addr: 10.42.42.53
+ band: GSM-1800
+ trx_remote_ip: 10.42.42.112
+ trx_list:
+ - nominal_power: 10
+ - nominal_power: 12
+
arfcn:
- arfcn: 512
band: GSM-1800
diff --git a/selftest/template_test.ok b/selftest/template_test.ok
index 5af4b6a..5bd32a4 100644
--- a/selftest/template_test.ok
+++ b/selftest/template_test.ok
@@ -54,7 +54,7 @@ network
trx 0
rf_locked 0
arfcn val_trx_arfcn_trx0
- nominal power 23
+ nominal power val_trx_nominal_power_trx0
max_power_red val_trx_max_power_red_trx0
rsl e1 tei 0
timeslot 0
@@ -68,7 +68,7 @@ network
trx 1
rf_locked 0
arfcn val_trx_arfcn_trx1
- nominal power 23
+ nominal power val_trx_nominal_power_trx1
max_power_red val_trx_max_power_red_trx1
rsl e1 tei 0
timeslot 0
@@ -98,7 +98,7 @@ network
trx 0
rf_locked 0
arfcn val_trx_arfcn_trx0
- nominal power 23
+ nominal power val_trx_nominal_power_trx0
max_power_red val_trx_max_power_red_trx0
rsl e1 tei 0
timeslot 0
@@ -112,7 +112,7 @@ network
trx 1
rf_locked 0
arfcn val_trx_arfcn_trx1
- nominal power 23
+ nominal power val_trx_nominal_power_trx1
max_power_red val_trx_max_power_red_trx1
rsl e1 tei 0
timeslot 0
diff --git a/selftest/template_test.py b/selftest/template_test.py
index f8c32a5..769df49 100755
--- a/selftest/template_test.py
+++ b/selftest/template_test.py
@@ -27,9 +27,11 @@ mock_bts = {
'stream_id': 'val_bts.stream_id',
'trx_list': (
dict(arfcn='val_trx_arfcn_trx0',
+ nominal_power='val_trx_nominal_power_trx0',
max_power_red='val_trx_max_power_red_trx0',
timeslot_list=mock_timeslot_list),
dict(arfcn='val_trx_arfcn_trx1',
+ nominal_power='val_trx_nominal_power_trx1',
max_power_red='val_trx_max_power_red_trx1',
timeslot_list=mock_timeslot_list),
)
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 8f34bdb..5315f18 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -58,6 +58,8 @@ RESOURCES_SCHEMA = {
'bts[].launch_trx': schema.BOOL_STR,
'bts[].trx_list[].hw_addr': schema.HWADDR,
'bts[].trx_list[].net_device': schema.STR,
+ 'bts[].trx_list[].nominal_power': schema.INT,
+ 'bts[].trx_list[].max_power_red': schema.INT,
'arfcn[].arfcn': schema.INT,
'arfcn[].band': schema.BAND,
'modem[].label': schema.STR,
diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
index 57ab8a3..14aa62d 100644
--- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
@@ -61,7 +61,7 @@ network
trx ${loop.index}
rf_locked 0
arfcn ${trx.arfcn}
- nominal power 23
+ nominal power ${trx.nominal_power}
max_power_red ${trx.max_power_red}
rsl e1 tei 0
% for ts in trx.timeslot_list:
diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
index d2927f9..fbafc8e 100644
--- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
@@ -54,7 +54,7 @@ network
trx ${loop.index}
rf_locked 0
arfcn ${trx.arfcn}
- nominal power 23
+ nominal power ${trx.nominal_power}
max_power_red ${trx.max_power_red}
rsl e1 tei 0
% for ts in trx.timeslot_list: