TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Template handling of ONU Go adapter with BBSIM controlledActivation: only-onu only! |
| 3 | ... Values.yaml must contain 'onu: 2' and 'controlledActivation: only-onu' under BBSIM! |
| 4 | ... Run robot with bbsim-kind-2x2.yaml |
| 5 | Suite Setup Setup Suite |
| 6 | Suite Teardown Teardown Suite |
| 7 | Test Setup Setup |
| 8 | Test Teardown Teardown |
| 9 | Library Collections |
| 10 | Library String |
| 11 | Library OperatingSystem |
| 12 | Library XML |
| 13 | Library RequestsLibrary |
| 14 | Library ../../libraries/DependencyLibrary.py |
| 15 | Resource ../../libraries/onos.robot |
| 16 | Resource ../../libraries/voltctl.robot |
| 17 | Resource ../../libraries/voltha.robot |
| 18 | Resource ../../libraries/utils.robot |
| 19 | Resource ../../libraries/k8s.robot |
| 20 | Resource ../../variables/variables.robot |
TorstenThieme | fd7e7ba | 2020-11-06 13:57:57 +0000 | [diff] [blame] | 21 | Resource Voltha_ONUUtilities.robot |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 22 | |
| 23 | *** Variables *** |
| 24 | ${NAMESPACE} voltha |
| 25 | ${timeout} 180s |
| 26 | ${of_id} 0 |
| 27 | ${logical_id} 0 |
| 28 | ${has_dataplane} True |
| 29 | ${external_libs} True |
| 30 | ${teardown_device} True |
| 31 | ${scripts} ../../scripts |
| 32 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 33 | ${container_log_dir} ${None} |
| 34 | |
| 35 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
| 36 | # example: -v debugmode:True |
| 37 | ${debugmode} False |
| 38 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 39 | # example: -v logging:True |
| 40 | ${logging} False |
| 41 | # if True execution will be paused before clean up |
| 42 | # example: -v pausebeforecleanup:True |
| 43 | ${pausebeforecleanup} False |
| 44 | ${data_dir} ../data |
| 45 | |
| 46 | |
| 47 | *** Test Cases *** |
| 48 | ONU MIB Template Data Test |
| 49 | [Documentation] Validates ONU Go adapter storage of MIB Template Data in etcd and checks the usage |
| 50 | ... - setup one ONU |
| 51 | ... - request MIB-Upload-Data by ONU via OMCI |
| 52 | ... - storage MIB-Upload-Data in etcd |
| 53 | ... - store setup duration of ONU |
| 54 | ... - check Template-Data in etcd stored (service/voltha/omci_mibs/go_templates/) |
| 55 | ... - setup second ONU |
| 56 | ... - collect setup durationof second ONU |
| 57 | ... - compare both duration |
| 58 | ... - duration of second ONU should be at least 10 times faster than the first one |
| 59 | ... - MIB-Upload-Data should not requested via OMCI by second ONU |
| 60 | ... - MIB-Upload-Data should read from etcd |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 61 | [Tags] functionalOnuGo MibTemplateOnuGo |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 62 | [Setup] Run Keywords Start Logging ONUMibTemplateTest |
| 63 | ... AND Setup |
| 64 | Perform ONU MIB Template Data Test |
| 65 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 66 | ... AND Stop Logging ONUMibTemplateTest |
| 67 | |
| 68 | |
| 69 | *** Keywords *** |
| 70 | Setup Suite |
| 71 | [Documentation] Set up the test suite |
| 72 | ${LogInfo}= Catenate |
| 73 | ... \r\nPassed arguments: |
| 74 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
| 75 | Log ${LogInfo} console=yes |
| 76 | Common Test Suite Setup |
| 77 | ${onos_ssh_connection} Open ONOS SSH Connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 78 | Set Suite Variable ${onos_ssh_connection} |
| 79 | # delete etcd MIB Template Data |
| 80 | Delete MIB Template Data |
| 81 | |
| 82 | Teardown Suite |
| 83 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 84 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 85 | ... Furthermore gives the possibility to pause the execution. |
| 86 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 87 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 88 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 89 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Matteo Scandolo | 786aba4 | 2020-12-07 10:00:03 -0800 | [diff] [blame] | 90 | FOR ${I} IN RANGE 0 ${num_olts} |
| 91 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
Matteo Scandolo | b995323 | 2020-12-07 14:24:47 -0800 | [diff] [blame] | 92 | ${of_id}= Wait Until Keyword Succeeds 60s 5s Validate OLT Device in ONOS ${olt_serial_number} |
| 93 | Wait for Ports in ONOS ${onos_ssh_connection} 0 ${of_id} BBSM |
Matteo Scandolo | 786aba4 | 2020-12-07 10:00:03 -0800 | [diff] [blame] | 94 | END |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 95 | # delete etcd MIB Template Data (for repeating test) |
| 96 | Delete MIB Template Data |
| 97 | Close ONOS SSH Connection ${onos_ssh_connection} |
| 98 | |
| 99 | Perform ONU MIB Template Data Test |
| 100 | [Documentation] This keyword performs ONU MIB Template Data Test |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 101 | ${firstonu}= Set Variable 0 |
| 102 | ${secondonu}= Set Variable 1 |
| 103 | ${state2test}= Set Variable omci-flows-pushed |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 104 | Set Global Variable ${state2test} |
| 105 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 106 | # Start first Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 107 | ${src}= Set Variable ${hosts.src[${0}]} |
| 108 | Log \r\nONU ${src['onu']}: startup with MIB upload cycle and storage of template data to etcd. console=yes |
Holger Hildebrandt | 2314774 | 2020-11-16 10:13:21 +0000 | [diff] [blame] | 109 | ${result}= Exec Pod In Kube ${NAMESPACE} bbsim bbsimctl onu poweron ${src['onu']} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 110 | Should Contain ${result} successfully msg=Can not poweron ${src['onu']} values=False |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 111 | ${timeStart}= Get Current Date |
| 112 | ${firstonustartup}= Get ONU Startup Duration ${firstonu} ${timeStart} |
| 113 | # check MIB Template data stored in etcd |
| 114 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s |
| 115 | ... Verify MIB Template Data Available |
| 116 | # Start second Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 117 | ${src}= Set Variable ${hosts.src[${1}]} |
| 118 | Log ONU ${src['onu']}: startup without MIB upload cycle by using of template data of etcd. console=yes |
Holger Hildebrandt | 2314774 | 2020-11-16 10:13:21 +0000 | [diff] [blame] | 119 | ${result}= Exec Pod In Kube ${NAMESPACE} bbsim bbsimctl onu poweron ${src['onu']} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 120 | Should Contain ${result} successfully msg=Can not poweron ${src['onu']} values=False |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 121 | ${timeStart}= Get Current Date |
| 122 | ${secondonustartup}= Get ONU Startup Duration ${secondonu} ${timeStart} |
| 123 | # compare both durations, second onu should be at least 3 times faster |
| 124 | ${status} Evaluate ${firstonustartup}>=${secondonustartup}*3 |
| 125 | Should Be True ${status} |
| 126 | ... Startup durations (${firstonustartup} and ${secondonustartup}) do not full fill the requirements of 1/10. |
| 127 | |
| 128 | Get ONU Startup Duration |
| 129 | [Documentation] This keyword delivers startup duration of onu |
| 130 | [Arguments] ${onu} ${starttime} |
| 131 | ${src}= Set Variable ${hosts.src[${onu}]} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 132 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= |
| 133 | ... Map State ${state2test} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 134 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 135 | ... Validate Device ${admin_state} ${oper_status} ${connect_status} |
| 136 | ... ${src['onu']} onu=True onu_reason=${onu_state} |
| 137 | ${timeCurrent} = Get Current Date |
| 138 | ${timeTotalMs} = Subtract Date From Date ${timeCurrent} ${startTime} result_format=number |
| 139 | Log ONU ${src['onu']}: reached the state ${onu_state} after ${timeTotalMs} sec. console=yes |
| 140 | [Return] ${timeTotalMs} |