Boron update of CSIT
[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 Binding
14     [Documentation]    Test if bindings are added to Master DB
15     [Tags]    Restconf CRUD    SXP
16     ${resp}    Get Bindings
17     Add Binding    5230    1.1.1.1/32
18     ${resp}    Get Bindings
19     Should Contain Binding    ${resp}    5230    1.1.1.1/32
20     Add Binding    30    2001:0:0:0:0:0:0:0/128
21     ${resp}    Get Bindings
22     Should Contain Binding    ${resp}    30    2001:0:0:0:0:0:0:0/128
23
24 Test Add Connection
25     [Documentation]    Test if connections are added to Node
26     [Tags]    Restconf CRUD    SXP
27     Add Connection    version4    speaker    10.1.0.0    60000
28     ${resp}    Get Connections
29     Should Contain Connection    ${resp}    10.1.0.0    60000    speaker    version4
30     Add Connection    version1    listener    105.12.0.50    64000
31     ${resp}    Get Connections
32     Should Contain Connection    ${resp}    105.12.0.50    64000    listener    version1
33
34 Test Delete Binding
35     [Documentation]    Test if bindings are deleted from Master DB
36     [Tags]    Restconf CRUD    SXP
37     Add Binding    52301    12.1.1.1/32
38     ${resp}    Get Bindings
39     Should Contain Binding    ${resp}    52301    12.1.1.1/32
40     Delete Binding    2631    12.1.1.1/32
41     ${resp}    Get Bindings
42     Should Contain Binding    ${resp}    52301    12.1.1.1/32
43     Delete Binding    52301    12.1.1.1/32
44     ${resp}    Get Bindings
45     Should Not Contain Binding    ${resp}    52301    12.1.1.1/32
46
47 Test Delete Connection
48     [Documentation]    Test if conncetions are removed from Node
49     [Tags]    Restconf CRUD    SXP
50     Add Connection    version4    speaker    127.1.0.30    60000
51     ${resp}    Get Connections
52     Should Contain Connection    ${resp}    127.1.0.30    60000    speaker    version4
53     Delete Connections    127.1.0.30    65000
54     ${resp}    Get Connections
55     Should Contain Connection    ${resp}    127.1.0.30    60000    speaker    version4
56     Delete Connections    127.1.0.30    60000
57     ${resp}    Get Connections
58     Should Not Contain Connection    ${resp}    127.1.0.30    60000    speaker    version4
59
60 Test Update Binding
61     [Documentation]    Test if bindings can be updated to different values
62     [Tags]    Restconf CRUD    SXP
63     Add Binding    3230    1.1.1.10/32
64     ${resp}    Get Bindings
65     Should Contain Binding    ${resp}    3230    1.1.1.10/32
66     Update Binding    3230    1.1.1.10/32    623    10.10.10.10/32
67     ${resp}    Get Bindings
68     Should Not Contain Binding    ${resp}    3230    1.1.1.10/32
69     Should Contain Binding    ${resp}    623    10.10.10.10/32
70
71 *** Keywords ***
72 Clean Node
73     Clean Bindings    127.0.0.1
74     Clean Connections    127.0.0.1