Skip to content
Snippets Groups Projects
test_camara_qod.py 3.06 KiB
Newer Older
Mohamad Rahhal's avatar
Mohamad Rahhal committed
from urllib import response
Mohamad Rahhal's avatar
Mohamad Rahhal committed

BASE_URL = 'http://10.1.7.197/camara/qod/v0'

def test_create_profile():
    response = requests.post(f'{BASE_URL}/profiles', json={
Mohamad Rahhal's avatar
Mohamad Rahhal committed
"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
}           
)
Mohamad Rahhal's avatar
Mohamad Rahhal committed
def get_profile():
    response=requests.get(f'{BASE_URL}/profile/ProfileDetail')
Mohamad Rahhal's avatar
Mohamad Rahhal committed
#def test_delete_profile_by_name():
#    response = requests.delete(f'{BASE_URL}/profiles/delete_by_name/Test Profile')
Mohamad Rahhal's avatar
Mohamad Rahhal committed
#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)