Loading src/sunrise6g_opensdk/network/core/base_network_client.py +3 −2 Original line number Original line Diff line number Diff line Loading @@ -380,8 +380,8 @@ class BaseNetworkClient: serverIp = flowDesc.split("to ")[1].split("/")[0] serverIp = flowDesc.split("to ")[1].split("/")[0] session_info = schemas.SessionInfo( session_info = schemas.SessionInfo( sessionId=schemas.SessionId(uuid.UUID(subscription_info.subscription_id)), sessionId=schemas.SessionId(uuid.UUID(subscription_info.subscription_id)), duration=subscription_info.usageThreshold.duration, duration=subscription_info.usageThreshold.duration.root, sink=subscription_info.notificationDestination, sink=subscription_info.notificationDestination.root, qosProfile=subscription_info.qosReference, qosProfile=subscription_info.qosReference, device=schemas.Device( device=schemas.Device( ipv4Address=schemas.DeviceIpv4Addr1( ipv4Address=schemas.DeviceIpv4Addr1( Loading @@ -392,6 +392,7 @@ class BaseNetworkClient: applicationServer=schemas.ApplicationServer( applicationServer=schemas.ApplicationServer( ipv4Address=schemas.ApplicationServerIpv4Address(serverIp) ipv4Address=schemas.ApplicationServerIpv4Address(serverIp) ), ), qosStatus=schemas.QosStatus.AVAILABLE, ) ) return session_info.model_dump() return session_info.model_dump() Loading src/sunrise6g_opensdk/network/core/schemas.py +1 −0 Original line number Original line Diff line number Diff line Loading @@ -185,6 +185,7 @@ class AsSessionWithQoSSubscription(BaseModel): if not subscription_id: if not subscription_id: log.error("Failed to retrieve QoS session ID from response") log.error("Failed to retrieve QoS session ID from response") raise NetworkPlatformError("QoS session ID not found in response") raise NetworkPlatformError("QoS session ID not found in response") return subscription_id class SourceTrafficFilters(BaseModel): class SourceTrafficFilters(BaseModel): Loading tests/network/test_cases.py +1 −1 Original line number Original line Diff line number Diff line Loading @@ -10,7 +10,7 @@ test_cases = [ { { "network": { "network": { "client_name": "open5gs", "client_name": "open5gs", "base_url": "http://192.168.124.233:8082/", "base_url": "http://192.168.124.233:8002/", "scs_as_id": "scs", "scs_as_id": "scs", } } }, }, Loading tests/network/test_create_qod_session.py +8 −5 Original line number Original line Diff line number Diff line Loading @@ -31,7 +31,10 @@ def test_valid_input_open5gs(network_client: BaseNetworkClient): camara_session = { camara_session = { "duration": 3600, "duration": 3600, "device": { "device": { "ipv4Address": {"publicAddress": "10.45.0.3", "privateAddress": "10.45.0.3"} "ipv4Address": { "publicAddress": "10.45.0.10", "privateAddress": "10.45.0.10", } }, }, "applicationServer": {"ipv4Address": "10.45.0.1"}, "applicationServer": {"ipv4Address": "10.45.0.1"}, "devicePorts": {"ranges": [{"from": 0, "to": 65535}]}, "devicePorts": {"ranges": [{"from": 0, "to": 65535}]}, Loading @@ -48,8 +51,8 @@ def qod_session_id(network_client: BaseNetworkClient): "duration": 3600, "duration": 3600, "device": { "device": { "ipv4Address": { "ipv4Address": { "publicAddress": "10.45.0.3", "publicAddress": "10.45.0.10", "privateAddress": "10.45.0.3", "privateAddress": "10.45.0.10", } } }, }, "applicationServer": {"ipv4Address": "10.45.0.1"}, "applicationServer": {"ipv4Address": "10.45.0.1"}, Loading Loading @@ -79,8 +82,8 @@ def test_create_qod_session(qod_session_id): @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) def test_timer_wait_5_seconds(network_client): def test_timer_wait_60_seconds(network_client): time.sleep(5) time.sleep(60) @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) Loading Loading
src/sunrise6g_opensdk/network/core/base_network_client.py +3 −2 Original line number Original line Diff line number Diff line Loading @@ -380,8 +380,8 @@ class BaseNetworkClient: serverIp = flowDesc.split("to ")[1].split("/")[0] serverIp = flowDesc.split("to ")[1].split("/")[0] session_info = schemas.SessionInfo( session_info = schemas.SessionInfo( sessionId=schemas.SessionId(uuid.UUID(subscription_info.subscription_id)), sessionId=schemas.SessionId(uuid.UUID(subscription_info.subscription_id)), duration=subscription_info.usageThreshold.duration, duration=subscription_info.usageThreshold.duration.root, sink=subscription_info.notificationDestination, sink=subscription_info.notificationDestination.root, qosProfile=subscription_info.qosReference, qosProfile=subscription_info.qosReference, device=schemas.Device( device=schemas.Device( ipv4Address=schemas.DeviceIpv4Addr1( ipv4Address=schemas.DeviceIpv4Addr1( Loading @@ -392,6 +392,7 @@ class BaseNetworkClient: applicationServer=schemas.ApplicationServer( applicationServer=schemas.ApplicationServer( ipv4Address=schemas.ApplicationServerIpv4Address(serverIp) ipv4Address=schemas.ApplicationServerIpv4Address(serverIp) ), ), qosStatus=schemas.QosStatus.AVAILABLE, ) ) return session_info.model_dump() return session_info.model_dump() Loading
src/sunrise6g_opensdk/network/core/schemas.py +1 −0 Original line number Original line Diff line number Diff line Loading @@ -185,6 +185,7 @@ class AsSessionWithQoSSubscription(BaseModel): if not subscription_id: if not subscription_id: log.error("Failed to retrieve QoS session ID from response") log.error("Failed to retrieve QoS session ID from response") raise NetworkPlatformError("QoS session ID not found in response") raise NetworkPlatformError("QoS session ID not found in response") return subscription_id class SourceTrafficFilters(BaseModel): class SourceTrafficFilters(BaseModel): Loading
tests/network/test_cases.py +1 −1 Original line number Original line Diff line number Diff line Loading @@ -10,7 +10,7 @@ test_cases = [ { { "network": { "network": { "client_name": "open5gs", "client_name": "open5gs", "base_url": "http://192.168.124.233:8082/", "base_url": "http://192.168.124.233:8002/", "scs_as_id": "scs", "scs_as_id": "scs", } } }, }, Loading
tests/network/test_create_qod_session.py +8 −5 Original line number Original line Diff line number Diff line Loading @@ -31,7 +31,10 @@ def test_valid_input_open5gs(network_client: BaseNetworkClient): camara_session = { camara_session = { "duration": 3600, "duration": 3600, "device": { "device": { "ipv4Address": {"publicAddress": "10.45.0.3", "privateAddress": "10.45.0.3"} "ipv4Address": { "publicAddress": "10.45.0.10", "privateAddress": "10.45.0.10", } }, }, "applicationServer": {"ipv4Address": "10.45.0.1"}, "applicationServer": {"ipv4Address": "10.45.0.1"}, "devicePorts": {"ranges": [{"from": 0, "to": 65535}]}, "devicePorts": {"ranges": [{"from": 0, "to": 65535}]}, Loading @@ -48,8 +51,8 @@ def qod_session_id(network_client: BaseNetworkClient): "duration": 3600, "duration": 3600, "device": { "device": { "ipv4Address": { "ipv4Address": { "publicAddress": "10.45.0.3", "publicAddress": "10.45.0.10", "privateAddress": "10.45.0.3", "privateAddress": "10.45.0.10", } } }, }, "applicationServer": {"ipv4Address": "10.45.0.1"}, "applicationServer": {"ipv4Address": "10.45.0.1"}, Loading Loading @@ -79,8 +82,8 @@ def test_create_qod_session(qod_session_id): @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) def test_timer_wait_5_seconds(network_client): def test_timer_wait_60_seconds(network_client): time.sleep(5) time.sleep(60) @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) @pytest.mark.parametrize("network_client", test_cases, ids=id_func, indirect=True) Loading