rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing PM Mapper functionality |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame^] | 3 | Resource ../../common.robot |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 4 | Library Collections |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame^] | 5 | Library json |
| 6 | Library OperatingSystem |
| 7 | Library RequestsLibrary |
| 8 | Library HttpLibrary.HTTP |
| 9 | Library String |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 10 | Library Process |
| 11 | |
| 12 | |
| 13 | *** Variables *** |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame^] | 14 | ${BC_URL} http://${DMAAPBC_IP}:8080/webapi |
| 15 | ${CLI_EXEC_CLI} curl http://${CBS_IP}:10000/service_component/pmmapper |
| 16 | ${FEED1_DATA} { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } |
rajendrajaiswal | 47b64d7 | 2019-02-06 16:09:24 +0000 | [diff] [blame] | 17 | |
| 18 | |
| 19 | *** Test Cases *** |
| 20 | |
| 21 | Verify pmmapper configuration in consul through CBS |
| 22 | [Tags] PM_MAPPER_01 |
| 23 | [Documentation] Verify pmmapper configuraiton in consul through CBS |
| 24 | ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes |
| 25 | Log ${cli_cmd_output.stdout} |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame^] | 26 | Should Contain ${cli_cmd_output.stdout} pm-mapper-filter |
| 27 | |
| 28 | Create DR Feed through Bus Controller |
| 29 | [Tags] PM_MAPPER_02 |
| 30 | [Documentation] Create Feed on Data Router through Bus Controller |
| 31 | ${resp}= PostCall ${BC_URL}/feeds ${FEED1_DATA} |
| 32 | Should Be Equal As Integers ${resp.status_code} 200 |
| 33 | |
| 34 | *** Keywords *** |
| 35 | |
| 36 | PostCall |
| 37 | [Arguments] ${url} ${data} |
| 38 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 39 | ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests |
| 40 | [Return] ${resp} |