Change URI to specific ovsdb node
[integration/test.git] / tools / Robot_Tool / suites / ha / 015__c2_fails.txt
1 *** Settings ***
2 Documentation     ODL controller clustering test case using the gherkin syntax.
3 ...
4 ...               This test has a workflow similar to the keyword-driven
5 ...               examples. The difference is that the keywords use higher
6 ...               abstraction level and their arguments are embedded into
7 ...               the keyword names.
8 ...
9 ...               This kind of _gherkin_ syntax has been made popular by
10 ...               [http://cukes.info|Cucumber]. It works well especially when
11 ...               tests act as examples that need to be easily understood also
12 ...               by the business people.
13 Resource          resource.txt
14 Library           Selenium2Library
15 Library           SSHLibrary
16 Library           Collections
17 Library           RequestsLibrary
18 Library           ../../libraries/Common.py
19 Variables         ../../variables/Variables.py
20
21
22 *** Test Cases ***
23 Controller2 fails
24     Given C1 a controller in cluster of two controllers
25     And C2 a controller in cluster of two controllers
26     And all switches are introduced to both controllers
27     When C2 goes down
28     Then C1 takes over 
29     And the system is working with C1
30
31
32
33 *** Keywords ***
34 C2 goes down
35     Open Connection    ${Controller2_IP}    prompt=>
36     Login    ${VM USERNAME}    ${VM PASSWORD}
37     Write    cd controller-base/opendaylight
38     Write    sudo ./run.sh -stop
39     Set Selenium Speed    ${DELAY2}
40     Open Browser    ${LOGIN URL2}    ${BROWSER}
41     Maximize Browser Window
42     Set Selenium Speed    ${DELAY}
43     Location Should Be    ${ERROR URL2}
44     Title Should Be    Problem loading page
45     [Teardown]    Close Browser
46
47
48 C1 a controller in cluster of two controllers
49 #    Open Connection    ${Controller1_IP}    prompt=>
50 #    Login    ${VM USERNAME}    ${VM PASSWORD}
51 #    Write    cd controller-base/opendaylight
52 #    Write    sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
53     Open Connection    ${HOST}
54     Login    ${VM USERNAME}    ${VM PASSWORD}
55     ${stdout}=    Execute Command    sudo ovs-vsctl show
56     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
57     
58
59
60 C2 a controller in cluster of two controllers
61 #    Open Connection    ${Controller2_IP}    prompt=>
62 #    Login    ${VM USERNAME}    ${VM PASSWORD}
63 #    Write    cd controller-base/opendaylight
64 #    Write    sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
65     Open Connection    ${HOST}
66     Login    ${VM USERNAME}    ${VM PASSWORD}
67     ${stdout}=    Execute Command    sudo ovs-vsctl show
68     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3    
69
70
71 all switches are introduced to both controllers
72     Open Connection    ${HOST}
73     Login    ${VM USERNAME}    ${VM PASSWORD}
74 #   ${stdout1}=    Execute Command    sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
75 #   ${stdout2}=    Execute Command    sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
76 #   ${stdout2}=    Execute Command    sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
77     ${stdout}=    Execute Command   sudo ovs-vsctl show
78     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
79     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3
80     Should Contain     ${stdout}    Bridge "s1"
81     Should Contain     ${stdout}    Bridge "s2"
82     Should Contain     ${stdout}    Bridge "s3"
83     Should Contain X Times    ${stdout}    is_connected: true    6
84     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s1"
85     Should Contain     ${stdout}    ${CONTROLLER1}
86     Should Contain     ${stdout}    ${CONTROLLER2}
87     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s2"
88     Should Contain     ${stdout}    ${CONTROLLER1}
89     Should Contain     ${stdout}    ${CONTROLLER2}
90     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s3"
91     Should Contain     ${stdout}    ${CONTROLLER1}
92     Should Contain     ${stdout}    ${CONTROLLER2}
93                 
94
95 the system is working with C1
96     ${headers}    Create Dictionary    Content-Type=application/json
97     Create Session    session    http://${Controller1_IP}:8080   headers=${headers}    auth=${auth}
98     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
99     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
100     Log    ${resp.content}
101     Should Contain X Times  ${resp.content}   ${nodeconn1}   2
102     Should Contain X Times  ${resp.content}   ${nodeconn2}   2
103     Should Contain X Times  ${resp.content}   ${nodeconn3}   2
104     Should Contain X Times  ${resp.content}   ${nodeconn4}   2
105
106
107 C1 takes over 
108     Open Connection    ${HOST}
109     Login    ${VM USERNAME}    ${VM PASSWORD}
110     ${stdout}=    Execute Command   sudo ovs-vsctl show
111     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
112     Should Contain X Times    ${stdout}    is_connected: true    3
113