Migrate Get Requests invocations(libraries)
[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
4 Library             RequestsLibrary
5 Library             SSHLibrary
6 Library             ../../../libraries/Sxp.py
7 Resource            ../../../libraries/SxpLib.robot
8
9 Suite Setup         Setup SXP Environment Local
10 Suite Teardown      Clean SXP Environment    3
11 Test Setup          Clean Nodes
12
13
14 *** Test Cases ***
15 Version 1
16     [Documentation]    Test of custom passwords on version1 connections
17     [Tags]    sxp    passwords
18     Test Mode    version1    listener    speaker
19     Clean Nodes
20     Test Mode    version1    speaker    listener
21
22 Version 2
23     [Documentation]    Test of custom passwords on version2 connections
24     [Tags]    sxp    passwords
25     Test Mode    version2    listener    speaker
26     Clean Nodes
27     Test Mode    version2    speaker    listener
28
29 Version 3
30     [Documentation]    Test of custom passwords on version3 connections
31     [Tags]    sxp    passwords
32     Test Mode    version3    listener    speaker
33     Clean Nodes
34     Test Mode    version3    speaker    listener
35
36 Version 4
37     [Documentation]    Test of custom passwords on version4 connections
38     [Tags]    sxp    passwords
39     Test Mode    version4    speaker    listener
40     Clean Nodes
41     Test Mode    version4    listener    speaker
42     Clean Nodes
43     Test Mode    version4    both    both
44
45
46 *** Keywords ***
47 Setup SXP Environment Local
48     [Documentation]    Create session to Controller
49     RequestsLibrary.Create Session
50     ...    session
51     ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
52     ...    auth=${AUTH}
53     ...    timeout=${DEFAULT_TIMEOUT_HTTP}
54     ...    max_retries=0
55     Add Node    127.0.0.1    ${EMPTY}
56     Add Node    127.0.0.2    ${EMPTY}
57     Add Node    127.0.0.3    CUSTOM
58
59 Test Mode
60     [Documentation]    Setup connection Speaker => Listener / Listener => Speaker / Both <=> Both for specific versions
61     [Arguments]    ${version}    ${mode_local}    ${mode_remote}
62     Add Connection    ${version}    ${mode_local}    127.0.0.3    64999    127.0.0.1    CUSTOM
63     Add Connection    ${version}    ${mode_remote}    127.0.0.1    64999    127.0.0.3    ${EMPTY}
64     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_local}    127.0.0.3
65     ...    64999    127.0.0.1
66     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_remote}    127.0.0.1
67     ...    64999    127.0.0.3
68     Add Connection    ${version}    ${mode_local}    127.0.0.2    64999    127.0.0.1    ${EMPTY}
69     Add Connection    ${version}    ${mode_remote}    127.0.0.1    64999    127.0.0.2    ${EMPTY}
70     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_local}    127.0.0.2
71     ...    64999    127.0.0.1
72     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_remote}    127.0.0.1
73     ...    64999    127.0.0.2
74     Add Connection    ${version}    ${mode_local}    127.0.0.3    64999    127.0.0.2    CUSTOM_2
75     Add Connection    ${version}    ${mode_remote}    127.0.0.2    64999    127.0.0.3    CUSTOM_2
76     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_local}    127.0.0.3
77     ...    64999    127.0.0.2
78     Wait Until Keyword Succeeds    120x    1s    Verify Connection    ${version}    ${mode_remote}    127.0.0.2
79     ...    64999    127.0.0.3
80
81 Clean Nodes
82     Clean Connections    127.0.0.1
83     Clean Connections    127.0.0.2
84     Clean Connections    127.0.0.3