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