kurczews | b66da2b | 2019-04-18 09:07:14 +0200 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library RequestsLibrary |
| 3 | Library Collections |
| 4 | Resource ../../../common.robot |
| 5 | |
| 6 | *** Keywords *** |
| 7 | VES event with additional fields |
| 8 | [Arguments] ${test_case_directory} |
| 9 | ${pnf_entry}= Get Data From File ${test_case_directory}/aai-entry.json |
| 10 | ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json |
| 11 | ${expected_pnf_ready_event}= Get Data From File ${test_case_directory}/expected-pnf-ready-event.json |
| 12 | ${expected_logical_link}= Get Data From File ${test_case_directory}/expected-logical-link.json |
| 13 | Add PNF entry in AAI ${pnf_entry} |
| 14 | Set VES event in DMaaP ${ves_event} |
| 15 | Wait Until Keyword Succeeds 10x 3000ms Check CBS ready |
| 16 | Wait Until Keyword Succeeds 10x 3000ms Check recorded PNF_READY notification ${expected_pnf_ready_event} |
| 17 | Check recorded Logical Link ${expected_logical_link} |
| 18 | |
| 19 | Check CBS ready |
| 20 | ${resp}= Get Request ${consul_setup_session} /v1/catalog/service/cbs |
| 21 | Should Be Equal As Strings ${resp.status_code} 200 |
| 22 | Log CBS ${resp.content} |
| 23 | |
| 24 | Check recorded PNF_READY notification |
| 25 | [Arguments] ${expected_event_pnf_ready_in_dpaap} |
| 26 | ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers} |
| 27 | Should Be Equal As Strings ${resp.status_code} 200 |
| 28 | Should Be Equal As JSON ${resp.content} ${expected_event_pnf_ready_in_dpaap} |
| 29 | |
| 30 | Check recorded Logical Link |
| 31 | [Arguments] ${expected_logical_link_in_aai} |
| 32 | ${resp}= Get Request ${aai_setup_session} /setup/get_created_logical_link headers=${suite_headers} |
| 33 | Should Be Equal As Strings ${resp.status_code} 200 |
| 34 | Should Be Equal As JSON ${resp.content} ${expected_logical_link_in_aai} |
| 35 | |
| 36 | Add PNF entry in AAI |
| 37 | [Arguments] ${pnf_entry} |
| 38 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 39 | Log AAI url ${AAI_SIMULATOR_SETUP_URL} |
| 40 | ${resp}= Put Request ${aai_setup_session} /setup/add_pnf_entry headers=${suite_headers} data=${pnf_entry} |
| 41 | Should Be Equal As Strings ${resp.status_code} 200 |
| 42 | |
| 43 | Set VES event in DMaaP |
| 44 | [Arguments] ${ves_event} |
| 45 | ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${ves_event} |
| 46 | Should Be Equal As Strings ${resp.status_code} 200 |
| 47 | |
| 48 | Should Be Equal As JSON |
| 49 | [Arguments] ${given} ${expected} |
| 50 | Should Be True ${given}==${expected} |
| 51 | |
| 52 | Create sessions |
| 53 | Create Session dmaap_setup_session ${DMAAP_SIMULATOR_SETUP_URL} |
| 54 | Set Suite Variable ${dmaap_setup_session} dmaap_setup_session |
| 55 | Create Session aai_setup_session ${AAI_SIMULATOR_SETUP_URL} |
| 56 | Set Suite Variable ${aai_setup_session} aai_setup_session |
| 57 | Create Session consul_setup_session ${CONSUL_SETUP_URL} |
| 58 | Set Suite Variable ${consul_setup_session} consul_setup_session |
| 59 | |
| 60 | Reset Simulators |
| 61 | Reset AAI simulator |
| 62 | Reset DMaaP simulator |
| 63 | |
| 64 | Reset AAI simulator |
| 65 | ${resp}= Post Request ${aai_setup_session} /reset |
| 66 | Should Be Equal As Strings ${resp.status_code} 200 |
| 67 | |
| 68 | Reset DMaaP simulator |
| 69 | ${resp}= Post Request ${dmaap_setup_session} /reset |
| 70 | Should Be Equal As Strings ${resp.status_code} 200 |
| 71 | |
| 72 | Create headers |
| 73 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 74 | Set Suite Variable ${suite_headers} ${headers} |