# The Jenkins job uses this string for the tag in the image name
# for example nexus3.o-ran-sc.org:10004/my-image-name:my-tag
---
-tag: 1.0.5
+tag: 1.0.6
:depth: 3
:local:
+
+Version bumping the Xapp
+------------------------
+
+This project follows semver. When changes are made, update the version strings in:
+
+#. ``container-tag.yaml``
+#. ``docs/release-notes.rst``
+#. ``setup.py``
+
+
Testing RMR Healthcheck
-----------------------
The following instructions should deploy the QP Driver container in bare docker, and allow you
and this project adheres to `Semantic Versioning <http://semver.org/>`__.
+[1.0.6] - 2020-05-12
+--------------------
+* Decode values from SDL as JSON (`RICAPP-104 <https://jira.o-ran-sc.org/browse/RICAPP-104>`_)
+
+
[1.0.5] - 2020-05-08
--------------------
-"""
-qpdriver module responsible for SDL queries and data merging
-"""
# ==================================================================================
# Copyright (c) 2020 AT&T Intellectual Property.
#
# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================
+
+"""
+qpdriver module responsible for SDL queries and data merging
+"""
+import json
from qpdriver.exceptions import UENotFound
# namespaces
Note that a single request to qp driver may have many UEs in a list, however since a new message needs to be sent for each one,
the calling function iterates over that list, rather than doing it here.
"""
- ue_data = xapp_ref.sdl_get(UE_NS, ueid, usemsgpack=False)
- if not ue_data:
+ ue_data_bytes = xapp_ref.sdl_get(UE_NS, ueid, usemsgpack=False)
+ if not ue_data_bytes:
raise UENotFound()
+ # input should be a json encoded as bytes
+ ue_data = json.loads(ue_data_bytes.decode())
serving_cid = ue_data["ServingCellID"]
# form the Cell Measurements
for cid in cell_ids:
- cellm = xapp_ref.sdl_get(CELL_NS, cid, usemsgpack=False)
+ cellm_bytes = xapp_ref.sdl_get(CELL_NS, cid, usemsgpack=False)
+
+ if cellm_bytes: # if None, then we omit that cell from this array
- if cellm: # if cellm is None, then we omit that cell from this array
+ # input should be a json encoded as bytes
+ cellm = json.loads(cellm_bytes.decode())
- # if we were really under performance strain here we could delete from the orig instead of copying but this code is far simpler
+ # if we were really under performance strain here we could delete
+ # from the orig instead of copying but this code is far simpler
cell_data = {k: cellm[k] for k in CELL_KEY_LIST}
# these keys get dropped into *each* cell
setup(
name="qpdriver",
- version="1.0.5",
+ version="1.0.6",
packages=find_packages(exclude=["tests.*", "tests"]),
author="Tommy Carpenter",
description="QP Driver Xapp for traffic steering",
"""
these tests are not currently parallelizable (do not use this tox flag)
I would use setup_module, however that can't take monkeypatch fixtures
- Currently looking for the best way to make this better: https://stackoverflow.com/questions/60886013/python-monkeypatch-in-pytest-setup-module
+ Currently looking for the best way to make this better:
+ https://stackoverflow.com/questions/60886013/python-monkeypatch-in-pytest-setup-module
"""
def test_init_xapp(monkeypatch, ue_metrics, cell_metrics_1, cell_metrics_2, cell_metrics_3, ue_metrics_with_bad_cell):
# monkeypatch post_init to set the data we want in SDL
+ # the metrics arguments are JSON (dict) objects
def fake_post_init(self):
self.def_hand_called = 0
self.traffic_steering_requests = 0
- self.sdl_set(data.UE_NS, "12345", ue_metrics, usemsgpack=False)
- self.sdl_set(data.UE_NS, "8675309", ue_metrics_with_bad_cell, usemsgpack=False)
- self.sdl_set(data.CELL_NS, "310-680-200-555001", cell_metrics_1, usemsgpack=False)
- self.sdl_set(data.CELL_NS, "310-680-200-555002", cell_metrics_2, usemsgpack=False)
- self.sdl_set(data.CELL_NS, "310-680-200-555003", cell_metrics_3, usemsgpack=False)
+ self.sdl_set(data.UE_NS, "12345", json.dumps(ue_metrics).encode(), usemsgpack=False)
+ self.sdl_set(data.UE_NS, "8675309", json.dumps(ue_metrics_with_bad_cell).encode(), usemsgpack=False)
+ self.sdl_set(data.CELL_NS, "310-680-200-555001", json.dumps(cell_metrics_1).encode(), usemsgpack=False)
+ self.sdl_set(data.CELL_NS, "310-680-200-555002", json.dumps(cell_metrics_2).encode(), usemsgpack=False)
+ self.sdl_set(data.CELL_NS, "310-680-200-555003", json.dumps(cell_metrics_3).encode(), usemsgpack=False)
# patch
monkeypatch.setattr("qpdriver.main.post_init", fake_post_init)
def test_rmr_flow(monkeypatch, qpd_to_qp, qpd_to_qp_bad_cell):
"""
this flow mocks out the xapps on both sides of QP driver.
- It first stands up a mock qp predictor, then it starts up a mock traffic steering which will immediately send requests to the running qp driver]
+ It first stands up a mock qp predictor, then it starts up a
+ mock traffic steering which will immediately send requests
+ to the running qp driver]
"""
expected_result = {}