Added "Wait Until Keyword" instead of sleep
[integration/test.git] / test / csit / suites / vtn / VTN_C_OF10 / 030__vtn_coordinator.txt
1
2 *** Settings ***
3 Documentation     Test suite for VTN Coordinator
4 Suite Setup       Create Session    session    http://${VTNC}:8083  headers=${VTNC_HEADERS}
5 Suite Teardown    Delete All Sessions
6 Library           SSHLibrary
7 Library           Collections
8 Library           ../../../libraries/RequestsLibrary.py
9 Library           ../../../libraries/Common.py
10 Library           ../../../libraries/Topology.py
11 Variables         ../../../variables/Variables.py
12
13
14 *** Test Cases ***
15 Add a ODL Controller
16     [Documentation]    Add a Controller odc1
17     [Tags]    vtnc
18     Add a Controller    odc_test     ${CONTROLLER}
19
20 Verify the Controller Status is up
21     [Documentation]    Check Controller status
22     [Tags]   vtnc
23     Wait Until Keyword Succeeds   30s   2s   Check Controller Status   odc_test   up
24
25 Verify switch1
26     [Documentation]    Get switch1
27     [Tags]   vtnc
28     Wait Until Keyword Succeeds   30s   2s   Verify Switch   odc_test   00:00:00:00:00:00:00:01
29
30 Verify switch2
31     [Documentation]    Get switch2
32     [Tags]   vtnc
33     Wait Until Keyword Succeeds   30s   2s   Verify Switch   odc_test   00:00:00:00:00:00:00:02
34
35 Verify switch3
36     [Documentation]    Get switch3
37     [Tags]   vtnc
38     Wait Until Keyword Succeeds   30s   2s   Verify Switch   odc_test   00:00:00:00:00:00:00:03
39
40 Verify switchPort switch1
41     [Documentation]   Get switchport/switch1
42     [Tags]   vtnc
43     Wait Until Keyword Succeeds   16s   2s   Verify SwitchPort   odc_test   00:00:00:00:00:00:00:01
44
45 Verify switchPort switch2
46     [Documentation]   Get switchport/switch2
47     [Tags]   vtnc
48     Wait Until Keyword Succeeds   16s   2s   Verify SwitchPort   odc_test   00:00:00:00:00:00:00:02
49
50 Verify switchPort switch3
51     [Documentation]   Get switchport/switch3
52     [Tags]   vtnc
53     Wait Until Keyword Succeeds   16s   2s   Verify SwitchPort   odc_test   00:00:00:00:00:00:00:03
54
55 Delete a Controller
56     [Documentation]   Delete Controller odc1
57     [Tags]   vtnc
58     Remove Controller    odc_test
59
60
61 *** Keywords ***
62 Add a Controller
63    [Arguments]   ${ctrlname}   ${ctrlip}
64    [Documentation]    Create a controller
65    ${controllerinfo}    Create Dictionary   controller_id   ${ctrlname}   type    odc    ipaddr    ${CONTROLLER}    version    1.0    auditstatus    enable
66    ${controllercreate}    Create Dictionary   controller    ${controllerinfo}
67    ${resp}    PostJson    session    ${VTNWEBAPI}/${CTRLS_CREATE}    data=${controllercreate}
68    Should Be Equal As Strings    ${resp.status_code}    201
69
70
71 Remove Controller
72    [Arguments]   ${ctrlname}
73    [Documentation]   Delete a Controller
74    ${resp}    Delete   session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
75    Should Be Equal As Strings    ${resp.status_code}    204
76
77 Check Controller Status
78    [Arguments]   ${ctrlname}   ${stat}
79    [Documentation]    Get controller status
80    ${resp}    Get   session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
81    ${contents}    To JSON    ${resp.content}
82    ${controllerblock}    Get From Dictionary    ${contents}   controller
83    ${status}    Get From Dictionary    ${controllerblock}     operstatus
84    Should Be Equal As Strings    ${status}    ${stat}
85
86 Verify Switch
87    [Arguments]   ${ctrlname}  ${switch_id}
88    [Documentation]    Get switch
89    ${resp}    Get   session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}.json
90    ${contents}    To JSON    ${resp.content}
91    ${switchblock}    Get From Dictionary    ${contents}   switch
92    ${status}    Get From Dictionary    ${switchblock}     switch_id
93    Should Be Equal As Strings    ${status}     ${switch_id}
94
95 Verify SwitchPort
96    [Arguments]   ${ctrlname}  ${switch_id}
97    [Documentation]    Get switch
98    ${resp}    Get   session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS}
99    Should Be Equal As Strings    ${resp.status_code}    200