<commit_before># Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
Library           Process
Library           ../common/auto_test.py
Library           ../common/volthaMngr.py
Library           ../common/preprovisioning.py
Library           volthaMngr.VolthaMngr
LIbrary           preprovisioning.Preprovisioning

Test Setup        Start Voltha      
Test Teardown     Stop Voltha


*** Variables ***
${LOG_DIR}        /tmp/voltha_test_results
${ROOT_DIR}       ${EMPTY}
${VOLTHA_DIR}     ${EMPTY}
${PONSIM_PID}     ${EMPTY}
${ONOS_SSH_PORT}  8101
${OLT_IP_ADDR}    olt.voltha.svc
${OLT_PORT_ID}    50060


*** Test Cases ***
Provisioning
    [Documentation]     VOLTHA Pre-provisioning
    ...                 This test preprovisions a ponsim-OLT with given IP address and TCP port 
    ...                 and then enables both it and a number of ponsim-ONUs with predefined IP/port
    ...                 information. It then verifies that all the physical and logical devices are ACTIVE
    ...                 and REACHEABLE
    PSet Log Dirs    ${LOG_DIR}
    Configure   ${OLT_IP_ADDR}    ${OLT_PORT_ID}
    Preprovision Olt
    Query Devices Before Enable
    Enable
    Query Devices After Enable


*** Keywords ***
Start Voltha
    [Documentation]     Start Voltha infrastructure to run test(s). This includes starting all 
    ...                 Kubernetes Pods and start collection of logs. PonsimV2 has now been
    ...                 containerized and does not need to be managed separately
    ${ROOT_DIR}  ${VOLTHA_DIR}  ${LOG_DIR}      Dir Init    ${LOG_DIR}
    VSet Log Dirs  ${ROOT_DIR}    ${VOLTHA_DIR}    ${LOG_DIR}
    Stop Voltha
    Start All Pods<commit_msg>polling after provisioning olt device in robot test<commit_after># Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
Library           Process
Library           ../common/auto_test.py
Library           ../common/volthaMngr.py
Library           ../common/preprovisioning.py
Library           volthaMngr.VolthaMngr
LIbrary           preprovisioning.Preprovisioning

Test Setup        Start Voltha      
Test Teardown     Stop Voltha


*** Variables ***
${LOG_DIR}        /tmp/voltha_test_results
${ROOT_DIR}       ${EMPTY}
${VOLTHA_DIR}     ${EMPTY}
${PONSIM_PID}     ${EMPTY}
${ONOS_SSH_PORT}  8101
${OLT_IP_ADDR}    olt.voltha.svc
${OLT_PORT_ID}    50060


*** Test Cases ***
Provisioning
    [Documentation]     VOLTHA Pre-provisioning
    ...                 This test preprovisions a ponsim-OLT with given IP address and TCP port 
    ...                 and then enables both it and a number of ponsim-ONUs with predefined IP/port
    ...                 information. It then verifies that all the physical and logical devices are ACTIVE
    ...                 and REACHEABLE
    PSet Log Dirs    ${LOG_DIR}
    Configure   ${OLT_IP_ADDR}    ${OLT_PORT_ID}
    Preprovision Olt
    Wait Until Keyword Succeeds    60s    2s    Query Devices Before Enable
    Enable
    Wait Until Keyword Succeeds    60s    2s    Query Devices After Enable


*** Keywords ***
Start Voltha
    [Documentation]     Start Voltha infrastructure to run test(s). This includes starting all 
    ...                 Kubernetes Pods and start collection of logs. PonsimV2 has now been
    ...                 containerized and does not need to be managed separately
    ${ROOT_DIR}  ${VOLTHA_DIR}  ${LOG_DIR}      Dir Init    ${LOG_DIR}
    VSet Log Dirs  ${ROOT_DIR}    ${VOLTHA_DIR}    ${LOG_DIR}
    Stop Voltha
    Start All Pods
    Sleep    60
{'fraction_non_alphanumeric': 0.07635893011216566, 'fraction_numerical': 0.009490940465918895, 'mean_word_length': 2.5208807896735004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6197639', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1301, 'n_words': 490}