go.ligato.io/vpp-agent/v3@v3.5.0/tests/robot/suites/crudIPv6/veth_crudIPv6.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     IPv6
    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  ${VETH1_MAC}=          1a:00:00:11:11:11
    29  ${VETH1_SEC_MAC}=      1a:00:00:11:11:12
    30  ${VETH2_MAC}=          2a:00:00:22:22:22
    31  ${VETH3_MAC}=          3a:00:00:33:33:33
    32  ${VETH4_MAC}=          4a:00:00:44:44:44
    33  ${VETHIP1}=            fd33::1:b:0:0:1
    34  ${VETHIP2}=            fd31::1:b:0:0:1
    35  ${VETHIP3}=            fd33::1:b:0:0:2
    36  ${WAIT_TIMEOUT}=       20s
    37  ${SYNC_SLEEP}=         2s
    38  
    39  *** Test Cases ***
    40  Configure Environment
    41      [Tags]    setup
    42      Configure Environment 1
    43  
    44  Show Interfaces Before Setup
    45      vpp_term: Show Interfaces    agent_vpp_1
    46  
    47  Add Veth1 Interface
    48      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH1_MAC}
    49      Put Veth Interface With IP    node=agent_vpp_1    name=vpp1_veth1
    50      ...    mac=${VETH1_MAC}    peer=vpp1_veth2    ip=${VETHIP1}    prefix=64    mtu=1500
    51      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH1_MAC}
    52  
    53  Add Veth2 Interface
    54      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH2_MAC}
    55      Put Veth Interface    node=agent_vpp_1    name=vpp1_veth2
    56      ...    mac=${VETH2_MAC}    peer=vpp1_veth1
    57  
    58  Check That Veth1 And Veth2 Interfaces Are Created
    59      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    60      ...    linux: Interface Is Created    node=agent_vpp_1    mac=${VETH1_MAC}
    61      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    62      ...    linux: Interface Is Created    node=agent_vpp_1    mac=${VETH2_MAC}
    63      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    64      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth1
    65      ...    mac=${VETH1_MAC}    ipv6=${VETHIP1}/64    mtu=1500    state=up
    66      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    67      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth2
    68      ...    mac=${VETH2_MAC}    state=up
    69  
    70  Add Veth3 Interface
    71      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH3_MAC}
    72      Put Veth Interface With IP    node=agent_vpp_1    name=vpp1_veth3
    73      ...    mac=${VETH3_MAC}    peer=vpp1_veth4    ip=${VETHIP2}   prefix=64    mtu=1500
    74      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH3_MAC}
    75  
    76  Add Veth4 Interface
    77      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH4_MAC}
    78      Put Veth Interface    node=agent_vpp_1    name=vpp1_veth4
    79      ...    mac=${VETH4_MAC}    peer=vpp1_veth3    enabled=false
    80  
    81  Check That Veth3 And Veth4 Interfaces Are Created
    82      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    83      ...    linux: Interface Is Created    node=agent_vpp_1    mac=${VETH3_MAC}
    84      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    85      ...    linux: Interface Is Created    node=agent_vpp_1    mac=${VETH4_MAC}
    86      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    87      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth3
    88      ...    mac=${VETH3_MAC}    ipv6=${VETHIP2}/64    mtu=1500    state=lowerlayerdown
    89      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    90      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth4
    91      ...    mac=${VETH4_MAC}    state=down
    92  
    93  Check That Veth1 And Veth2 Interfaces Are Still Configured
    94      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    95      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth1
    96      ...    mac=${VETH1_MAC}    ipv6=${VETHIP1}/64    mtu=1500    state=up
    97      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    98      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth2
    99      ...    mac=${VETH2_MAC}    state=up
   100  
   101  Update Veth1 Interface
   102      Put Veth Interface With IP    node=agent_vpp_1    name=vpp1_veth1
   103      ...    mac=${VETH1_SEC_MAC}    peer=vpp1_veth2    ip=${VETHIP3}    prefix=64    mtu=1600
   104      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   105      ...    linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH1_MAC}
   106      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   107      ...    linux: Interface Is Created    node=agent_vpp_1    mac=${VETH1_SEC_MAC}
   108      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   109      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth1
   110      ...    mac=${VETH1_SEC_MAC}    ipv6=${VETHIP3}/64    mtu=1600    state=up
   111  
   112  Check That Veth2 And Veth3 And Veth4 interfaces Are Still Configured
   113      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   114      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth2
   115      ...    mac=${VETH2_MAC}    state=up
   116      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   117      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth3
   118      ...    mac=${VETH3_MAC}    ipv6=${VETHIP2}/64    mtu=1500    state=lowerlayerdown
   119      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   120      ...    linux: Check Veth Interface State     agent_vpp_1    vpp1_veth4
   121      ...    mac=${VETH4_MAC}    state=down
   122  
   123  Delete Veth2 Interface
   124      Delete Linux Interface    node=agent_vpp_1    name=vpp1_veth2
   125      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   126      ...    linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH1_SEC_MAC}
   127      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   128      ...    linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH2_MAC}
   129  
   130  Check That Veth3 And Veth4 Are Still Configured
   131      linux: Check Veth Interface State     agent_vpp_1    vpp1_veth3
   132      ...    mac=${VETH3_MAC}    ipv6=${VETHIP2}/64    mtu=1500    state=lowerlayerdown
   133      linux: Check Veth Interface State     agent_vpp_1    vpp1_veth4
   134      ...    mac=${VETH4_MAC}    state=down
   135  
   136  Delete Veth3 Interface
   137      Delete Linux Interface    node=agent_vpp_1    name=vpp1_veth3
   138      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   139      ...    linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH3_MAC}
   140      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   141      ...    linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH4_MAC}
   142  
   143  Show Interfaces And Other Objects After Setup
   144      vpp_term: Show Interfaces    agent_vpp_1
   145      vpp_term: Show Interfaces    agent_vpp_2
   146      Write To Machine    agent_vpp_1_term    show int addr
   147      Write To Machine    agent_vpp_2_term    show int addr
   148      Write To Machine    agent_vpp_1_term    show h
   149      Write To Machine    agent_vpp_2_term    show h
   150      Write To Machine    agent_vpp_1_term    show br
   151      Write To Machine    agent_vpp_2_term    show br
   152      Write To Machine    agent_vpp_1_term    show br 1 detail
   153      Write To Machine    agent_vpp_2_term    show br 1 detail
   154      Write To Machine    agent_vpp_1_term    show err
   155      Write To Machine    agent_vpp_2_term    show err
   156      vpp_api: Interfaces Dump    agent_vpp_1
   157      vpp_api: Interfaces Dump    agent_vpp_2
   158      Execute In Container    agent_vpp_1    ip a
   159      Execute In Container    agent_vpp_2    ip a
   160  
   161  *** Keywords ***
   162  TestSetup
   163      Make Datastore Snapshots    ${TEST_NAME}_test_setup
   164  
   165  TestTeardown
   166      Make Datastore Snapshots    ${TEST_NAME}_test_teardown
   167