Skip to content
Snippets Groups Projects
Commit b5aba72a authored by Mohamad Rahhal's avatar Mohamad Rahhal
Browse files

Merged

parent d963dd37
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !249. Comments created here will be created in the context of that merge request.
......@@ -78,6 +78,7 @@ COPY src/nbi/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN python3 -m pip install -r requirements.txt
# Add component files into working directory
WORKDIR /var/teraflow
COPY src/nbi/. nbi/
......@@ -92,5 +93,17 @@ COPY src/slice/client/. slice/client/
RUN mkdir -p /var/teraflow/tests/tools
COPY src/tests/tools/mock_osm/. tests/tools/mock_osm/
# Add component sub-folder for qos_profile
RUN mkdir -p /var/teraflow/qos_profile
WORKDIR /var/teraflow/qos_profile
COPY src/qos_profile/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN python3 -m pip install -r requirements.txt
# Add qos_profile files into working directory
WORKDIR /var/teraflow
COPY src/qos_profile/. qos_profile/
# Start the service
ENTRYPOINT ["python", "-m", "nbi.service"]
This diff is collapsed.
from urllib import response
import requests
BASE_URL = 'http://10.1.7.197/camara/qod/v0'
def test_create_profile():
response = requests.post(f'{BASE_URL}/profiles', json={
"name": "Test Profile",
"description": "This is a test profile",
"status": "ACTIVE",
"targetMinUpstreamRate": {"value": 1000, "unit": "Kbps"},
"maxUpstreamRate": {"value": 5000, "unit": "Kbps"},
"maxUpstreamBurstRate": {"value": 10000, "unit": "Kbps"},
"targetMinDownstreamRate": {"value": 2000, "unit": "Kbps"},
"maxDownstreamRate": {"value": 10000, "unit": "Kbps"},
"maxDownstreamBurstRate": {"value": 20000, "unit": "Kbps"},
"minDuration": {"value": 1, "unit": "hours"},
"maxDuration": {"value": 24, "unit": "hours"},
"priority": 1,
"packetDelayBudget": {"value": 100, "unit": "ms"},
"jitter": {"value": 10, "unit": "ms"},
"packetErrorLossRate": 0.01
})
"qos_profile_id": "f00406f5-8e36-4abc-a0ec-b871c7f062b7",
"name": "QCI_1_voice",
"description": "QoS profile for video streaming",
"status": "ACTIVE",
"targetMinUpstreamRate": {
"value": 10,
"unit": "bps"
},
"maxUpstreamRate": {
"value": 10,
"unit": "bps"
},
"maxUpstreamBurstRate": {
"value": 10,
"unit": "bps"
},
"targetMinDownstreamRate": {
"value": 10,
"unit": "bps"
},
"maxDownstreamRate": {
"value": 10,
"unit": "bps"
},
"maxDownstreamBurstRate": {
"value": 10,
"unit": "bps"
},
"minDuration": {
"value": 12,
"unit": "Minutes"
},
"maxDuration": {
"value": 12,
"unit": "Minutes"
},
"priority": 20,
"packetDelayBudget": {
"value": 12,
"unit": "Minutes"
},
"jitter": {
"value": 12,
"unit": "Minutes"
},
"packetErrorLossRate": 3
}
)
def get_profile():
response=requests.get(f'{BASE_URL}/profile/ProfileDetail')
#def test_delete_profile_by_name():
# response = requests.delete(f'{BASE_URL}/profiles/delete_by_name/Test Profile')
def test_update_profile():
response = requests.put(f'{BASE_URL}/profiles/270a9c75-6a4e-452e-9dc5-804fc0204dcb', json={
"description": "AM UPDATING THIS ",
"name":"test2"
})
def test_delete_profile_by_name():
response = requests.delete(f'{BASE_URL}/profiles/delete_by_name/Test Profile')
def test_create_session():
response = requests.post(f'{BASE_URL}/sessions', json={
"device": {
"phoneNumber": "1234567890",
"networkAccessIdentifier": "nai",
"ipv4Address": {"publicAddress": "84.125.93.10", "publicPort": 59765},
"ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
},
"applicationServer": {
"ipv4Address": "192.168.0.1/24",
"ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
},
"devicePorts": {
"ranges": [{"from": 5010, "to": 5020}],
"ports": [5060, 5070]
},
"applicationServerPorts": {
"ranges": [{"from": 6010, "to": 6020}],
"ports": [6060, 6070]
},
"qosProfile": "Test Profile",
"webhook": {
"notificationUrl": "https://application-server.com",
"notificationAuthToken": "c8974e592c2fa383d4a3960714"
},
"duration": {"value": 1, "unit": "hours"}
})
def test_update_session():
response = requests.put(f'{BASE_URL}/sessions/88c51c03-13bf-4542-b3f2-43a9edccfc95', json={
"duration": {"value": 32, "unit": "hours"}
})
def test_delete_session():
response = requests.delete(f'{BASE_URL}/sessions/e1b53005-ffba-4e66-b7fe-0c5e022d8d7d')
#def test_delete_all_sessions():
#BASE_URL = 'http://10.1.7.197/camara/qod/v0'
#DELETE_ALL_URL = f"{BASE_URL}/sessions/delete_all"
#response = requests.delete(DELETE_ALL_URL)
#def test_delete_all_profiles():
#BASE_URL = 'http://10.1.7.197/camara/qod/v0'
#DELETE_ALL_URL_Profile = f"{BASE_URL}/profiles/delete_all"
#response = requests.delete(DELETE_ALL_URL_Profile)
\ No newline at end of file
#def test_update_profile():
# response = requests.put(f'{BASE_URL}/profiles/270a9c75-6a4e-452e-9dc5-804fc0204dcb', json={
# "description": "AM UPDATING THIS ",
# "name":"test2"
# })
#
#
#
#def test_create_session():
# response = requests.post(f'{BASE_URL}/sessions', json={
# "device": {
# "phoneNumber": "1234567890",
# "networkAccessIdentifier": "nai",
# "ipv4Address": {"publicAddress": "84.125.93.10", "publicPort": 59765},
# "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
# },
# "applicationServer": {
# "ipv4Address": "192.168.0.1/24",
# "ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
# },
# "devicePorts": {
# "ranges": [{"from": 5010, "to": 5020}],
# "ports": [5060, 5070]
# },
# "applicationServerPorts": {
# "ranges": [{"from": 6010, "to": 6020}],
# "ports": [6060, 6070]
# },
# "qosProfile": "Test Profile",
# "webhook": {
# "notificationUrl": "https://application-server.com",
# "notificationAuthToken": "c8974e592c2fa383d4a3960714"
# },
# "duration": {"value": 1, "unit": "hours"}
# })
#
#
#def test_update_session():
# response = requests.put(f'{BASE_URL}/sessions/88c51c03-13bf-4542-b3f2-43a9edccfc95', json={
# "duration": {"value": 32, "unit": "hours"}
# })
#
#def test_delete_session():
# response = requests.delete(f'{BASE_URL}/sessions/e1b53005-ffba-4e66-b7fe-0c5e022d8d7d')
#
##def test_delete_all_sessions():
# #BASE_URL = 'http://10.1.7.197/camara/qod/v0'
# #DELETE_ALL_URL = f"{BASE_URL}/sessions/delete_all"
# #response = requests.delete(DELETE_ALL_URL)
##def test_delete_all_profiles():
# #BASE_URL = 'http://10.1.7.197/camara/qod/v0'
# #DELETE_ALL_URL_Profile = f"{BASE_URL}/profiles/delete_all"
# #response = requests.delete(DELETE_ALL_URL_Profile)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment