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

     1  *** Settings ***
     2  Library      OperatingSystem
     3  #Library      RequestsLibrary
     4  #Library      SSHLibrary      timeout=60s
     5  #Library      String
     6  
     7  Resource     ../../variables/${VARIABLES}_variables.robot
     8  
     9  Resource     ../../libraries/vpp_api.robot
    10  Resource     ../../libraries/vpp_term.robot
    11  Resource     ../../libraries/docker.robot
    12  Resource     ../../libraries/setup-teardown.robot
    13  Resource     ../../libraries/configurations.robot
    14  Resource     ../../libraries/etcdctl.robot
    15  Resource     ../../libraries/linux.robot
    16  
    17  Resource     ../../libraries/interface/interface_generic.robot
    18  
    19  Force Tags        crud     IPv4
    20  Suite Setup       Testsuite Setup
    21  Suite Teardown    Testsuite Teardown
    22  Test Setup        TestSetup
    23  Test Teardown     TestTeardown
    24  
    25  *** Variables ***
    26  ${VARIABLES}=        common
    27  ${ENV}=              common
    28  ${NAME_TAP1}=        vpp1_tap1
    29  ${NAME_TAP2}=        vpp1_tap2
    30  ${MAC_TAP1}=         12:21:21:11:11:11
    31  ${MAC_TAP1_2}=       22:21:21:11:11:11
    32  ${MAC_TAP2}=         22:21:21:22:22:22
    33  ${IP_TAP1}=          20.20.1.1
    34  ${IP_TAP1_2}=        21.20.1.1
    35  ${IP_TAP2}=          30.20.1.2
    36  ${PREFIX}=           24
    37  ${MTU}=              4800
    38  ${UP_STATE}=         up
    39  ${WAIT_TIMEOUT}=     20s
    40  ${SYNC_SLEEP}=       3s
    41  
    42  *** Test Cases ***
    43  Configure Environment
    44      [Tags]    setup
    45      Configure Environment 1
    46  
    47  Show Interfaces Before Setup
    48      ${interfaces}=    vpp_term: Show Interfaces    agent_vpp_1
    49  
    50  Add TAP1v2 Interface
    51      vpp_term: Interface Not Exists  node=agent_vpp_1    mac=${MAC_TAP1}
    52      Put TAPv2 Interface With IP    node=agent_vpp_1    name=${NAME_TAP1}    mac=${MAC_TAP1}
    53      ...    ip=${IP_TAP1}    prefix=${PREFIX}    host_if_name=linux_${NAME_TAP1}
    54  
    55  Check TAP1v2 Interface Is Created
    56      ${interfaces}=       vpp_api: Interfaces Dump    node=agent_vpp_1
    57      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    58      ...    vpp_term: Interface Is Created    node=agent_vpp_1    mac=${MAC_TAP1}
    59      ${actual_state}=    vpp_term: Check TAPv2 interface State    agent_vpp_1    ${NAME_TAP1}
    60      ...    mac=${MAC_TAP1}    ipv4=${IP_TAP1}/${PREFIX}    state=${UP_STATE}
    61  
    62  Add TAP2v2 Interface
    63      vpp_term: Interface Not Exists  node=agent_vpp_1    mac=${MAC_TAP2}
    64      Put TAPv2 Interface With IP    node=agent_vpp_1    name=${NAME_TAP2}    mac=${MAC_TAP2}
    65      ...    ip=${IP_TAP2}    prefix=${PREFIX}    host_if_name=linux_${NAME_TAP2}
    66  
    67  Check TAP2v2 Interface Is Created
    68      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    69      ...    vpp_term: Interface Is Created    node=agent_vpp_1    mac=${MAC_TAP2}
    70      ${actual_state}=    vpp_term: Check TAPv2 interface State    agent_vpp_1    ${NAME_TAP2}
    71      ...    mac=${MAC_TAP2}    ipv4=${IP_TAP2}/${PREFIX}    state=${UP_STATE}
    72  
    73  Check TAP1v2 Interface Is Still Configured
    74      ${actual_state}=    vpp_term: Check TAPv2 interface State    agent_vpp_1    ${NAME_TAP1}
    75      ...    mac=${MAC_TAP1}    ipv4=${IP_TAP1}/${PREFIX}    state=${UP_STATE}
    76  
    77  Update TAP1v2 Interface
    78      Put TAPv2 Interface With IP    node=agent_vpp_1    name=${NAME_TAP1}    mac=${MAC_TAP1_2}
    79      ...    ip=${IP_TAP1_2}    prefix=${PREFIX}    host_if_name=linux_${NAME_TAP1}
    80  
    81  Check TAP1_2v2 Interface Is Created
    82      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    83      ...    vpp_term: Interface Is Created    node=agent_vpp_1    mac=${MAC_TAP1_2}
    84      ${actual_state}=    vpp_term: Check TAPv2 interface State    agent_vpp_1    ${NAME_TAP1}
    85      ...    mac=${MAC_TAP1_2}    ipv4=${IP_TAP1_2}/${PREFIX}    state=${UP_STATE}
    86  
    87  Check TAP2v2 Interface Has Not Changed
    88      ${actual_state}=    vpp_term: Check TAPv2 interface State    agent_vpp_1    ${NAME_TAP2}
    89      ...    mac=${MAC_TAP2}    ipv4=${IP_TAP2}/${PREFIX}    state=${UP_STATE}
    90  
    91  Delete TAP1_2v2 Interface
    92      Delete VPP Interface    agent_vpp_1    ${NAME_TAP1}
    93  
    94  Check TAP1_2v2 Interface Has Been Deleted
    95      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    96      ...    vpp_term: Interface Not Exists  node=agent_vpp_1    mac=${MAC_TAP1_2}
    97  
    98  Check TAP2 Interface Is Still Configured
    99      ${actual_state}=    vpp_term: Check TAPv2 interface State    agent_vpp_1    ${NAME_TAP2}
   100      ...    mac=${MAC_TAP2}    ipv4=${IP_TAP2}/${PREFIX}    state=${UP_STATE}
   101  
   102  Show Interfaces And Other Objects After Setup
   103      vpp_term: Show Interfaces    agent_vpp_1
   104      Write To Machine    agent_vpp_1_term    show int addr
   105      Write To Machine    agent_vpp_1_term    show h
   106      Write To Machine    agent_vpp_1_term    show br
   107      Write To Machine    agent_vpp_1_term    show br 1 detail
   108      Write To Machine    agent_vpp_1_term    show err
   109      vpp_api: Interfaces Dump    agent_vpp_1
   110      Execute In Container    agent_vpp_1    ip a
   111  
   112  *** Keywords ***
   113  TestSetup
   114      Make Datastore Snapshots    ${TEST_NAME}_test_setup
   115  
   116  TestTeardown
   117      Make Datastore Snapshots    ${TEST_NAME}_test_teardown
   118  
   119