Remove usage of removed RPC update-entry
[integration/test.git] / csit / suites / sxp / basic / 020_Restconf_CRUD.robot
1 *** Settings ***
2 Documentation     Test suite to verify CRUD operations
3 Suite Setup       Setup SXP Environment
4 Suite Teardown    Clean SXP Environment
5 Test Teardown     Clean Node
6 Library           RequestsLibrary
7 Library           ../../../libraries/Sxp.py
8 Resource          ../../../libraries/SxpLib.robot
9
10 *** Variables ***
11
12 *** Test Cases ***
13 Test Add Bindings
14     [Documentation]    Test if bindings are added to Master DB
15     [Tags]    Restconf CRUD    SXP
16     ${resp}    Get Bindings
17     Add Bindings    5230    1.1.1.1/32
18     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    5230    1.1.1.1/32
19     Add Bindings    30    2001:0:0:0:0:0:0:0/128
20     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    30    2001:0:0:0:0:0:0:0/128
21
22 Test Update Bindings
23     [Documentation]    Test if bindings can be updated to different SGT values by new incoming bindings for the same IP prefix
24     [Tags]    Restconf CRUD    SXP
25     Add Bindings    30    1.1.1.10/32
26     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    30    1.1.1.10/32
27     Sleep    1s    New binding must be at least 1s newer
28     Add Bindings    40    1.1.1.10/32
29     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Not Contain    30    1.1.1.10/32
30     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    40    1.1.1.10/32
31
32 Test Add Connection
33     [Documentation]    Test if connections are added to Node
34     [Tags]    Restconf CRUD    SXP
35     Add Connection    version4    speaker    10.1.0.0    60000
36     Wait Until Keyword Succeeds    3x    250ms    Connections Should Contain    10.1.0.0    60000    speaker
37     ...    version4
38     Add Connection    version1    listener    105.12.0.50    64000
39     Wait Until Keyword Succeeds    3x    250ms    Connections Should Contain    105.12.0.50    64000    listener
40     ...    version1
41
42 Test Delete Binding
43     [Documentation]    Test if bindings are deleted from Master DB
44     [Tags]    Restconf CRUD    SXP
45     Add Bindings    52301    12.1.1.1/32
46     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    52301    12.1.1.1/32
47     Run Keyword And Expect Error    *    Delete Binding    2631    12.1.1.1/32
48     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Contain    52301    12.1.1.1/32
49     Delete Binding    52301    12.1.1.1/32
50     Wait Until Keyword Succeeds    3x    250ms    Bindings Should Not Contain    52301    12.1.1.1/32
51
52 Test Delete Connection
53     [Documentation]    Test if conncetions are removed from Node
54     [Tags]    Restconf CRUD    SXP
55     Add Connection    version4    speaker    127.1.0.30    60000
56     Wait Until Keyword Succeeds    3x    250ms    Connections Should Contain    127.1.0.30    60000    speaker
57     ...    version4
58     Run Keyword And Expect Error    *    Delete Connections    127.1.0.30    65000
59     Wait Until Keyword Succeeds    3x    250ms    Connections Should Contain    127.1.0.30    60000    speaker
60     ...    version4
61     Delete Connections    127.1.0.30    60000
62     Wait Until Keyword Succeeds    3x    250ms    Connections Should Not Contain    127.1.0.30    60000    speaker
63     ...    version4
64
65 *** Keywords ***
66 Clean Node
67     Clean Bindings    127.0.0.1
68     Clean Connections    127.0.0.1