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

     1  *** Settings ***
     2  Library      OperatingSystem
     3  
     4  Resource     ../../variables/${VARIABLES}_variables.robot
     5  
     6  Resource     ../../libraries/vpp_api.robot
     7  Resource     ../../libraries/vpp_term.robot
     8  Resource     ../../libraries/docker.robot
     9  Resource     ../../libraries/setup-teardown.robot
    10  Resource     ../../libraries/configurations.robot
    11  Resource     ../../libraries/etcdctl.robot
    12  Resource     ../../libraries/linux.robot
    13  
    14  Resource     ../../libraries/bridge_domain/bridge_domain.robot
    15  Resource     ../../libraries/interface/vxlan.robot
    16  Resource     ../../libraries/interface/interface_generic.robot
    17  
    18  Force Tags        crud     IPv4
    19  Suite Setup       Testsuite Setup
    20  Suite Teardown    Testsuite Teardown
    21  Test Setup        TestSetup
    22  Test Teardown     TestTeardown
    23  
    24  *** Variables ***
    25  ${VARIABLES}=                    common
    26  ${ENV}=                          common
    27  ${WAIT_TIMEOUT}=                 20s
    28  ${SYNC_SLEEP}=                   3s
    29  @{BD1_INTERFACES}=               vpp1_memif1    vpp1_vxlan1    vpp1_afpacket1
    30  @{BD1_INTERFACES_UPDATED}=       vpp1_memif1    vpp1_vxlan1    bvi_vpp1_loop2
    31  @{BD1_INTERFACES_VX_DELETED}=    vpp1_memif1    bvi_vpp1_loop2
    32  @{BD2_INTERFACES}=               vpp1_memif2    vpp1_vxlan2    bvi_vpp1_loop3
    33  
    34  *** Test Cases ***
    35  Configure Environment
    36      [Tags]    setup
    37      Configure Environment 1
    38  
    39  Show Interfaces Before Setup
    40      vpp_term: Show Interfaces    agent_vpp_1
    41  
    42  Add Interfaces For BDs
    43      Put Memif Interface With IP    node=agent_vpp_1    name=vpp1_memif1    mac=62:61:61:61:61:61    master=true    id=1    ip=192.168.10.1
    44      Put Veth Interface With IP    node=agent_vpp_1    name=vpp1_veth1    mac=12:11:11:11:11:11    peer=vpp1_veth2    ip=10.10.1.1
    45      Put Veth Interface    node=agent_vpp_1    name=vpp1_veth2    mac=12:12:12:12:12:12    peer=vpp1_veth1
    46      Put Afpacket Interface    node=agent_vpp_1    name=vpp1_afpacket1    mac=a2:a1:a1:a1:a1:a1    host_int=vpp1_veth2
    47      Put VXLan Interface    node=agent_vpp_1    name=vpp1_vxlan1    src=192.168.1.1    dst=192.168.1.2    vni=5
    48      Put Loopback Interface With IP    node=agent_vpp_1    name=vpp1_loop1    mac=12:21:21:11:11:11    ip=20.20.1.1
    49      Put TAPv2 Interface With IP    node=agent_vpp_1    name=vpp1_tap1    mac=32:21:21:11:11:11    ip=30.30.1.1    host_if_name=linux_vpp1_tap1
    50      Put Memif Interface With IP    node=agent_vpp_1    name=vpp1_memif2    mac=62:61:61:61:61:62    master=true    id=2    ip=192.168.20.2
    51      Put VXLan Interface    node=agent_vpp_1    name=vpp1_vxlan2    src=192.168.2.1    dst=192.168.2.2    vni=15
    52      Put Loopback Interface With IP    node=agent_vpp_1    name=bvi_vpp1_loop2    mac=12:21:21:11:11:12    ip=20.20.2.1
    53      Put Loopback Interface With IP    node=agent_vpp_1    name=bvi_vpp1_loop3    mac=12:21:21:11:11:13    ip=20.20.3.1
    54  
    55  Add BD1 Bridge Domain
    56      vpp_api: No Bridge Domains Exist    agent_vpp_1
    57      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    Put Bridge Domain    node=agent_vpp_1    name=vpp1_bd1    ints=${BD1_INTERFACES}    flood=true    unicast=true    forward=true    learn=true    arp_term=true
    58  
    59  Check BD1 Is Created
    60      vpp_api: BD Is Created    agent_vpp_1    vpp1_bd1
    61      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd1  flood=1  unicast=1  forward=1  learn=1  arp_term=1  interfaces=${BD1_INTERFACES}  bvi_int=none
    62  
    63  Add BD2 Bridge Domain
    64      vpp_api: BD Not Exists    agent_vpp_1    vpp1_bd2
    65      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    Put Bridge Domain    node=agent_vpp_1    name=vpp1_bd2    ints=${BD2_INTERFACES}    flood=true    unicast=true    forward=true    learn=true    arp_term=true
    66  
    67  Check BD2 Is Created
    68      vpp_api: BD Is Created    agent_vpp_1    vpp1_bd2
    69      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd2  flood=1  unicast=1  forward=1  learn=1  arp_term=1  interfaces=${BD2_INTERFACES}  bvi_int=bvi_vpp1_loop3
    70  
    71  Check That BD1 Is Not Affected By Adding BD2
    72      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd1  flood=1  unicast=1  forward=1  learn=1  arp_term=1  interfaces=${BD1_INTERFACES}  bvi_int=none
    73  
    74  Update BD1
    75      Put Bridge Domain    node=agent_vpp_1    name=vpp1_bd1    ints=${BD1_INTERFACES_UPDATED}    flood=false    unicast=false    forward=false    learn=false    arp_term=false
    76      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd1  flood=0  unicast=0  forward=0  learn=0  arp_term=0  interfaces=${BD1_INTERFACES_UPDATED}  bvi_int=bvi_vpp1_loop2
    77  
    78  Check That BD2 Is Not Affected By Updating BD1
    79      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd2  flood=1  unicast=1  forward=1  learn=1  arp_term=1  interfaces=${BD2_INTERFACES}  bvi_int=bvi_vpp1_loop3
    80  
    81  Delete VXLan1 Interface
    82      Delete VPP Interface    node=agent_vpp_1    name=vpp1_vxlan1
    83      VXLan Tunnel Is Deleted    node=agent_vpp_1    src=192.168.1.1    dst=192.168.1.2    vni=5
    84  
    85  Check That VXLan1 Interface Is Deleted From BD1
    86      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd1  flood=0  unicast=0  forward=0  learn=0  arp_term=0  interfaces=${BD1_INTERFACES_VX_DELETED}  bvi_int=bvi_vpp1_loop2
    87  
    88  Readd VXLan1 Interface
    89      Put VXLan Interface    node=agent_vpp_1    name=vpp1_vxlan1    src=192.168.1.1    dst=192.168.1.2    vni=5
    90      VXLan Tunnel Is Created    node=agent_vpp_1    src=192.168.1.1    dst=192.168.1.2    vni=5
    91  
    92  Check That VXLan1 Interface Is Added To BD1
    93      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd1  flood=0  unicast=0  forward=0  learn=0  arp_term=0  interfaces=${BD1_INTERFACES_UPDATED}  bvi_int=bvi_vpp1_loop2
    94  
    95  Delete BD1 Bridge Domain
    96      Delete Bridge Domain    agent_vpp_1    vpp1_bd1
    97      vpp_api: BD Is Deleted    agent_vpp_1    vpp1_bd1
    98  
    99  Check That BD2 Is Not Affected By Deleting BD1
   100      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}    vpp_api: Check Bridge Domain State    agent_vpp_1  vpp1_bd2  flood=1  unicast=1  forward=1  learn=1  arp_term=1  interfaces=${BD2_INTERFACES}  bvi_int=bvi_vpp1_loop3
   101  
   102  Show Interfaces And Other Objects After Test
   103      vpp_term: Show Interfaces    agent_vpp_1
   104      vpp_term: Show Interfaces    agent_vpp_2
   105      Write To Machine    agent_vpp_1_term    show int addr
   106      Write To Machine    agent_vpp_2_term    show int addr
   107      Write To Machine    agent_vpp_1_term    show h
   108      Write To Machine    agent_vpp_2_term    show h
   109      Write To Machine    agent_vpp_1_term    show br
   110      Write To Machine    agent_vpp_2_term    show br
   111      Write To Machine    agent_vpp_1_term    show br 1 detail
   112      Write To Machine    agent_vpp_2_term    show br 1 detail
   113      Write To Machine    agent_vpp_1_term    show vxlan tunnel
   114      Write To Machine    agent_vpp_2_term    show vxlan tunnel
   115      Write To Machine    agent_vpp_1_term    show err
   116      Write To Machine    agent_vpp_2_term    show err
   117      vpp_api: Interfaces Dump    agent_vpp_1
   118      vat_term: Interfaces Dump    agent_vpp_2
   119      Execute In Container    agent_vpp_1    ip a
   120      Execute In Container    agent_vpp_2    ip a
   121  
   122  *** Keywords ***
   123  TestSetup
   124      Make Datastore Snapshots    ${TEST_NAME}_test_setup
   125  
   126  TestTeardown
   127      Make Datastore Snapshots    ${TEST_NAME}_test_teardown
   128