rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing PM Mapper functionality |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 3 | Library Collections |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 4 | Library OperatingSystem |
| 5 | Library RequestsLibrary |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 6 | Library Process |
| 7 | |
JoeOLeary | 4ec2b9d | 2019-02-25 10:14:53 +0000 | [diff] [blame] | 8 | Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL} |
| 9 | Test Teardown Delete All Sessions |
| 10 | |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 11 | |
| 12 | *** Variables *** |
rajendrajaiswal | 7f7dab0 | 2019-02-15 10:23:53 +0000 | [diff] [blame] | 13 | ${CLI_EXEC_CLI_CONFIG} { head -n 5 | tail -1;} < /tmp/pmmapper.log |
rajendrajaiswal | 140bfd2 | 2019-02-14 14:47:15 +0000 | [diff] [blame] | 14 | ${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov |
JoeOLeary | 4ec2b9d | 2019-02-25 10:14:53 +0000 | [diff] [blame] | 15 | ${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081 |
| 16 | ${DELIVERY_ENDPOINT} /delivery |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 17 | |
| 18 | *** Test Cases *** |
| 19 | |
rajendrajaiswal | 140bfd2 | 2019-02-14 14:47:15 +0000 | [diff] [blame] | 20 | Verify PM Mapper Receive Configuraton From Config Binding Service |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 21 | [Tags] PM_MAPPER_01 |
rajendrajaiswal | 140bfd2 | 2019-02-14 14:47:15 +0000 | [diff] [blame] | 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 |
rajendrajaiswal | 7f7dab0 | 2019-02-15 10:23:53 +0000 | [diff] [blame] | 26 | Should Contain ${cli_cmd_output.stdout} Received pm-mapper configuration |
rajendrajaiswal | 140bfd2 | 2019-02-14 14:47:15 +0000 | [diff] [blame] | 27 | |
| 28 | Verify 3GPP PM Mapper Subscribes to Data Router |
| 29 | [Tags] PM_MAPPER_02 |
rajendrajaiswal | a157470 | 2019-02-14 10:29:45 +0000 | [diff] [blame] | 30 | [Documentation] Verify 3gpp pm mapper subscribes to data router |
rajendrajaiswal | 140bfd2 | 2019-02-14 14:47:15 +0000 | [diff] [blame] | 31 | ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_SUBS} shell=yes |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 32 | Log ${cli_cmd_output.stdout} |
rajendrajaiswal | a157470 | 2019-02-14 10:29:45 +0000 | [diff] [blame] | 33 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
rajendrajaiswal | 7f7dab0 | 2019-02-15 10:23:53 +0000 | [diff] [blame] | 34 | Should Contain ${cli_cmd_output.stdout} 3gpppmmapper |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 35 | |
JoeOLeary | 4ec2b9d | 2019-02-25 10:14:53 +0000 | [diff] [blame] | 36 | Verify 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 | |
| 45 | Verify 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 | |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 54 | *** Keywords *** |
| 55 | |
| 56 | PostCall |
| 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} |