bts_*: Add incrementing bvci and rac values

Change-Id: Ie65d7d33322c775a1040b5c81f367d882a7c2c5b
This commit is contained in:
Pau Espin 2017-11-28 15:50:02 +01:00
parent 05314b4633
commit 8a3a7b5146
10 changed files with 80 additions and 16 deletions

View File

@ -51,9 +51,9 @@ network
ip.access unit_id val_bts.unit_id_bts0 0
oml ip.access stream_id val_bts.stream_id_bts0 line 0
gprs mode gprs
gprs routing area 0
gprs routing area val_bts.routing_area_code_bts0
gprs network-control-order nc1
gprs cell bvci 1800
gprs cell bvci val_bts.bvci_bts0
gprs cell timer blocking-timer 3
gprs cell timer blocking-retries 3
gprs cell timer unblocking-retries 3
@ -65,7 +65,7 @@ network
gprs cell timer resume-retries 3
gprs cell timer capability-update-timer 10
gprs cell timer capability-update-retries 3
gprs nsei 1800
gprs nsei val_bts.bvci_bts0
gprs ns timer tns-block 3
gprs ns timer tns-block-retries 3
gprs ns timer tns-reset 3
@ -73,7 +73,7 @@ network
gprs ns timer tns-test 30
gprs ns timer tns-alive 3
gprs ns timer tns-alive-retries 10
gprs nsvc 0 nsvci 1800
gprs nsvc 0 nsvci val_bts.bvci_bts0
gprs nsvc 0 local udp port 23020
gprs nsvc 0 remote udp port 23000
gprs nsvc 0 remote ip val_bts.sgsn_ip_addr_bts0
@ -122,9 +122,9 @@ network
ip.access unit_id val_bts.unit_id_bts1 0
oml ip.access stream_id val_bts.stream_id_bts1 line 0
gprs mode gprs
gprs routing area 0
gprs routing area val_bts.routing_area_code_bts1
gprs network-control-order nc1
gprs cell bvci 1800
gprs cell bvci val_bts.bvci_bts1
gprs cell timer blocking-timer 3
gprs cell timer blocking-retries 3
gprs cell timer unblocking-retries 3
@ -136,7 +136,7 @@ network
gprs cell timer resume-retries 3
gprs cell timer capability-update-timer 10
gprs cell timer capability-update-retries 3
gprs nsei 1800
gprs nsei val_bts.bvci_bts1
gprs ns timer tns-block 3
gprs ns timer tns-block-retries 3
gprs ns timer tns-reset 3
@ -144,7 +144,7 @@ network
gprs ns timer tns-test 30
gprs ns timer tns-alive 3
gprs ns timer tns-alive-retries 10
gprs nsvc 0 nsvci 1800
gprs nsvc 0 nsvci val_bts.bvci_bts1
gprs nsvc 0 local udp port 23020
gprs nsvc 0 remote udp port 23000
gprs nsvc 0 remote ip val_bts.sgsn_ip_addr_bts1

View File

@ -22,7 +22,9 @@ mock_bts = {
'osmobsc_bts_type': 'val_type',
'band': 'val_band',
'location_area_code': 'val_bts.location_area_code',
'routing_area_code': 'val_bts.routing_area_code',
'cell_identity': 'val_bts.cell_identity',
'bvci': 'val_bts.bvci',
'base_station_id_code': 'val_bts.base_station_id_code',
'ipa_unit_id': 'val_bts.unit_id',
'stream_id': 'val_bts.stream_id',

View File

@ -32,7 +32,9 @@ class OsmoBtsOctphy(log.Origin):
pcu_sk_tmp_dir = None
values = None
lac = None
rac = None
cellid = None
bvci = None
proc_bts = None
_pcu = None
@ -169,8 +171,12 @@ class OsmoBtsOctphy(log.Origin):
config.overlay(values, config.get_defaults('osmo_bts_octphy'))
if self.lac is not None:
config.overlay(values, { 'location_area_code': self.lac })
if self.rac is not None:
config.overlay(values, { 'routing_area_code': self.rac })
if self.cellid is not None:
config.overlay(values, { 'cell_identity': self.cellid })
if self.bvci is not None:
config.overlay(values, { 'bvci': self.bvci })
config.overlay(values, self.conf)
sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client()
@ -193,7 +199,13 @@ class OsmoBtsOctphy(log.Origin):
def set_lac(self, lac):
self.lac = lac
def set_rac(self, rac):
self.rac = rac
def set_cellid(self, cellid):
self.cellid = cellid
def set_bvci(self, bvci):
self.bvci = bvci
# vim: expandtab tabstop=4 shiftwidth=4

View File

@ -32,7 +32,9 @@ class OsmoBtsTrx(log.Origin):
trx = None
pcu_sk_tmp_dir = None
lac = None
rac = None
cellid = None
bvci = None
proc_bts = None
_pcu = None
@ -147,8 +149,12 @@ class OsmoBtsTrx(log.Origin):
config.overlay(values, config.get_defaults('osmo_bts_trx'))
if self.lac is not None:
config.overlay(values, { 'location_area_code': self.lac })
if self.rac is not None:
config.overlay(values, { 'routing_area_code': self.rac })
if self.cellid is not None:
config.overlay(values, { 'cell_identity': self.cellid })
if self.bvci is not None:
config.overlay(values, { 'bvci': self.bvci })
config.overlay(values, self.conf)
sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client()
@ -171,9 +177,15 @@ class OsmoBtsTrx(log.Origin):
def set_lac(self, lac):
self.lac = lac
def set_rac(self, rac):
self.rac = rac
def set_cellid(self, cellid):
self.cellid = cellid
def set_bvci(self, bvci):
self.bvci = bvci
class OsmoTrx(log.Origin):
suite_run = None
run_dir = None

View File

@ -31,7 +31,9 @@ class SysmoBts(log.Origin):
remote_env = None
remote_dir = None
lac = None
rac = None
cellid = None
bvci = None
proc_bts = None
_pcu = None
@ -166,8 +168,12 @@ class SysmoBts(log.Origin):
config.overlay(values, config.get_defaults('osmo_bts_sysmo'))
if self.lac is not None:
config.overlay(values, { 'location_area_code': self.lac })
if self.rac is not None:
config.overlay(values, { 'routing_area_code': self.rac })
if self.cellid is not None:
config.overlay(values, { 'cell_identity': self.cellid })
if self.bvci is not None:
config.overlay(values, { 'bvci': self.bvci })
config.overlay(values, self.conf)
sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client()
@ -190,7 +196,13 @@ class SysmoBts(log.Origin):
def set_lac(self, lac):
self.lac = lac
def set_rac(self, rac):
self.rac = rac
def set_cellid(self, cellid):
self.cellid = cellid
def set_bvci(self, bvci):
self.bvci = bvci
# vim: expandtab tabstop=4 shiftwidth=4

View File

@ -215,9 +215,16 @@ class ResourcesPool(log.Origin):
# LAC=0 has special meaning (MS detached), avoid it
return self.next_persistent_value('lac', '1', schema.uint16, lambda x: str(((int(x)+1) % pow(2,16)) or 1), origin)
def next_rac(self, origin):
return self.next_persistent_value('rac', '1', schema.uint8, lambda x: str((int(x)+1) % pow(2,8) or 1), origin)
def next_cellid(self, origin):
return self.next_persistent_value('cellid', '1', schema.uint16, lambda x: str((int(x)+1) % pow(2,16)), origin)
def next_bvci(self, origin):
# BVCI=0 and =1 are reserved, avoid them.
return self.next_persistent_value('bvci', '2', schema.uint16, lambda x: str(int(x)+1) if int(x) < pow(2,16) - 1 else '2', origin)
class NoResourceExn(log.Error):
pass

View File

@ -71,6 +71,13 @@ def uint(val):
if n < 0:
raise ValueError('Positive value expected instead of %d' % n)
def uint8(val):
n = int(val)
if n < 0:
raise ValueError('Positive value expected instead of %d' % n)
if n > 255: # 2^8 - 1
raise ValueError('Value %d too big, max value is 255' % n)
def uint16(val):
n = int(val)
if n < 0:

View File

@ -268,7 +268,9 @@ class SuiteRun(log.Origin):
def bts(self, specifics=None):
bts = bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics))
bts.set_lac(self.lac())
bts.set_rac(self.rac())
bts.set_cellid(self.cellid())
bts.set_bvci(self.bvci())
self.register_for_cleanup(bts)
return bts
@ -300,11 +302,21 @@ class SuiteRun(log.Origin):
self.log('using LAC', lac)
return lac
def rac(self):
rac = self.resources_pool.next_rac(self)
self.log('using RAC', rac)
return rac
def cellid(self):
cellid = self.resources_pool.next_cellid(self)
self.log('using CellId', cellid)
return cellid
def bvci(self):
bvci = self.resources_pool.next_bvci(self)
self.log('using BVCI', bvci)
return bvci
def poll(self):
if self._processes:
for process in self._processes:

View File

@ -61,9 +61,9 @@ network
oml ip.access stream_id ${bts.stream_id} line 0
% if bts.get('sgsn', False):
gprs mode gprs
gprs routing area 0
gprs routing area ${bts.routing_area_code}
gprs network-control-order nc1
gprs cell bvci 1800
gprs cell bvci ${bts.bvci}
gprs cell timer blocking-timer 3
gprs cell timer blocking-retries 3
gprs cell timer unblocking-retries 3
@ -75,7 +75,7 @@ network
gprs cell timer resume-retries 3
gprs cell timer capability-update-timer 10
gprs cell timer capability-update-retries 3
gprs nsei 1800
gprs nsei ${bts.bvci}
gprs ns timer tns-block 3
gprs ns timer tns-block-retries 3
gprs ns timer tns-reset 3
@ -83,7 +83,7 @@ network
gprs ns timer tns-test 30
gprs ns timer tns-alive 3
gprs ns timer tns-alive-retries 10
gprs nsvc 0 nsvci 1800
gprs nsvc 0 nsvci ${bts.bvci}
gprs nsvc 0 local udp port 23020
gprs nsvc 0 remote udp port 23000
gprs nsvc 0 remote ip ${bts.sgsn.ip_address.addr}

View File

@ -51,9 +51,9 @@ network
oml ip.access stream_id ${bts.stream_id} line 0
% if bts.get('sgsn', False):
gprs mode gprs
gprs routing area 0
gprs routing area ${bts.routing_area_code}
gprs network-control-order nc1
gprs cell bvci 1800
gprs cell bvci ${bts.bvci}
gprs cell timer blocking-timer 3
gprs cell timer blocking-retries 3
gprs cell timer unblocking-retries 3
@ -65,7 +65,7 @@ network
gprs cell timer resume-retries 3
gprs cell timer capability-update-timer 10
gprs cell timer capability-update-retries 3
gprs nsei 1800
gprs nsei ${bts.bvci}
gprs ns timer tns-block 3
gprs ns timer tns-block-retries 3
gprs ns timer tns-reset 3
@ -73,7 +73,7 @@ network
gprs ns timer tns-test 30
gprs ns timer tns-alive 3
gprs ns timer tns-alive-retries 10
gprs nsvc 0 nsvci 1800
gprs nsvc 0 nsvci ${bts.bvci}
gprs nsvc 0 local udp port 23020
gprs nsvc 0 remote udp port 23000
gprs nsvc 0 remote ip ${bts.sgsn.ip_address.addr}