3 def test_001_given_diameter_json_representation_i_want_to_send_message_to_diameter_entity_and_check_it_fails_for_auto_node(resources, admlc):
5 responseBodyRef = { "success":"true", "response":"Working node has been set to automatic" }
8 response = admlc.post("/node-auto")
11 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
13 requestBody = resources("aar-diameterJson-request.json")
14 responseBodyRef = { "success":"false", "response":"Internal error (check ADML traces): invalid operated host" }
17 response = admlc.post("/sendmsg2e", requestBody)
20 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
22 # IT FAILS BECAUSE MESSAGE SENT HAS OCS3 AS ORIGIN HOST, AND THIS IS NOT REGISTERED, SO node-auto COULD NOT DEDUCE THE CORRECT RESOURCE
24 @pytest.mark.xfail(reason="Server must receive client connection to be available. Component test is very fast and this could fail the first time. Wait and test again. TODO: wait for available status after 'services' loading.")
25 def test_002_given_diameter_json_representation_i_want_to_send_message_to_diameter_entity_and_check_it_succeed_for_forced_node(resources, admlc):
27 requestBody = { "name":"afHost.afRealm.com" }
28 responseBodyRef = { "success":"true", "response":"Forced node is now 'afHost.afRealm.com'" }
31 response = admlc.postDict("/node", requestBody)
34 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
36 requestBody = resources("aar-diameterJson-request.json")
37 responseBodyRef = { "success":"true", "response":"Operation processed" }
40 response = admlc.post("/sendmsg2e", requestBody)
43 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
45 @pytest.mark.xfail(reason="Server must receive client connection to be available. Component test is very fast and this could fail the first time. Wait and test again. TODO: wait for available status after 'services' loading.")
46 def test_003_given_diameter_json_representation_i_want_to_send_message_to_diameter_client_and_check_it_succeed_for_auto_node(resources, admlc):
48 responseBodyRef = { "success":"true", "response":"Working node has been set to automatic" }
51 response = admlc.post("/node-auto")
54 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)
56 # NORMALLY, AAR IS NOT THE KIND OF MESSAGE TO SEND AS DIAMETER SERVER BUT RAR, etc, BUT THIS IS VALID FOR OUR TESTING
58 # We will use a message which origin-host and destination-host fits the real configured ones in services, and also is ready
59 # to be sent from local diameter server to the client:
60 requestBody = resources("aar-diameterJsonFromOwnToAF-request.json")
61 responseBodyRef = { "success":"true", "response":"Operation processed" }
64 response = admlc.post("/sendmsg2c", requestBody)
67 admlc.assert_response__status_body_headers(response, 200, responseBodyRef)