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 |
| 90 | Wait for Ports in ONOS ${onos_ssh_connection} 0 BBSM |
| 91 | # delete etcd MIB Template Data (for repeating test) |
| 92 | Delete MIB Template Data |
| 93 | Close ONOS SSH Connection ${onos_ssh_connection} |
| 94 | |
| 95 | Perform ONU MIB Template Data Test |
| 96 | [Documentation] This keyword performs ONU MIB Template Data Test |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 97 | ${firstonu}= Set Variable 0 |
| 98 | ${secondonu}= Set Variable 1 |
| 99 | ${state2test}= Set Variable omci-flows-pushed |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 100 | Set Global Variable ${state2test} |
| 101 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 102 | # Start first Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 103 | ${src}= Set Variable ${hosts.src[${0}]} |
| 104 | Log \r\nONU ${src['onu']}: startup with MIB upload cycle and storage of template data to etcd. console=yes |
| 105 | ${result}= Exec Pod ${NAMESPACE} bbsim bbsimctl onu poweron ${src['onu']} |
| 106 | Should Contain ${result} successfully msg=Can not poweron ${src['onu']} values=False |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 107 | ${timeStart}= Get Current Date |
| 108 | ${firstonustartup}= Get ONU Startup Duration ${firstonu} ${timeStart} |
| 109 | # check MIB Template data stored in etcd |
| 110 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s |
| 111 | ... Verify MIB Template Data Available |
| 112 | # Start second Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 113 | ${src}= Set Variable ${hosts.src[${1}]} |
| 114 | Log ONU ${src['onu']}: startup without MIB upload cycle by using of template data of etcd. console=yes |
| 115 | ${result}= Exec Pod ${NAMESPACE} bbsim bbsimctl onu poweron ${src['onu']} |
| 116 | Should Contain ${result} successfully msg=Can not poweron ${src['onu']} values=False |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 117 | ${timeStart}= Get Current Date |
| 118 | ${secondonustartup}= Get ONU Startup Duration ${secondonu} ${timeStart} |
| 119 | # compare both durations, second onu should be at least 3 times faster |
| 120 | ${status} Evaluate ${firstonustartup}>=${secondonustartup}*3 |
| 121 | Should Be True ${status} |
| 122 | ... Startup durations (${firstonustartup} and ${secondonustartup}) do not full fill the requirements of 1/10. |
| 123 | |
| 124 | Get ONU Startup Duration |
| 125 | [Documentation] This keyword delivers startup duration of onu |
| 126 | [Arguments] ${onu} ${starttime} |
| 127 | ${src}= Set Variable ${hosts.src[${onu}]} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 128 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= |
| 129 | ... Map State ${state2test} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 130 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 131 | ... Validate Device ${admin_state} ${oper_status} ${connect_status} |
| 132 | ... ${src['onu']} onu=True onu_reason=${onu_state} |
| 133 | ${timeCurrent} = Get Current Date |
| 134 | ${timeTotalMs} = Subtract Date From Date ${timeCurrent} ${startTime} result_format=number |
| 135 | Log ONU ${src['onu']}: reached the state ${onu_state} after ${timeTotalMs} sec. console=yes |
| 136 | [Return] ${timeTotalMs} |