Commit e35d1d40 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb/generic: Publish information about a cell on the cell shared instance

Instead of publishing it on enb with prefixing by cell reference. It is more
logical to have cell input parameters on the cell instance and also have output
parameters about that cell published on that same instance.

For now it is all only what was input. But in the next patches we'll extend set
of published information with also computed things, so it won't remain trivial.
parent 97ecce86
......@@ -271,12 +271,15 @@ ru = {{ dumps(ru ) }}
{#- publish information about the cell (skipping synthetic) #}
{%- if icell.slave_reference %}
[publish-connection-information]
{{ part('ipublish-%s' % cell_ref) }}
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ dumps(icell.slave_reference) }}
{{ slap_configuration['slap-software-type'] }} = {{ dumps(root) }}
{%- if cell.cell_type == 'lte' %}
{{B(cell_ref)}}-dl_earfcn = {{ dumps(cell.dl_earfcn) }}
dl_earfcn = {{ dumps(cell.dl_earfcn) }}
{%- elif cell.cell_type == 'nr' %}
{{B(cell_ref)}}-band = {{ dumps('n%d' % cell.nr_band) }}
{{B(cell_ref)}}-dl_nr_arfcn = {{ dumps(cell.dl_nr_arfcn) }}
band = {{ dumps('n%d' % cell.nr_band) }}
dl_nr_arfcn = {{ dumps(cell.dl_nr_arfcn) }}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
......
......@@ -167,8 +167,26 @@ class AmariTestCase(_AmariTestCase):
#filter_kw = {'instance_guid': imain.getInstanceGuid()},
partition_parameter_kw={'_': json.dumps(ctx)},
shared=True)
cls._requested[ref] = kw
return cls.slap.request(**kw)
# XXX StandaloneSlapOS lacks getInformation - we remember the way instances are requested ourselves.
_requested = {} # ref -> kw used for slap.request
# queryPublished and querySharedPublished return information published by
# an instance / shared instance correspondingly.
@classmethod
def querySharedPublished(cls, subref):
return cls.queryPublished(cls.ref(subref))
@classmethod
def queryPublished(cls, ref):
# see ^^^ about lack of getInformation on StandaloneSlapOS
#inst = cls.slap.getInformation(computer_partition=ref)
inst = cls.slap.request(**cls._requested[ref])
iconn = inst.getConnectionParameterDict()
return json.loads(iconn['_'])
# ref returns full reference of shared instance with given subreference.
#
......@@ -238,6 +256,22 @@ class RFTestCase4(AmariTestCase):
RU(3); CELL(3, FDD | NR (300300,74) | BW(15))
RU(4); CELL(4, TDD | NR (470400,40) | BW(20))
def test_published_cell(t):
q = t.querySharedPublished
assertMatch(t, q('RU1.CELL'), dict(
dl_earfcn= 100,
dl_nr_arfcn=NO))
assertMatch(t, q('RU2.CELL'), dict(
dl_earfcn=40200,
dl_nr_arfcn=NO))
assertMatch(t, q('RU3.CELL'), dict(band='n74',
dl_earfcn=NO,
dl_nr_arfcn=300300))
assertMatch(t, q('RU4.CELL'), dict(band='n40',
dl_earfcn=NO,
dl_nr_arfcn=470400))
# ENBTestCase4 provides base class for unit-testing eNB service.
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment