1907c035c78edee6aef5e07a46a06a015c21d810
[integration/test.git] / csit / suites / sxp / basic / 030_Connectivity.robot
1 *** Settings ***
2 Documentation     Test suite to test connectivity problems
3 Suite Setup       SxpLib.Setup SXP Environment    5
4 Suite Teardown    SxpLib.Clean SXP Environment    5
5 Test Setup        Clean Nodes
6 Library           RequestsLibrary
7 Library           SSHLibrary
8 Library           ../../../libraries/Sxp.py
9 Resource          ../../../libraries/SxpLib.robot
10
11 *** Variables ***
12
13 *** Test Cases ***
14 Version 1
15     [Documentation]    Test if Version1 <=> Version1 can be connected
16     [Tags]    SXP    Connectivity
17     Test Nodes    version1    none    version1
18     BuiltIn.Log    OK without passwords
19     Test Nodes    version1    default    version1
20     BuiltIn.Log    OK with passwords
21
22 Version 2
23     [Documentation]    Test if Version2 <=> Version2 can be connected
24     [Tags]    SXP    Connectivity
25     Test Nodes    version2    none    version2
26     BuiltIn.Log    OK without passwords
27     Test Nodes    version2    default    version2
28     BuiltIn.Log    OK with passwords
29
30 Version 3
31     [Documentation]    Test if Version3 <=> Version3 can be connected
32     [Tags]    SXP    Connectivity
33     Test Nodes    version3    none    version3
34     BuiltIn.Log    OK without passwords
35     Test Nodes    version3    default    version3
36     BuiltIn.Log    OK with passwords
37
38 Version 4
39     [Documentation]    Test if Version4 <=> Version4 can be connected
40     [Tags]    SXP    Connectivity
41     Test Nodes    version4    none    version4
42     BuiltIn.Log    OK without passwords
43     Test Nodes    version4    default    version4
44     BuiltIn.Log    OK with passwords
45
46 Mixed Versions
47     [Documentation]    Test of version negotiation proces during connecting
48     [Tags]    SXP    Connectivity
49     @{list} =    BuiltIn.Create List    version2    version3    version4
50     Test Nodes    version1    none    @{list}
51     Test Nodes    version1    default    @{list}
52     @{list} =    BuiltIn.Create List    version1    version3    version4
53     Test Nodes    version2    none    @{list}
54     Test Nodes    version2    default    @{list}
55     @{list} =    BuiltIn.Create List    version1    version2    version4
56     Test Nodes    version3    none    @{list}
57     Test Nodes    version3    default    @{list}
58     @{list} =    BuiltIn.Create List    version1    version2    version3
59     Test Nodes    version4    none    @{list}
60     Test Nodes    version4    default    @{list}
61
62 *** Keywords ***
63 Test Nodes
64     [Arguments]    ${version}    ${PASSWORD}    @{versions}
65     [Documentation]    Setup connection Speaker => Listener / Listener => Speaker / Both <=> Both for specific versions
66     : FOR    ${r_version}    IN    @{versions}
67     \    ${cmp_version}    Lower Version    ${r_version}    ${version}
68     \    BuiltIn.Log    ${r_version}
69     \    SxpLib.Add Connection    ${r_version}    listener    127.0.0.2    64999    127.0.0.1
70     \    ...    ${PASSWORD}
71     \    SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
72     \    ...    ${PASSWORD}
73     \    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${cmp_version}    listener
74     \    ...    127.0.0.2    64999    127.0.0.1
75     \    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${cmp_version}    speaker
76     \    ...    127.0.0.1    64999    127.0.0.2
77     \    BuiltIn.Log    OK ${r_version}:listener ${version}:speaker
78     \    SxpLib.Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.3
79     \    ...    ${PASSWORD}
80     \    SxpLib.Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.2
81     \    ...    ${PASSWORD}
82     \    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${cmp_version}    listener
83     \    ...    127.0.0.2    64999    127.0.0.3
84     \    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${cmp_version}    speaker
85     \    ...    127.0.0.3    64999    127.0.0.2
86     \    BuiltIn.Log    OK ${version}:listener ${r_version}:speaker
87     \    BuiltIn.Run Keyword If    '${version}' == 'version4' and '${r_version}' == 'version4'    Test Both    ${version}    ${r_version}    ${PASSWORD}
88     \    Clean Nodes
89
90 Test Both
91     [Arguments]    ${version}    ${r_version}    ${PASSWORD}
92     [Documentation]    Setup Both <=> Both connection
93     ${cmp_version}    Sxp.Lower Version    ${r_version}    ${version}
94     SxpLib.Add Connection    ${r_version}    both    127.0.0.3    64999    127.0.0.1    ${PASSWORD}
95     SxpLib.Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.3    ${PASSWORD}
96     BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${cmp_version}    both    127.0.0.3
97     ...    64999    127.0.0.1
98     BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${cmp_version}    both    127.0.0.1
99     ...    64999    127.0.0.3
100     BuiltIn.Log    OK ${r_version}:both ${version}:both
101
102 Clean Nodes
103     SxpLib.Clean Connections    127.0.0.1
104     SxpLib.Clean Connections    127.0.0.2
105     SxpLib.Clean Connections    127.0.0.3