Commit ce3d4ee0 authored by Kirill Smelkov's avatar Kirill Smelkov

X test + fix for generic primary RU/CELL parameters publish

- switch published *arfcn types to numbers from strings
- tx_gain value was used when publishing rx_gain
parent ebbebbf2
...@@ -36,7 +36,7 @@ md5sum = d2fe2fbe70c6824c514a7c4034a2ddb3 ...@@ -36,7 +36,7 @@ md5sum = d2fe2fbe70c6824c514a7c4034a2ddb3
[ru_libinstance.jinja2.cfg] [ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg _update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = 1a14718cd3c19380d32dd37d27577ed7 md5sum = 803d273588bf930aa528f25a0b990804
[ru_sdr_libinstance.jinja2.cfg] [ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg _update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
......
...@@ -249,9 +249,9 @@ cell-list = {{ dumps(iru_icell_ref_list) }} ...@@ -249,9 +249,9 @@ cell-list = {{ dumps(iru_icell_ref_list) }}
{%- if ru.ru_link_type == 'cpri' %} {%- if ru.ru_link_type == 'cpri' %}
ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway} ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway}
{%- endif %} {%- endif %}
tx_gain = {{ ru.tx_gain }} tx_gain = {{ dumps(ru.tx_gain) }}
rx_gain = {{ ru.tx_gain }} rx_gain = {{ dumps(ru.rx_gain) }}
txrx_active = {{ ru.txrx_active }} txrx_active = {{ dumps(ru.txrx_active) }}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
...@@ -302,14 +302,14 @@ recipe = slapos.cookbook:publish.serialised ...@@ -302,14 +302,14 @@ recipe = slapos.cookbook:publish.serialised
{{ slap_configuration['slap-software-type'] }} = {{ dumps(root) }} {{ slap_configuration['slap-software-type'] }} = {{ dumps(root) }}
ru = {{ dumps(ru_ref) }} ru = {{ dumps(ru_ref) }}
{%- if cell.cell_type == 'lte' %} {%- if cell.cell_type == 'lte' %}
band = b{{ xearfcn_module.band(cell.dl_earfcn)[0].band }} band = {{ dumps('b%d' % xearfcn_module.band(cell.dl_earfcn)[0].band) }}
dl_earfcn = {{ cell.dl_earfcn }} dl_earfcn = {{ dumps(cell.dl_earfcn) }}
ul_earfcn = {{ cell.ul_earfcn }} ul_earfcn = {{ dumps(cell.ul_earfcn) }}
{%- elif cell.cell_type == 'nr' %} {%- elif cell.cell_type == 'nr' %}
band = n{{ cell.nr_band }} band = {{ dumps('n%d' % cell.nr_band) }}
dl_nr_arfcn = {{ cell.dl_nr_arfcn }} dl_nr_arfcn = {{ dumps(cell.dl_nr_arfcn) }}
ul_nr_arfcn = {{ cell.ul_nr_arfcn }} ul_nr_arfcn = {{ dumps(cell.ul_nr_arfcn) }}
ssb_nr_arfcn= {{ cell.ssb_nr_arfcn }} ssb_nr_arfcn= {{ dumps(cell.ssb_nr_arfcn) }}
{%- else %} {%- else %}
{%- do bug('unreachable') %} {%- do bug('unreachable') %}
{%- endif %} {%- endif %}
......
...@@ -163,14 +163,35 @@ class AmariTestCase(_AmariTestCase): ...@@ -163,14 +163,35 @@ class AmariTestCase(_AmariTestCase):
# requestShared requests one shared instance over imain with specified subreference and parameters. # requestShared requests one shared instance over imain with specified subreference and parameters.
@classmethod @classmethod
def requestShared(cls, imain, subref, ctx): def requestShared(cls, imain, subref, ctx):
cls.slap.request( ref = cls.ref(subref)
kw = dict(
software_release=cls.getSoftwareURL(), software_release=cls.getSoftwareURL(),
software_type=cls.getInstanceSoftwareType(), software_type=cls.getInstanceSoftwareType(),
partition_reference=cls.ref(subref), partition_reference=ref,
# XXX StandaloneSlapOS rejects filter_kw with "Can only request on embedded computer" # XXX StandaloneSlapOS rejects filter_kw with "Can only request on embedded computer"
#filter_kw = {'instance_guid': imain.getInstanceGuid()}, #filter_kw = {'instance_guid': imain.getInstanceGuid()},
partition_parameter_kw={'_': json.dumps(ctx)}, partition_parameter_kw={'_': json.dumps(ctx)},
shared=True) 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
# queryPiblished and querySharedPublished return information published by
# an instance / shared instance correspondingly.
@classmethod
def querySharedPublished(cls, subref):
return cls.queryPiblished(cls.ref(subref))
@classmethod
def queryPiblished(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. # ref returns full reference of shared instance with given subreference.
# #
...@@ -225,7 +246,7 @@ class RFTestCase4(AmariTestCase): ...@@ -225,7 +246,7 @@ class RFTestCase4(AmariTestCase):
ru = cls.RUcfg(i) ru = cls.RUcfg(i)
ru |= {'n_antenna_dl': 4, 'n_antenna_ul': 2} ru |= {'n_antenna_dl': 4, 'n_antenna_ul': 2}
ru |= {'tx_gain': 10+i, 'rx_gain': 20+i, 'txrx_active': 'ACTIVE'} ru |= {'tx_gain': 10+i, 'rx_gain': 20+i, 'txrx_active': 'ACTIVE'}
cls.requestShared(imain, 'RU%d' % i, ru) return cls.requestShared(imain, 'RU%d' % i, ru)
def CELL(i, ctx): def CELL(i, ctx):
cell = { cell = {
...@@ -236,7 +257,7 @@ class RFTestCase4(AmariTestCase): ...@@ -236,7 +257,7 @@ class RFTestCase4(AmariTestCase):
} }
cell |= cls.CELLcfg(i) cell |= cls.CELLcfg(i)
cell |= ctx cell |= ctx
cls.requestShared(imain, 'RU%d.CELL' % i, cell) return cls.requestShared(imain, 'RU%d.CELL' % i, cell)
RU(1); CELL(1, FDD | LTE( 100) | BW( 5)) RU(1); CELL(1, FDD | LTE( 100) | BW( 5))
RU(2); CELL(2, TDD | LTE( 40200) | BW(10)) RU(2); CELL(2, TDD | LTE( 40200) | BW(10))
...@@ -251,6 +272,26 @@ class RFTestCase4(AmariTestCase): ...@@ -251,6 +272,26 @@ class RFTestCase4(AmariTestCase):
t.assertEqual(t.rf_cfg['tx_gain'], [11]*4 + [12]*4 + [13]*4 + [14]*4) t.assertEqual(t.rf_cfg['tx_gain'], [11]*4 + [12]*4 + [13]*4 + [14]*4)
t.assertEqual(t.rf_cfg['rx_gain'], [21]*2 + [22]*2 + [23]*2 + [24]*2) t.assertEqual(t.rf_cfg['rx_gain'], [21]*2 + [22]*2 + [23]*2 + [24]*2)
def test_published_ru_and_cell(t):
q = t.querySharedPublished
assertMatch(t, q('RU1'), {'tx_gain': 11, 'rx_gain': 21, 'txrx_active': 'ACTIVE'})
assertMatch(t, q('RU2'), {'tx_gain': 12, 'rx_gain': 22, 'txrx_active': 'ACTIVE'})
assertMatch(t, q('RU3'), {'tx_gain': 13, 'rx_gain': 23, 'txrx_active': 'ACTIVE'})
assertMatch(t, q('RU4'), {'tx_gain': 14, 'rx_gain': 24, 'txrx_active': 'ACTIVE'})
assertMatch(t, q('RU1.CELL'), dict(band='b1',
dl_earfcn= 100, ul_earfcn=18100,
dl_nr_arfcn=NO, ul_nr_arfcn=NO, ssb_nr_arfcn=NO))
assertMatch(t, q('RU2.CELL'), dict(band='b41',
dl_earfcn=40200, ul_earfcn=40200,
dl_nr_arfcn=NO, ul_nr_arfcn=NO, ssb_nr_arfcn=NO))
assertMatch(t, q('RU3.CELL'), dict(band='n74',
dl_earfcn=NO, ul_earfcn=NO,
dl_nr_arfcn=300300, ul_nr_arfcn=290700, ssb_nr_arfcn=300270))
assertMatch(t, q('RU4.CELL'), dict(band='n40',
dl_earfcn=NO, ul_earfcn=NO,
dl_nr_arfcn=470400, ul_nr_arfcn=470400, ssb_nr_arfcn=470430))
# ENBTestCase4 provides base class for unit-testing eNB service. # ENBTestCase4 provides base class for unit-testing eNB service.
# #
...@@ -664,7 +705,7 @@ class UEsimTestCase4(RFTestCase4): ...@@ -664,7 +705,7 @@ class UEsimTestCase4(RFTestCase4):
'k': 'FFFF%028x' % i, 'k': 'FFFF%028x' % i,
'impi': 'impi%d@rapid.space' % i, 'impi': 'impi%d@rapid.space' % i,
} }
cls.requestShared(imain, 'UE%d' % i, ue) return cls.requestShared(imain, 'UE%d' % i, ue)
UE(1) UE(1)
UE(2) UE(2)
......
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