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