TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test states of ONU Go adapter |
| 3 | Suite Setup Setup Suite |
| 4 | Suite Teardown Teardown Suite |
| 5 | Test Setup Setup |
| 6 | Test Teardown Teardown |
| 7 | Library Collections |
| 8 | Library String |
| 9 | Library OperatingSystem |
| 10 | Library XML |
| 11 | Library RequestsLibrary |
| 12 | Library ../../libraries/DependencyLibrary.py |
| 13 | Resource ../../libraries/onos.robot |
| 14 | Resource ../../libraries/voltctl.robot |
| 15 | Resource ../../libraries/voltha.robot |
| 16 | Resource ../../libraries/utils.robot |
| 17 | Resource ../../libraries/k8s.robot |
| 18 | Resource ../../variables/variables.robot |
| 19 | |
| 20 | *** Variables *** |
| 21 | ${POD_NAME} flex-ocp-cord |
| 22 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 23 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 24 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 25 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 26 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 27 | ${VOLTHA_POD_NUM} 8 |
| 28 | ${NAMESPACE} voltha |
| 29 | # For below variable value, using deployment name as using grep for |
| 30 | # parsing radius pod name, we can also use full radius pod name |
| 31 | ${RESTART_POD_NAME} radius |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 32 | ${timeout} 180s |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 33 | ${of_id} 0 |
| 34 | ${logical_id} 0 |
| 35 | ${has_dataplane} True |
| 36 | ${external_libs} True |
| 37 | ${teardown_device} True |
| 38 | ${scripts} ../../scripts |
| 39 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 40 | ${container_log_dir} ${None} |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 41 | # state to test variable, can be passed via the command line too, valid values: 1-6 |
| 42 | # 1 -> activating-onu |
| 43 | # 2 -> starting-openomci |
| 44 | # 3 -> discovery-mibsync-complete |
| 45 | # 4 -> initial-mib-downloaded |
| 46 | # 5 -> tech-profile-config-download-success |
| 47 | # 6 -> omci-flows-pushed |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 48 | ${state2test} 6 |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 49 | # test mode variable, can be passed via the command line too, valid values: SingleState, Up2State, SingleStateTime |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 50 | ${testmode} SingleState |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 51 | # flag for execute Tech Profile check, can be passed via the command line too |
| 52 | ${profiletest} True |
| 53 | # used tech profile, can be passed via the command line too, valid values: default, 1T4GEM, 1T8GEM |
| 54 | ${techprofile} default |
| 55 | # flag for execute port test, can be passed via the command line too |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 56 | ${porttest} True |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 57 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 58 | ${debugmode} False |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 59 | # logging flag to enable Collect Logs, can be passed via the command line too |
TorstenThieme | 5e324e4 | 2020-07-27 09:36:16 +0000 | [diff] [blame] | 60 | ${logging} False |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 61 | # if True execution will be paused before clean up |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 62 | ${pausebeforecleanup} False |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 63 | ${data_dir} ../data |
| 64 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 65 | |
| 66 | *** Test Cases *** |
| 67 | ONU State Test |
| 68 | [Documentation] Validates the ONU Go adapter states |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 69 | [Tags] statetest onutest |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 70 | [Setup] Run Keywords Start Logging ONUStateTest |
| 71 | ... AND Setup Test |
| 72 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 73 | Enable Device ${olt_device_id} |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 74 | ${timeStart} = Get Current Date |
| 75 | Set Global Variable ${timeStart} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 76 | Run Keyword If "${testmode}"=="SingleState" Do ONU Single State Test |
| 77 | ... ELSE IF "${testmode}"=="Up2State" Do ONU Up To State Test |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 78 | ... ELSE IF "${testmode}"=="SingleStateTime" Do ONU Single State Test Time |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 79 | ... ELSE Fail The testmode (${testmode}) is not valid! |
TorstenThieme | 5e324e4 | 2020-07-27 09:36:16 +0000 | [diff] [blame] | 80 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 81 | ... AND Stop Logging ONUStateTest |
| 82 | |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 83 | Check Loaded Tech Profile |
| 84 | [Documentation] Validates the loaded Tech Profile |
| 85 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
| 86 | ... Check will be executed only the reached ONU state is 5 (tech-profile-config-download-success) or higher |
| 87 | [Tags] onutest |
| 88 | [Setup] Start Logging ONUCheckTechProfile |
| 89 | Run Keyword If ${state2test}>=5 and ${profiletest} Do Check Tech Profile |
| 90 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 91 | ... AND Stop Logging ONUCheckTechProfile |
| 92 | |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 93 | Onu Port Check |
| 94 | [Documentation] Validates the ONU Go adapter states |
TorstenThieme | 0095868 | 2020-06-19 11:29:31 +0000 | [diff] [blame] | 95 | ... Assuming that ONU State Test was executed where all the ONUs are reached the expected state! |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 96 | [Tags] onutest |
| 97 | [Setup] Start Logging ONUPortTest |
| 98 | Run Keyword If ${porttest} Do Onu Port Check |
TorstenThieme | 5e324e4 | 2020-07-27 09:36:16 +0000 | [diff] [blame] | 99 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 100 | ... AND Stop Logging ONUPortTest |
| 101 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 102 | *** Keywords *** |
| 103 | Setup Suite |
| 104 | [Documentation] Set up the test suite |
| 105 | Common Test Suite Setup |
| 106 | Run Keyword If ${num_onus}>4 Calculate Timeout |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 107 | Run Keyword If "${techprofile}"=="default" Log To Console \nTechProfile:default |
| 108 | ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM |
| 109 | ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM |
| 110 | ... ELSE Fail The TechProfile (${techprofile}) is not valid! |
| 111 | ${onos_ssh_connection} Open ONOS SSH Connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 112 | Set Suite Variable ${onos_ssh_connection} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 113 | |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 114 | Teardown Suite |
| 115 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 116 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 117 | ... Furthermore gives the possibility to pause the execution. |
| 118 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 119 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 120 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 121 | # Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM |
| 122 | Wait for Ports in ONOS ${onos_ssh_connection} 0 BBSM |
| 123 | Close ONOS SSH Connection ${onos_ssh_connection} |
| 124 | Remove Tech Profile |
TorstenThieme | b41007d | 2020-06-22 12:14:12 +0000 | [diff] [blame] | 125 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 126 | Setup Test |
| 127 | [Documentation] Pre-test Setup |
| 128 | #test for empty device list |
| 129 | Test Empty Device List |
| 130 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up |
Suchitra Vemuri | b7253a5 | 2020-07-14 22:35:17 -0700 | [diff] [blame] | 131 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 132 | Run Keyword If ${has_dataplane} Sleep 60s |
| 133 | #create/preprovision device |
| 134 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 135 | Set Suite Variable ${olt_device_id} |
| 136 | #validate olt states |
| 137 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN |
| 138 | ... ${olt_device_id} |
| 139 | Sleep 5s |
| 140 | |
| 141 | Calculate Timeout |
| 142 | [Documentation] Calculates the timeout regarding num-onus in case of more than 4 onus |
| 143 | ${timeout} Fetch From Left ${timeout} s |
| 144 | ${timeout}= evaluate ${timeout}+((${num_onus}-4)*30) |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 145 | ${timeout}= Set Variable If (not ${debugmode}) and (${timeout}>600) 600 ${timeout} |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 146 | ${timeout}= Catenate SEPARATOR= ${timeout} s |
| 147 | Set Suite Variable ${timeout} |
| 148 | #Log \r\nTimeout: ${timeout} INFO console=True |
| 149 | |
| 150 | Do ONU Up To State Test |
| 151 | [Documentation] This keyword performs Up2State Test |
| 152 | ... All states up to the passed have to be checked |
| 153 | FOR ${I} IN RANGE 0 ${num_onus} |
| 154 | ${src}= Set Variable ${hosts.src[${I}]} |
| 155 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 156 | Run Keyword If ${state2test}>=1 |
| 157 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 158 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 159 | ... ${src['onu']} onu=True onu_reason=activating-onu |
| 160 | Run Keyword If ${state2test}>=2 |
| 161 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 162 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 163 | ... ${src['onu']} onu=True onu_reason=starting-openomci |
| 164 | Run Keyword If ${state2test}>=3 |
| 165 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 166 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 167 | ... ${src['onu']} onu=True onu_reason=discovery-mibsync-complete |
| 168 | Run Keyword If ${state2test}>=4 |
| 169 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 170 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 171 | ... ${src['onu']} onu=True onu_reason=initial-mib-downloaded |
| 172 | Run Keyword If ${state2test}>=5 |
| 173 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 174 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 175 | ... ${src['onu']} onu=True onu_reason=tech-profile-config-download-success |
| 176 | Run Keyword If ${state2test}>=6 |
| 177 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 178 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 179 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 180 | END |
| 181 | |
| 182 | Do ONU Single State Test |
| 183 | [Documentation] This keyword performs SingleState Test |
| 184 | ... Only the passed state has to be checked |
| 185 | FOR ${I} IN RANGE 0 ${num_onus} |
| 186 | ${src}= Set Variable ${hosts.src[${I}]} |
| 187 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 188 | Run Keyword If ${state2test}==1 |
| 189 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 190 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 191 | ... ${src['onu']} onu=True onu_reason=activating-onu |
| 192 | ... ELSE IF ${state2test}==2 |
| 193 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 194 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 195 | ... ${src['onu']} onu=True onu_reason=starting-openomci |
| 196 | ... ELSE IF ${state2test}==3 |
| 197 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 198 | ... Validate Device ENABLED ACTIVATING REACHABLE |
| 199 | ... ${src['onu']} onu=True onu_reason=discovery-mibsync-complete |
| 200 | ... ELSE IF ${state2test}==4 |
| 201 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 202 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 203 | ... ${src['onu']} onu=True onu_reason=initial-mib-downloaded |
| 204 | ... ELSE IF ${state2test}==5 |
| 205 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 206 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 207 | ... ${src['onu']} onu=True onu_reason=tech-profile-config-download-success |
| 208 | ... ELSE IF ${state2test}==6 |
| 209 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 210 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 211 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 212 | ... ELSE Fail The state to test (${state2test}) is not valid! |
| 213 | END |
| 214 | |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 215 | Do ONU Single State Test Time |
| 216 | [Documentation] This keyword performs SingleState Test with calculate running time |
| 217 | ... Only the passed state has to be checked and the duration each single onu adapter needed |
| 218 | ... will be calculated and printed out |
| 219 | ${ListfinishedONUs} Create List |
| 220 | Set Global Variable ${ListfinishedONUs} |
| 221 | Create File ONU_Startup_Time.txt This file contains the startup times of all ONUs. |
| 222 | ${list_onus} Create List |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 223 | Build ONU SN List ${list_onus} |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 224 | Run Keyword If ${state2test}==1 |
| 225 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 226 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 227 | ... activating-onu ${list_onus} ${timeStart} print2console=True |
| 228 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 229 | ... ELSE IF ${state2test}==2 |
| 230 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 231 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 232 | ... starting-openomci ${list_onus} ${timeStart} print2console=True |
| 233 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 234 | ... ELSE IF ${state2test}==3 |
| 235 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 236 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 237 | ... discovery-mibsync-complete ${list_onus} ${timeStart} print2console=True |
| 238 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 239 | ... ELSE IF ${state2test}==4 |
| 240 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 241 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 242 | ... initial-mib-downloaded ${list_onus} ${timeStart} print2console=True |
| 243 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 244 | ... ELSE IF ${state2test}==5 |
| 245 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 246 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 247 | ... tech-profile-config-download-success ${list_onus} ${timeStart} print2console=True |
| 248 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 249 | ... ELSE IF ${state2test}==6 |
| 250 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 251 | ... Validate ONU Devices MIB State With Duration |
TorstenThieme | 401af43 | 2020-06-11 15:53:53 +0000 | [diff] [blame] | 252 | ... omci-flows-pushed ${list_onus} ${timeStart} print2console=True |
| 253 | ... output_file=ONU_Startup_Time.txt |
TorstenThieme | 94e4ae4 | 2020-05-18 13:01:42 +0000 | [diff] [blame] | 254 | ... ELSE Fail The state to test (${state2test}) is not valid! |
| 255 | |
TorstenThieme | 1619db2 | 2020-04-03 12:01:15 +0000 | [diff] [blame] | 256 | Do Onu Port Check |
TorstenThieme | 0095868 | 2020-06-19 11:29:31 +0000 | [diff] [blame] | 257 | [Documentation] Check that all the UNI ports show up in ONOS |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 258 | # Wait for Ports in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${num_onus} BBSM |
| 259 | Wait for Ports in ONOS ${onos_ssh_connection} ${num_onus} BBSM |
TorstenThieme | 9949b17 | 2020-06-16 10:00:15 +0000 | [diff] [blame] | 260 | |
TorstenThieme | e0e5bba | 2020-08-05 11:20:13 +0000 | [diff] [blame] | 261 | Set Tech Profile |
| 262 | [Documentation] This keyword set the passed TechProfile for the test |
| 263 | [Arguments] ${TechProfile} |
| 264 | Log To Console \nTechProfile:${TechProfile} |
| 265 | ${namespace}= Set Variable default |
| 266 | ${podname}= Set Variable etcd-0 |
| 267 | ${src}= Set Variable ${data_dir}/TechProfile-${TechProfile}.json |
| 268 | ${dest}= Set Variable /tmp/flexpod.json |
| 269 | ${command} Catenate |
| 270 | ... /bin/sh -c 'cat ${dest} | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/XGS-PON/64' |
| 271 | Copy File To Pod ${namespace} ${podname} ${src} ${dest} |
| 272 | Exec Pod ${namespace} ${podname} ${command} |
| 273 | ${commandget} Catenate |
| 274 | ... /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/XGS-PON/64' |
| 275 | Exec Pod ${namespace} ${podname} ${commandget} |
| 276 | |
| 277 | Remove Tech Profile |
| 278 | [Documentation] This keyword removes TechProfile |
| 279 | Log To Console \nTechProfile:${TechProfile} |
| 280 | ${namespace}= Set Variable default |
| 281 | ${podname}= Set Variable etcd-0 |
| 282 | ${command} Catenate |
| 283 | ... /bin/sh -c 'ETCDCTL_API=3 etcdctl del --prefix service/voltha/technology_profiles/XGS-PON/64' |
| 284 | Exec Pod ${namespace} ${podname} ${command} |
| 285 | ${commandget} Catenate |
| 286 | ... /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/XGS-PON/64' |
| 287 | Exec Pod ${namespace} ${podname} ${commandget} |
| 288 | |
| 289 | Do Check Tech Profile |
| 290 | [Documentation] This keyword checks the loaded TechProfile |
| 291 | ${namespace}= Set Variable default |
| 292 | ${podname}= Set Variable etcd-0 |
| 293 | ${commandget} Catenate |
| 294 | ... /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/XGS-PON/64' |
| 295 | ${result}= Exec Pod ${namespace} ${podname} ${commandget} |
| 296 | ${num_gem_ports}= Set Variable 1 |
| 297 | ${num_gem_ports}= Set Variable If |
| 298 | ... "${techprofile}"=="default" 1 |
| 299 | ... "${techprofile}"=="1T4GEM" 4 |
| 300 | ... "${techprofile}"=="1T8GEM" 8 |
| 301 | @{resultList} Split String ${result} separator=, |
| 302 | ${num_of_count_matches}= Get Match Count ${resultList} "num_gem_ports": ${num_gem_ports} |
| 303 | ... whitespace_insensitive=True |
| 304 | ${num_of_expected_matches}= Run Keyword If "${techprofile}"=="default" Evaluate ${num_onus} |
| 305 | ... ELSE Evaluate ${num_onus}+1 |
| 306 | Run Keyword If ${num_of_expected_matches}!=${num_of_count_matches} Log To Console |
| 307 | ... \nTechProfile (${TechProfile}) not loaded correctly:${num_of_count_matches} of ${num_of_expected_matches} |