From e49a3f2df9bf6c8d7eb29a924ebbf31e7fba2b97 Mon Sep 17 00:00:00 2001 From: "Eduardo Ramos Testillano (eramedu)" Date: Wed, 20 May 2020 19:02:25 +0200 Subject: [PATCH] Improve dynamic test provision Complete actions with answers mocking on FIFO queue. --- .../ct/dynamic-procedure/dynamic_test.py | 22 ++++ .../resources/cca-diameterJson-request.json | 113 ++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 example/diameter/launcher/resources/rest_api/ct/resources/cca-diameterJson-request.json diff --git a/example/diameter/launcher/resources/rest_api/ct/dynamic-procedure/dynamic_test.py b/example/diameter/launcher/resources/rest_api/ct/dynamic-procedure/dynamic_test.py index 6876e21..136c244 100644 --- a/example/diameter/launcher/resources/rest_api/ct/dynamic-procedure/dynamic_test.py +++ b/example/diameter/launcher/resources/rest_api/ct/dynamic-procedure/dynamic_test.py @@ -28,3 +28,25 @@ def test_002_provision_dynamic_operation_for_gx_at_adml(resources, admlc): # Verify response admlc.assert_response__status_body_headers(response, 200, responseBodyRef) +@pytest.mark.dynamic +def test_003_provision_answers_to_reacts_diameter_client_requests(resources, admlc): + + requestBody = resources("cca-diameterJson-request.json") + responseBodyRef = { "success":"true", "response":"Added 'answer to client' to the FIFO queue corresponding to its message code" } + + # Send POST + response = admlc.post("/answermsg2c", requestBody) + + ### Verify response + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + + # Infinite rotation for the FIFO queue: + requestBody = { "action":"rotate" } + responseBodyRef = { "success":"true", "response":"rotate" } + + # Send POST + response = admlc.postDict("/answermsg2c", requestBody) + + ### Verify response + admlc.assert_response__status_body_headers(response, 200, responseBodyRef) + diff --git a/example/diameter/launcher/resources/rest_api/ct/resources/cca-diameterJson-request.json b/example/diameter/launcher/resources/rest_api/ct/resources/cca-diameterJson-request.json new file mode 100644 index 0000000..1158a0d --- /dev/null +++ b/example/diameter/launcher/resources/rest_api/ct/resources/cca-diameterJson-request.json @@ -0,0 +1,113 @@ +{ + "diameterJson": { + "message": { + "@application-id": "16777238", + "@end-to-end-id": "2608975473", + "@hop-by-hop-id": "4286522462", + "@name": "CC-Answer", + "@p-bit": "yes", + "@version": "1", + "avp": [ + { + "@data": "111110004999;BAT004;ggsnNodeHostname.nodeHostRealm.com;9020004999", + "@name": "Session-Id" + }, + { + "@data": "16777238", + "@name": "Auth-Application-Id" + }, + { + "@data": "ownHostIdGx.operatorRealm.com", + "@name": "Origin-Host" + }, + { + "@data": "operatorRealm.com", + "@name": "Origin-Realm" + }, + { + "@alias": "INITIAL_REQUEST", + "@data": "1", + "@name": "CC-Request-Type" + }, + { + "@data": "0", + "@name": "CC-Request-Number" + }, + { + "@alias": "DIAMETER_SUCCESS", + "@data": "2001", + "@name": "Result-Code" + }, + { + "@flags": "128", + "@name": "Supported-Features", + "avp": [ + { + "@data": "10415", + "@name": "Vendor-Id" + }, + { + "@data": "1", + "@name": "Feature-List-ID" + }, + { + "@data": "3", + "@name": "Feature-List" + } + ] + }, + { + "@alias": "UE_NW", + "@data": "2", + "@name": "Bearer-Control-Mode" + }, + { + "@data": "5", + "@name": "Origin-State-Id" + }, + { + "@name": "QoS-Information", + "avp": [ + { + "@data": "512000", + "@name": "APN-Aggregate-Max-Bitrate-UL" + }, + { + "@data": "5120000", + "@name": "APN-Aggregate-Max-Bitrate-DL" + } + ] + }, + { + "@name": "Default-EPS-Bearer-QoS", + "avp": [ + { + "@alias": "QCI_6", + "@data": "6", + "@name": "QoS-Class-Identifier" + }, + { + "@name": "Allocation-Retention-Priority", + "avp": [ + { + "@data": "3", + "@name": "Priority-Level" + }, + { + "@alias": "PRE-EMPTION_CAPABILITY_DISABLED", + "@data": "1", + "@name": "Pre-emption-Capability" + }, + { + "@alias": "PRE-EMPTION_VULNERABILITY_ENABLED", + "@data": "0", + "@name": "Pre-emption-Vulnerability" + } + ] + } + ] + } + ] + } + } +} -- 2.20.1