SXP: Improve reliability of basic suite
[integration/test.git] / csit / suites / sxp / basic / 040_Custom_Passwords.robot
1 *** Settings ***
2 Documentation     Test suite to test custom password per peer fuctionality
3 Suite Setup       Setup SXP Environment Local
4 Suite Teardown    Clean SXP Environment    3
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 of custom passwords on version1 connections
16     [Tags]    SXP    Passwords
17     Test Mode    version1    listener    speaker
18     Clean Nodes
19     Test Mode    version1    speaker    listener
20
21 Version 2
22     [Documentation]    Test of custom passwords on version2 connections
23     [Tags]    SXP    Passwords
24     Test Mode    version2    listener    speaker
25     Clean Nodes
26     Test Mode    version2    speaker    listener
27
28 Version 3
29     [Documentation]    Test of custom passwords on version3 connections
30     [Tags]    SXP    Passwords
31     Test Mode    version3    listener    speaker
32     Clean Nodes
33     Test Mode    version3    speaker    listener
34
35 Version 4
36     [Documentation]    Test of custom passwords on version4 connections
37     [Tags]    SXP    Passwords
38     Test Mode    version4    speaker    listener
39     Clean Nodes
40     Test Mode    version4    listener    speaker
41     Clean Nodes
42     Test Mode    version4    both    both
43
44 *** Keywords ***
45 Setup SXP Environment Local
46     [Documentation]    Create session to Controller
47     RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=${DEFAULT_TIMEOUT_HTTP}    max_retries=0
48     Add Node    127.0.0.1    ${EMPTY}
49     Add Node    127.0.0.2    ${EMPTY}
50     Add Node    127.0.0.3    CUSTOM
51
52 Test Mode
53     [Arguments]    ${version}    ${mode_local}    ${mode_remote}
54     [Documentation]    Setup connection Speaker => Listener / Listener => Speaker / Both <=> Both for specific versions
55     Add Connection    ${version}    ${mode_local}    127.0.0.3    64999    127.0.0.1    CUSTOM
56     Add Connection    ${version}    ${mode_remote}    127.0.0.1    64999    127.0.0.3    ${EMPTY}
57     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_local}    127.0.0.3
58     ...    64999    127.0.0.1
59     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_remote}    127.0.0.1
60     ...    64999    127.0.0.3
61     Add Connection    ${version}    ${mode_local}    127.0.0.2    64999    127.0.0.1    ${EMPTY}
62     Add Connection    ${version}    ${mode_remote}    127.0.0.1    64999    127.0.0.2    ${EMPTY}
63     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_local}    127.0.0.2
64     ...    64999    127.0.0.1
65     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_remote}    127.0.0.1
66     ...    64999    127.0.0.2
67     Add Connection    ${version}    ${mode_local}    127.0.0.3    64999    127.0.0.2    CUSTOM_2
68     Add Connection    ${version}    ${mode_remote}    127.0.0.2    64999    127.0.0.3    CUSTOM_2
69     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_local}    127.0.0.3
70     ...    64999    127.0.0.2
71     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_remote}    127.0.0.2
72     ...    64999    127.0.0.3
73
74 Clean Nodes
75     Clean Connections    127.0.0.1
76     Clean Connections    127.0.0.2
77     Clean Connections    127.0.0.3