Filip Krzywka | d95a670 | 2018-08-06 10:07:03 +0200 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library DcaeAppSimulatorLibrary |
Filip Krzywka | e263475 | 2018-08-06 10:37:39 +0200 | [diff] [blame] | 3 | Library XnfSimulatorLibrary |
| 4 | Library VesHvContainersUtilsLibrary |
| 5 | Library Collections |
| 6 | |
| 7 | Suite Setup Message Routing Suite Setup |
| 8 | Suite Teardown VES-HV Collector Suite Teardown |
| 9 | Test Teardown VES-HV Collector Test Shutdown |
Filip Krzywka | d95a670 | 2018-08-06 10:07:03 +0200 | [diff] [blame] | 10 | |
Filip Krzywka | 9318578 | 2018-08-06 09:31:40 +0200 | [diff] [blame] | 11 | *** Test Cases *** |
Filip Krzywka | e263475 | 2018-08-06 10:37:39 +0200 | [diff] [blame] | 12 | Correct Messages Routing |
| 13 | [Documentation] VES-HV Collector should route all valid messages to topics specified in configuration |
| 14 | ... and do not change message payload generated in XNF simulator |
| 15 | |
| 16 | ${SIMULATORS_LIST}= Get xNF Simulators 1 |
| 17 | Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_FIXED_PAYLOAD_REQUEST} |
| 18 | |
Filip Krzywka | d95a670 | 2018-08-06 10:07:03 +0200 | [diff] [blame] | 19 | Wait until keyword succeeds 60 sec 5 sec |
Filip Krzywka | e263475 | 2018-08-06 10:37:39 +0200 | [diff] [blame] | 20 | ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_25000} |
Filip Krzywka | 81f5d52 | 2018-08-06 10:44:47 +0200 | [diff] [blame] | 21 | Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_FIXED_PAYLOAD_REQUEST} |
Filip Krzywka | e263475 | 2018-08-06 10:37:39 +0200 | [diff] [blame] | 22 | |
Jakub Dudycz | e50e917 | 2018-08-06 10:52:37 +0200 | [diff] [blame] | 23 | |
| 24 | Too big payload message handling |
| 25 | [Documentation] VES-HV Collector should interrupt the stream when encountered message with too big payload |
| 26 | |
| 27 | ${SIMULATORS_LIST}= Get xNF Simulators 1 |
| 28 | Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_TOO_BIG_PAYLOAD_REQUEST} |
| 29 | |
| 30 | Wait until keyword succeeds 60 sec 5 sec |
| 31 | ... Assert Dcae App Consumed Less Equal Than ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_25000} |
| 32 | |
| 33 | |
| 34 | Invalid wire frame message handling |
| 35 | [Documentation] VES-HV Collector should skip messages with invalid wire frame |
| 36 | |
| 37 | ${SIMULATORS_LIST}= Get xNF Simulators 1 |
| 38 | Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_INVALID_WIRE_FRAME_REQUEST} |
| 39 | |
| 40 | Wait until keyword succeeds 60 sec 5 sec |
| 41 | ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} |
| 42 | Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_INVALID_WIRE_FRAME_REQUEST} |
| 43 | |
| 44 | |
| 45 | Invalid GPB data message handling |
| 46 | [Documentation] VES-HV Collector should skip messages with invalid GPB data |
| 47 | |
| 48 | ${SIMULATORS_LIST}= Get xNF Simulators 1 |
| 49 | Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_INVALID_GPB_DATA_REQUEST} |
| 50 | |
| 51 | Wait until keyword succeeds 60 sec 5 sec |
| 52 | ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} |
| 53 | Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_INVALID_GPB_DATA_REQUEST} |
| 54 | |
| 55 | |
| 56 | Unsupported domain message handling |
| 57 | [Documentation] VES-HV Collector should skip messages with unsupported domain |
| 58 | |
| 59 | ${SIMULATORS_LIST}= Get xNF Simulators 1 |
| 60 | Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_UNSUPPORTED_DOMAIN_REQUEST} |
| 61 | |
| 62 | Wait until keyword succeeds 60 sec 5 sec |
| 63 | ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} |
| 64 | Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_UNSUPPORTED_DOMAIN_REQUEST} |
| 65 | |
Filip Krzywka | e263475 | 2018-08-06 10:37:39 +0200 | [diff] [blame] | 66 | *** Keywords *** |
| 67 | Message Routing Suite Setup |
| 68 | Log Started Suite: VES-HV Message Routing |
| 69 | ${XNF_PORTS_LIST}= Create List 7000 |
| 70 | Configure xNF Simulators On Ports ${XNF_PORTS_LIST} |
| 71 | Log Suite setup finished |
| 72 | |
| 73 | Configure xNF Simulators On Ports |
| 74 | [Arguments] ${XNF_PORTS_LIST} |
| 75 | ${XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} True |
| 76 | Set Suite Variable ${XNF_SIMULATORS_ADDRESSES} |
| 77 | |
| 78 | |
| 79 | Get xNF Simulators |
| 80 | [Arguments] ${AMOUNT} |
| 81 | ${SIMULATORS}= Get Slice From List ${XNF_SIMULATORS_ADDRESSES} 0 ${AMOUNT} |
| 82 | [Return] ${SIMULATORS} |
| 83 | |
| 84 | |
| 85 | Send Messages From xNF Simulators |
| 86 | [Arguments] ${XNF_HOSTS_LIST} ${MESSAGE_FILEPATH} |
| 87 | :FOR ${HOST} IN @{XNF_HOSTS_LIST} |
| 88 | \ ${XNF_SIM_API_ACCESS}= Get xNF Sim Api Access Url ${HTTP_METHOD_URL} ${HOST} |
| 89 | \ ${XNF_SIM_API_URL}= Catenate SEPARATOR= ${XNF_SIM_API_ACCESS} ${XNF_SIM_API_PATH} |
| 90 | \ Send messages ${XNF_SIM_API_URL} ${MESSAGE_FILEPATH} |
| 91 | |
| 92 | |
| 93 | VES-HV Collector Test Shutdown |
| 94 | Reset DCAE App Simulator ${DCAE_APP_API_MESSAGE_RESET_URL} |
| 95 | |
| 96 | |
| 97 | VES-HV Collector Suite Teardown |
| 98 | Stop And Remove All Xnf Simulators |
| 99 | |
| 100 | *** Variables *** |
| 101 | ${HTTP_METHOD_URL} http:// |
| 102 | |
| 103 | ${XNF_SIM_API_PATH} /simulator/async |
| 104 | |
| 105 | ${VES_HV_SCENARIOS} %{WORKSPACE}/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios |
| 106 | ${XNF_FIXED_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/fixed-payload/xnf-fixed-payload-request.json |
Jakub Dudycz | e50e917 | 2018-08-06 10:52:37 +0200 | [diff] [blame] | 107 | ${XNF_TOO_BIG_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/too-big-payload/xnf-too-big-payload-request.json |
| 108 | ${XNF_INVALID_WIRE_FRAME_REQUEST} ${VES_HV_SCENARIOS}/invalid-wire-frame/xnf-invalid-wire-frame-request.json |
| 109 | ${XNF_INVALID_GPB_DATA_REQUEST} ${VES_HV_SCENARIOS}/invalid-gpb-data/xnf-invalid-gpb-data-request.json |
| 110 | ${XNF_UNSUPPORTED_DOMAIN_REQUEST} ${VES_HV_SCENARIOS}/unsupported-domain/xnf-unsupported-domain-request.json |
Filip Krzywka | e263475 | 2018-08-06 10:37:39 +0200 | [diff] [blame] | 111 | |
Jakub Dudycz | e50e917 | 2018-08-06 10:52:37 +0200 | [diff] [blame] | 112 | ${DCAE_FIXED_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/fixed-payload/dcae-fixed-payload-request.json |
| 113 | ${DCAE_INVALID_WIRE_FRAME_REQUEST} ${VES_HV_SCENARIOS}/invalid-wire-frame/dcae-invalid-wire-frame-request.json |
| 114 | ${DCAE_INVALID_GPB_DATA_REQUEST} ${VES_HV_SCENARIOS}/invalid-gpb-data/dcae-invalid-gpb-data-request.json |
| 115 | ${DCAE_UNSUPPORTED_DOMAIN_REQUEST} ${VES_HV_SCENARIOS}/unsupported-domain/dcae-unsupported-domain-request.json |
| 116 | |
| 117 | ${AMOUNT_25000} 25000 |
| 118 | ${AMOUNT_50000} 50000 |