go.ligato.io/vpp-agent/v3@v3.5.0/tests/robot/libraries/vpp.robot (about)

     1  *** Keywords ***
     2  Open VPP terminal
     3      [Arguments]    ${node}
     4      ${out}=    Write To Machine    ${node}    telnet localhost 5002
     5      Should Contain     ${out}     vpp#
     6  
     7  Close VPP terminal
     8      [Arguments]    ${node}
     9      ${ctrl_c}          Evaluate    chr(int(3))
    10      ${command}=        Set Variable       ${ctrl_c}
    11      ${out}=            Write To Machine   ${node}    ${command}
    12      [Return]           ${out}
    13  
    14  # TODO: this will not work in case there is physical int
    15  Start VPP
    16      [Arguments]    ${node}
    17      Write To Container Until Prompt     ${node}     vpp unix { cli-listen localhost:5002 } plugins { plugin dpdk_plugin.so { disable } }
    18      ${out}=     Write To Container Until Prompt    ${node}     ps aux | grep vpp
    19      Should Contain        ${out}      unix { cli-listen localhost:5002 } plugins { plugin dpdk_plugin.so { disable } }
    20  
    21  Stop VPP
    22      [Arguments]    ${node}
    23      Write To Machine    ${node}     pgrep -f vpp | xargs kill -15
    24  
    25  # TODO: refactoring needed, this will block docker connection with telnet
    26  Wait until VPP successful load
    27      [Arguments]    ${node}    ${retries}=5x    ${delay}=1s
    28      wait until keyword succeeds    ${retries}   ${delay}   Try connect to VPP terminal    ${node}
    29  
    30  
    31  Try connect to VPP terminal
    32      [Arguments]    ${node}
    33      ${out}=    Write To Machine    docker    telnet localhost ${${node}_VPP_HOST_PORT}
    34      Should Contain    ${out}    vpp#
    35  
    36  Execute In VPP
    37      [Arguments]              ${container}       ${command}
    38      Switch Connection        docker
    39      ${out}   ${stderr}=      Execute Command    ${DOCKER_COMMAND} exec -it ${container} vppctl ${command}    return_stderr=True
    40      ${currdate}=             Get Current Date
    41      ${status}=               Run Keyword And Return Status    Should be Empty    ${stderr}
    42      Run Keyword If           ${status}==False         Log     One or more error occured during execution of a command ${command} in container ${container}    level=WARN
    43      Append To File           ${RESULTS_FOLDER}/output_${container}_term.log    *** Time:${currdate} Command: ${command}${\n}${out}${\n}
    44      Append To File           ${RESULTS_FOLDER_SUITE}/output_${container}_term.log    *** Time:${currdate} Command: ${command}${\n}${out}${\n}
    45      Run Keyword If           ${status}==False      Append To File           ${RESULTS_FOLDER}/output_${container}_term.log      *** Error: ${stderr}${\n}
    46      Run Keyword If           ${status}==False      Append To File           ${RESULTS_FOLDER_SUITE}/output_${container}_term.log      *** Error: ${stderr}${\n}
    47      [Return]                 ${out}
    48