go.ligato.io/vpp-agent/v3@v3.5.0/tests/robot/suites/crudIPv6/afpacket_crudIPv6.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/interface/afpacket.robot
    15  Resource     ../../libraries/interface/interface_generic.robot
    16  
    17  Force Tags        crud     IPv6
    18  Suite Setup       Testsuite Setup
    19  Suite Teardown    Testsuite Teardown
    20  Test Setup        TestSetup
    21  Test Teardown     TestTeardown
    22  
    23  *** Variables ***
    24  ${VARIABLES}=          common
    25  ${ENV}=                common
    26  ${VETH1_MAC}=          1a:00:00:11:11:11
    27  ${VETH2_MAC}=          2a:00:00:22:22:22
    28  ${VETH3_MAC}=          3a:00:00:33:33:33
    29  ${VETH4_MAC}=          4a:00:00:44:44:44
    30  ${AFP1_MAC}=           a2:01:01:01:01:01
    31  ${AFP2_MAC}=           a2:02:02:02:02:02
    32  ${AFP2_SEC_MAC}=       a2:22:22:22:22:22
    33  ${IP_ADR}=             fd30:0:0:1:e::
    34  ${IP_ADR_MASK}=        fd30:0:0:1:e::/64
    35  ${IP_ADR2}=            fd30:0:0:2:f::
    36  ${IP_ADR_MASK2}=       fd30:0:0:2:f::/64
    37  ${WAIT_TIMEOUT}=       20s
    38  ${SYNC_SLEEP}=         3s
    39  
    40  *** Test Cases ***
    41  Configure Environment
    42      [Tags]    setup
    43      Configure Environment 1
    44  
    45  Show Interfaces Before Setup
    46      vpp_term: Show Interfaces    agent_vpp_1
    47  
    48  Add Veth1 And Veth2 Interfaces
    49      Put Veth Interface With IP    node=agent_vpp_1
    50      ...    name=vpp1_veth1    mac=${VETH1_MAC}    peer=vpp1_veth2
    51      ...    ip=${IP_ADR}    prefix=64    mtu=1500
    52      Put Veth Interface    node=agent_vpp_1
    53      ...    name=vpp1_veth2    mac=${VETH2_MAC}    peer=vpp1_veth1
    54  
    55  Add Afpacket1 Interface
    56      vpp_term: Interface Not Exists    node=agent_vpp_1    mac=${AFP1_MAC}
    57      Put Afpacket Interface    node=agent_vpp_1
    58      ...    name=vpp1_afpacket1    mac=${AFP1_MAC}    host_int=vpp1_veth2
    59  
    60  Check That Afpacket1 Interface Is Created
    61      vpp_term: Interface Is Created    node=agent_vpp_1    mac=${AFP1_MAC}
    62      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    63      ...    vpp_api: Check Afpacket Interface State    agent_vpp_1
    64      ...    vpp1_afpacket1    enabled=1    mac=${AFP1_MAC}
    65  
    66  Check That Veth1 And Veth2 Interfaces Are Created And Not Affected By Afpacket1 Interface
    67      linux: Interface Is Created    node=agent_vpp_1    mac=${VETH1_MAC}
    68      linux: Interface Is Created    node=agent_vpp_1    mac=${VETH2_MAC}
    69      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    70      ...    linux: Check Veth Interface State     agent_vpp_1
    71      ...    vpp1_veth1    mac=${VETH1_MAC}
    72      ...    ipv6=${IP_ADR_MASK}    mtu=1500    state=up
    73      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
    74      ...    linux: Check Veth Interface State     agent_vpp_1
    75      ...    vpp1_veth2    mac=${VETH2_MAC}    state=up
    76  
    77  Add Afpacket2 Interface Before Veth3 And Veth4 Interfaces
    78      vpp_term: Interface Not Exists    node=agent_vpp_1    mac=${AFP2_MAC}
    79      Put Afpacket Interface    node=agent_vpp_1
    80      ...    name=vpp1_afpacket2    mac=${AFP2_MAC}    host_int=vpp1_veth3
    81  
    82  Check That Afpacket2 Interface Is Not Created Without Veth3 And Veth4
    83      vpp_term: Interface Not Exists    node=agent_vpp_1    mac=${AFP2_MAC}
    84  
    85  Add Veth3 Interface
    86      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH3_MAC}
    87      Put Veth Interface With IP    node=agent_vpp_1
    88      ...    name=vpp1_veth3    mac=${VETH3_MAC}    peer=vpp1_veth4
    89      ...    ip=${IP_ADR2}    prefix=64    mtu=1500
    90      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH3_MAC}
    91  
    92  Check That Afpacket2 Is Not Created Without Veth4
    93      vpp_term: Interface Not Exists    node=agent_vpp_1    mac=${AFP2_MAC}
    94  
    95  Add Veth4 Interface
    96      linux: Interface Not Exists    node=agent_vpp_1    mac=${VETH4_MAC}
    97      Put Veth Interface    node=agent_vpp_1
    98      ...    name=vpp1_veth4    mac=${VETH4_MAC}    peer=vpp1_veth3    enabled=true
    99  
   100  Check That Afpacket2 Interface Is Created
   101      vpp_term: Interface Is Created    node=agent_vpp_1    mac=${AFP2_MAC}
   102      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   103      ...    vpp_api: Check Afpacket Interface State    agent_vpp_1
   104      ...    vpp1_afpacket2    enabled=1    mac=${AFP2_MAC}
   105  
   106  Check That Veth3 And Veth4 Interfaces Are Created And Not Affected By Afpacket2 Interface
   107      linux: Interface Is Created    node=agent_vpp_1    mac=${VETH3_MAC}
   108      linux: Interface Is Created    node=agent_vpp_1    mac=${VETH4_MAC}
   109      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   110      ...    linux: Check Veth Interface State     agent_vpp_1
   111      ...    vpp1_veth3    mac=${VETH3_MAC}
   112      ...    ipv6=${IP_ADR_MASK2}    mtu=1500    state=up
   113      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   114      ...    linux: Check Veth Interface State     agent_vpp_1
   115      ...    vpp1_veth4    mac=${VETH4_MAC}    state=up
   116  
   117  Check That Afpacket1 Interface Is Still Configured
   118      vpp_api: Check Afpacket Interface State    agent_vpp_1
   119      ...    vpp1_afpacket1    enabled=1    mac=${AFP1_MAC}
   120  
   121  Update Afpacket2 Interface
   122      Put Afpacket Interface    node=agent_vpp_1
   123      ...    name=vpp1_afpacket2    mac=${AFP2_SEC_MAC}    host_int=vpp1_veth4
   124      vpp_term: Interface Is Deleted    node=agent_vpp_1    mac=${AFP2_MAC}
   125      vpp_term: Interface Is Created    node=agent_vpp_1    mac=${AFP2_SEC_MAC}
   126      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   127      ...    vpp_api: Check Afpacket Interface State    agent_vpp_1
   128      ...    vpp1_afpacket2    enabled=1    mac=${AFP2_SEC_MAC}
   129  
   130  Check That Afpacket1 Interface Is Still Configured After Update
   131      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   132      ...    vpp_api: Check Afpacket Interface State    agent_vpp_1
   133      ...    vpp1_afpacket1    enabled=1    mac=${AFP1_MAC}
   134  
   135  Check That Veth3 And Veth4 Interfaces Are Not Affected By Change Of Afpacket2 Interface
   136      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   137      ...    linux: Check Veth Interface State     agent_vpp_1
   138      ...    vpp1_veth3    mac=${VETH3_MAC}
   139      ...    ipv6=${IP_ADR_MASK2}    mtu=1500    state=up
   140      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   141      ...    linux: Check Veth Interface State     agent_vpp_1
   142      ...    vpp1_veth4    mac=${VETH4_MAC}    state=up
   143  
   144  Delete Afpacket1 Interface
   145      Delete VPP Interface    node=agent_vpp_1    name=vpp1_afpacket1
   146      vpp_term: Interface Is Deleted    node=agent_vpp_1    mac=${AFP1_MAC}
   147  
   148  Check That Afpacket2 Interface Is Still Configured
   149      vpp_api: Check Afpacket Interface State    agent_vpp_1
   150      ...    vpp1_afpacket2    enabled=1    mac=${AFP2_SEC_MAC}
   151  
   152  Check That Veth1 And Veth2 Interfaces Are Not Affected By Delete Of Afpacket1 Interface
   153      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   154      ...    linux: Check Veth Interface State     agent_vpp_1
   155      ...    vpp1_veth1    mac=${VETH1_MAC}
   156      ...    ipv6=${IP_ADR_MASK}    mtu=1500    state=up
   157      Wait Until Keyword Succeeds   ${WAIT_TIMEOUT}   ${SYNC_SLEEP}
   158      ...    linux: Check Veth Interface State     agent_vpp_1
   159      ...    vpp1_veth2    mac=${VETH2_MAC}    state=up
   160  
   161  Delete Veth3 Interface
   162      Delete Linux Interface    node=agent_vpp_1    name=vpp1_veth3
   163      linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH3_MAC}
   164      linux: Interface Is Deleted    node=agent_vpp_1    mac=${VETH4_MAC}
   165  
   166  Check That Afpacket2 Interface Is Deleted After Deleting Veth3 And Veth4
   167      vpp_term: Interface Is Deleted    node=agent_vpp_1    mac=${AFP2_SEC_MAC}
   168  
   169  Show Interfaces And Other Objects After Setup
   170      vpp_term: Show Interfaces    agent_vpp_1
   171      vpp_term: Show Interfaces    agent_vpp_2
   172      Write To Machine    agent_vpp_1_term    show int addr
   173      Write To Machine    agent_vpp_2_term    show int addr
   174      Write To Machine    agent_vpp_1_term    show h
   175      Write To Machine    agent_vpp_2_term    show h
   176      Write To Machine    agent_vpp_1_term    show br
   177      Write To Machine    agent_vpp_2_term    show br
   178      Write To Machine    agent_vpp_1_term    show br 1 detail
   179      Write To Machine    agent_vpp_2_term    show br 1 detail
   180      Write To Machine    agent_vpp_1_term    show err
   181      Write To Machine    agent_vpp_2_term    show err
   182      vpp_api: Interfaces Dump    agent_vpp_1
   183      vpp_api: Interfaces Dump    agent_vpp_2
   184      Execute In Container    agent_vpp_1    ip a
   185      Execute In Container    agent_vpp_2    ip a
   186  
   187  *** Keywords ***
   188  TestSetup
   189      Make Datastore Snapshots    ${TEST_NAME}_test_setup
   190  
   191  TestTeardown
   192      Make Datastore Snapshots    ${TEST_NAME}_test_teardown
   193