blob: a05defb5e096346718984737fc51fa97f4118bc0 [file] [log] [blame]
rajendrajaiswal47b64d72019-02-06 16:09:24 +00001*** Settings ***
2Documentation Testing PM Mapper functionality
rajendrajaiswal47b64d72019-02-06 16:09:24 +00003Library Collections
rajendrajaiswal8f0afd82019-02-11 12:30:26 +00004Library OperatingSystem
5Library RequestsLibrary
rajendrajaiswal47b64d72019-02-06 16:09:24 +00006Library Process
7
JoeOLeary4ec2b9d2019-02-25 10:14:53 +00008Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL}
9Test Teardown Delete All Sessions
10
rajendrajaiswal47b64d72019-02-06 16:09:24 +000011
12*** Variables ***
rajendrajaiswal7f7dab02019-02-15 10:23:53 +000013${CLI_EXEC_CLI_CONFIG} { head -n 5 | tail -1;} < /tmp/pmmapper.log
rajendrajaiswal140bfd22019-02-14 14:47:15 +000014${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov
JoeOLeary4ec2b9d2019-02-25 10:14:53 +000015${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081
16${DELIVERY_ENDPOINT} /delivery
rajendrajaiswal47b64d72019-02-06 16:09:24 +000017
18*** Test Cases ***
19
rajendrajaiswal140bfd22019-02-14 14:47:15 +000020Verify PM Mapper Receive Configuraton From Config Binding Service
rajendrajaiswal47b64d72019-02-06 16:09:24 +000021 [Tags] PM_MAPPER_01
rajendrajaiswal140bfd22019-02-14 14:47:15 +000022 [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
rajendrajaiswal7f7dab02019-02-15 10:23:53 +000026 Should Contain ${cli_cmd_output.stdout} Received pm-mapper configuration
rajendrajaiswal140bfd22019-02-14 14:47:15 +000027
28Verify 3GPP PM Mapper Subscribes to Data Router
29 [Tags] PM_MAPPER_02
rajendrajaiswala1574702019-02-14 10:29:45 +000030 [Documentation] Verify 3gpp pm mapper subscribes to data router
rajendrajaiswal140bfd22019-02-14 14:47:15 +000031 ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_SUBS} shell=yes
rajendrajaiswal47b64d72019-02-06 16:09:24 +000032 Log ${cli_cmd_output.stdout}
rajendrajaiswala1574702019-02-14 10:29:45 +000033 Should Be Equal As Strings ${cli_cmd_output.rc} 0
rajendrajaiswal7f7dab02019-02-15 10:23:53 +000034 Should Contain ${cli_cmd_output.stdout} 3gpppmmapper
rajendrajaiswal8f0afd82019-02-11 12:30:26 +000035
JoeOLeary4ec2b9d2019-02-25 10:14:53 +000036Verify 3GPP PM Mapper responds appropriately when no metadata is provided
37 [Tags] PM_MAPPER_10
38 [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided
39 [Timeout] 1 minute
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.
44
45Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided
46 [Tags] PM_MAPPER_11
47 [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided
48 [Timeout] 1 minute
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.
53
rajendrajaiswal8f0afd82019-02-11 12:30:26 +000054*** Keywords ***
55
56PostCall
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
60 [Return] ${resp}