# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================
-from os.path import dirname, abspath, join as path_join
from setuptools import setup, find_packages
-SETUP_DIR = abspath(dirname(__file__))
-
-
-def _long_descr():
- """Yields the content of documentation files for the long description"""
- try:
- doc_path = path_join(SETUP_DIR, "docs/overview.rst")
- with open(doc_path) as f:
- return f.read()
- except FileNotFoundError: # this happens during unit testing, we don't need it
- return ""
-
-
setup(
name="qpdriver",
- version="0.0.1",
+ version="0.0.2",
packages=find_packages(exclude=["tests.*", "tests"]),
author="Tommy Carpenter",
description="QP Driver Xapp for traffic steering",
url="https://gerrit.o-ran-sc.org/r/admin/repos/ric-app/qp-driver",
- install_requires=["ricxappframe>=0.4.0"],
+ install_requires=["ricxappframe>=0.6.0"],
entry_points={"console_scripts": ["start.py=qpdriver.main:start"]}, # adds a magical entrypoint for Docker
- classifiers=[
- "Development Status :: 4 - Beta",
- "Intended Audience :: Telecommunications Industry",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.7",
- "License :: OSI Approved :: Apache Software License",
- "Operating System :: POSIX :: Linux",
- "Topic :: Communications",
- ],
- python_requires=">=3.7",
- keywords="RIC xapp",
license="Apache 2.0",
data_files=[("", ["LICENSE.txt"])],
- long_description=_long_descr(),
- long_description_content_type="text/x-rst",
)
--- /dev/null
+import pytest
+
+
+@pytest.fixture
+def ue_metrics():
+ return {
+ "UEID": 12345,
+ "ServingCellID": "310-680-200-555002",
+ "MeasTimestampUEPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodUEPDCPBytes": 20,
+ "UEPDCPBytesDL": 250000,
+ "UEPDCPBytesUL": 100000,
+ "MeasTimestampUEPRBUsage": "2020-03-18 02:23:18.220",
+ "MeasPeriodUEPRBUsage": 20,
+ "UEPRBUsageDL": 10,
+ "UEPRBUsageUL": 30,
+ "MeasTimestampRF": "2020-03-18 02:23:18.210",
+ "MeasPeriodRF": 40,
+ "ServingCellRF": {"RSRP": -115, "RSRQ": -16, "RSSINR": -5},
+ "NeighborCellRF": [
+ {"CID": "310-680-200-555001", "CellRF": {"RSRP": -90, "RSRQ": -13, "RSSINR": -2.5}},
+ {"CID": "310-680-200-555003", "CellRF": {"RSRP": -140, "RSRQ": -17, "RSSINR": -6}},
+ ],
+ }
+
+
+@pytest.fixture
+def cell_metrics_1():
+ return {
+ "CellID": "310-680-200-555001",
+ "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodPDCPBytes": 20,
+ "PDCPBytesDL": 2000000,
+ "PDCPBytesUL": 1200000,
+ "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
+ "MeasPeriodAvailPRB": 20,
+ "AvailPRBDL": 30,
+ "AvailPRBUL": 50,
+ }
+
+
+@pytest.fixture
+def cell_metrics_2():
+ return {
+ "CellID": "310-680-200-555002",
+ "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodPDCPBytes": 20,
+ "PDCPBytesDL": 800000,
+ "PDCPBytesUL": 400000,
+ "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
+ "MeasPeriodAvailPRB": 20,
+ "AvailPRBDL": 30,
+ "AvailPRBUL": 45,
+ }
+
+
+@pytest.fixture
+def cell_metrics_3():
+ return {
+ "CellID": "310-680-200-555003",
+ "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodPDCPBytes": 20,
+ "PDCPBytesDL": 1900000,
+ "PDCPBytesUL": 1000000,
+ "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
+ "MeasPeriodAvailPRB": 20,
+ "AvailPRBDL": 60,
+ "AvailPRBUL": 80,
+ }
+
+
+@pytest.fixture
+def qpd_to_qp():
+ return {
+ "PredictionUE": 12345,
+ "UEMeasurements": {
+ "ServingCellID": "310-680-200-555002",
+ "MeasTimestampUEPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodUEPDCPBytes": 20,
+ "UEPDCPBytesDL": 250000,
+ "UEPDCPBytesUL": 100000,
+ "MeasTimestampUEPRBUsage": "2020-03-18 02:23:18.220",
+ "MeasPeriodUEPRBUsage": 20,
+ "UEPRBUsageDL": 10,
+ "UEPRBUsageUL": 30,
+ },
+ "CellMeasurements": [
+ {
+ "CellID": "310-680-200-555001",
+ "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodPDCPBytes": 20,
+ "PDCPBytesDL": 2000000,
+ "PDCPBytesUL": 1200000,
+ "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
+ "MeasPeriodAvailPRB": 20,
+ "AvailPRBDL": 30,
+ "AvailPRBUL": 50,
+ "MeasTimestampRF": "2020-03-18 02:23:18.210",
+ "MeasPeriodRF": 40,
+ "RFMeasurements": {"RSRP": -90, "RSRQ": -13, "RSSINR": -2.5},
+ },
+ {
+ "CellID": "310-680-200-555002",
+ "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodPDCPBytes": 20,
+ "PDCPBytesDL": 800000,
+ "PDCPBytesUL": 400000,
+ "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
+ "MeasPeriodAvailPRB": 20,
+ "AvailPRBDL": 30,
+ "AvailPRBUL": 45,
+ "MeasTimestampRF": "2020-03-18 02:23:18.210",
+ "MeasPeriodRF": 40,
+ "RFMeasurements": {"RSRP": -115, "RSRQ": -16, "RSSINR": -5},
+ },
+ {
+ "CellID": "310-680-200-555003",
+ "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
+ "MeasPeriodPDCPBytes": 20,
+ "PDCPBytesDL": 1900000,
+ "PDCPBytesUL": 1000000,
+ "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
+ "MeasPeriodAvailPRB": 20,
+ "AvailPRBDL": 60,
+ "AvailPRBUL": 80,
+ "MeasTimestampRF": "2020-03-18 02:23:18.210",
+ "MeasPeriodRF": 40,
+ "RFMeasurements": {"RSRP": -140, "RSRQ": -17, "RSSINR": -6},
+ },
+ ],
+ }