Update Robot Framework format - step 14
[integration/test.git] / csit / suites / sxp / topology / 040_Domains_Substraction.robot
1 *** Settings ***
2 Documentation       Test suite to verify Domain data consistency during data change
3
4 Library             RequestsLibrary
5 Library             SSHLibrary
6 Library             ../../../libraries/Sxp.py
7 Resource            ../../../libraries/SxpLib.robot
8
9 Test Setup          Setup Nodes Local
10 Test Teardown       Clean SXP Environment    14
11
12
13 *** Variables ***
14 ${DOMAIN_1}     guest
15 ${DOMAIN_2}     trusted
16 ${DOMAIN_3}     secure
17
18
19 *** Test Cases ***
20 Export Separation Node 7 Test
21     [Documentation]    Test if Node 7 contains only bindings from global domain and is not affected by changes from other nodes
22     [Tags]    sxp    domains
23     Check Binding Range    20    0    300    127.0.0.7
24     Check Binding Range Negative    40    0    300    127.0.0.7
25     Check Binding Range Negative    60    0    300    127.0.0.7
26     Check Binding Range Negative    120    0    300    127.0.0.7
27     Delete Bindings Range    40    0    300    127.0.0.4
28     Wait Until Keyword Succeeds    15    1    Check Binding Range    20    0    300
29     ...    127.0.0.7
30     Delete Bindings Range    20    0    300    127.0.0.2
31     Wait Until Keyword Succeeds    15    1    Check Binding Range Negative    20    0    300
32     ...    127.0.0.7
33
34 Export Separation Node 8-9 Test
35     [Documentation]    Test if Nodes 8,9 contains consistent data during its update
36     [Tags]    sxp    domains
37     FOR    ${node}    IN RANGE    8    10
38         Check Binding Range Negative    20    0    300    127.0.0.${node}
39         Check Binding Range    40    0    300    127.0.0.${node}
40         Check Binding Range Negative    60    0    300    127.0.0.${node}
41         Check Binding Range Negative    120    0    300    127.0.0.${node}
42     END
43     Delete Bindings Range    60    0    300    127.0.0.6
44     FOR    ${node}    IN RANGE    8    10
45         Wait Until Keyword Succeeds    15    1    Check Binding Range    40    0
46         ...    300    127.0.0.${node}
47     END
48     Delete Bindings Range    40    0    300    127.0.0.4
49     FOR    ${node}    IN RANGE    8    10
50         Wait Until Keyword Succeeds    15    1    Check Binding Range Negative    40    0
51         ...    300    127.0.0.${node}
52     END
53
54 Export Separation Node 10 Test
55     [Documentation]    Test if Node 10 contains consistent data during its update
56     [Tags]    sxp    domains
57     Check Binding Range Negative    20    0    300    127.0.0.10
58     Check Binding Range Negative    40    0    300    127.0.0.10
59     Check Binding Range    60    0    300    127.0.0.10
60     Check Binding Range Negative    120    0    300    127.0.0.10
61     Delete Bindings Range    20    0    300    127.0.0.2
62     Wait Until Keyword Succeeds    15    1    Check Binding Range    60    0    300
63     ...    127.0.0.10
64     Delete Bindings Range    60    0    300    127.0.0.6
65     Wait Until Keyword Succeeds    15    1    Check Binding Range Negative    60    0    300
66     ...    127.0.0.10
67
68 Export Separation Node 11-14 Test
69     [Documentation]    Test if Nodes 11-14 contains consistent data during its update
70     [Tags]    sxp    domains
71     FOR    ${node}    IN RANGE    11    15
72         Check Binding Range Negative    20    0    300    127.0.0.${node}
73         Check Binding Range Negative    40    0    300    127.0.0.${node}
74         Check Binding Range Negative    60    0    300    127.0.0.${node}
75         Check Binding Range    120    0    300    127.0.0.${node}
76     END
77     Delete Bindings Range    60    0    300    127.0.0.6
78     FOR    ${node}    IN RANGE    11    15
79         Wait Until Keyword Succeeds    15    1    Check Binding Range    120    0
80         ...    300    127.0.0.${node}
81     END
82     Delete Bindings Range    120    0    300    127.0.0.12
83     FOR    ${node}    IN RANGE    11    15
84         Wait Until Keyword Succeeds    15    1    Check Binding Range Negative    120    0
85         ...    300    127.0.0.${node}
86     END
87
88
89 *** Keywords ***
90 Setup Nodes Local
91     [Documentation]    Setups Multi domain topology consisting of 3 specific domains and 1 default, data between domains must remain separated.
92     [Arguments]    ${version}=version4
93     Setup SXP Environment    14
94     FOR    ${node}    IN RANGE    2    7
95         Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.${node}
96     END
97     FOR    ${node}    IN RANGE    7    11
98         Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.${node}
99     END
100     FOR    ${node}    IN RANGE    11    15
101         Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.${node}
102     END
103     Add Domain    ${DOMAIN_1}
104     Add Domain    ${DOMAIN_2}
105     Add Domain    ${DOMAIN_3}
106     Add Bindings Range    20    0    300    127.0.0.2
107     Add Bindings Range    40    0    300    127.0.0.4
108     Add Bindings Range    60    0    300    127.0.0.6
109     Add Bindings Range    120    0    300    127.0.0.12
110     # NO DOMAIN
111     Add Connection    ${version}    listener    127.0.0.2    64999
112     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
113     Add Connection    ${version}    speaker    127.0.0.7    64999
114     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.7
115     # DOMAIN 1
116     Add Connection    ${version}    listener    127.0.0.3    64999    domain=${DOMAIN_1}
117     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
118     ...    domain=${DOMAIN_1}
119     Add Connection    ${version}    listener    127.0.0.4    64999    domain=${DOMAIN_1}
120     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.4
121     ...    domain=${DOMAIN_1}
122     Add Connection    ${version}    speaker    127.0.0.8    64999    domain=${DOMAIN_1}
123     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.8
124     ...    domain=${DOMAIN_1}
125     Add Connection    ${version}    speaker    127.0.0.9    64999    domain=${DOMAIN_1}
126     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.9
127     ...    domain=${DOMAIN_1}
128     # DOMAIN 2
129     Add Connection    ${version}    listener    127.0.0.5    64999    domain=${DOMAIN_2}
130     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.5
131     ...    domain=${DOMAIN_2}
132     Add Connection    ${version}    listener    127.0.0.6    64999    domain=${DOMAIN_2}
133     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.6
134     ...    domain=${DOMAIN_2}
135     Add Connection    ${version}    speaker    127.0.0.10    64999    domain=${DOMAIN_2}
136     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.10
137     ...    domain=${DOMAIN_2}
138     # DOMAIN 3
139     FOR    ${node}    IN RANGE    11    15
140         Add Connection    ${version}    both    127.0.0.${node}    64999    domain=${DOMAIN_3}
141         Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both
142         ...    127.0.0.${node}    domain=${DOMAIN_3}
143     END