2 Documentation Testing PM Mapper functionality
4 Library OperatingSystem
5 Library RequestsLibrary
8 Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL}
9 Test Teardown Delete All Sessions
13 ${CLI_EXEC_CLI_CONFIG} { head -n 5 | tail -1;} < /tmp/pmmapper.log
14 ${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov
15 ${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081
16 ${DELIVERY_ENDPOINT} /delivery
20 Verify PM Mapper Receive Configuraton From Config Binding Service
22 [Documentation] Verify 3gpp pm mapper successfully receive config data from CBS
23 ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_CONFIG} shell=yes
24 Log ${cli_cmd_output.stdout}
25 Should Be Equal As Strings ${cli_cmd_output.rc} 0
26 Should Contain ${cli_cmd_output.stdout} Received pm-mapper configuration
28 Verify 3GPP PM Mapper Subscribes to Data Router
30 [Documentation] Verify 3gpp pm mapper subscribes to data router
31 ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_SUBS} shell=yes
32 Log ${cli_cmd_output.stdout}
33 Should Be Equal As Strings ${cli_cmd_output.rc} 0
34 Should Contain ${cli_cmd_output.stdout} 3gpppmmapper
36 Verify 3GPP PM Mapper responds appropriately when no metadata is provided
38 [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided
40 ${headers}= Create Dictionary X-ONAP-RequestID=1 Content-Type=application/xml
41 ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT} data='${EMPTY}' headers=${headers}
42 Should Be Equal As Strings ${resp.status_code} 400
43 Should Be Equal As Strings ${resp.content} Missing Metadata.
45 Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided
47 [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided
49 ${headers}= Create Dictionary X-ONAP-RequestID=1 X-ATT-DR-META='not metadata' Content-Type=application/xml
50 ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT} data='${EMPTY}' headers=${headers}
51 Should Be Equal As Strings ${resp.status_code} 400
52 Should Be Equal As Strings ${resp.content} Malformed Metadata.
57 [Arguments] ${url} ${data}
58 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
59 ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests