Fixing mininet reads so that we always clear mininet
[integration/test.git] / test / csit / suites / vtn-of13 / 060__VTN_OF13 / 020__vtn_coordinator.txt
1 *** Settings ***
2 Documentation     Test suite for VTN Coordinator
3 Suite Setup       Create Session    session    http://${VTNC}:8083  headers=${VTNC_HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           ../../../libraries/RequestsLibrary.py
8 Library           ../../../libraries/Common.py
9 Library           ../../../libraries/Topology.py
10 Variables         ../../../variables/Variables.py
11
12
13
14 *** Test Cases ***
15 Add a ODL Controller
16     [Documentation]    Add a Controller
17     [Tags]    vtnc
18     Add a Controller    odc_test     ${CONTROLLER}
19
20
21 Verify the Controller Status is up
22     [Documentation]    Check Controller status
23     [Tags]   vtnc 
24     Check Controller Status    odc_test
25
26
27 Add a Vtn Tenant1
28     [Documentation]   Create Vtn Tenant1
29     [Tags]   vtnc 
30     Add a VTN  Tenant1  VTN_TEST
31
32
33 Create VBR in VTN Tenant1
34     [Documentation]   Create a VBR in Tenant1 as Vbridge1
35     [Tags]   vtnc 
36     Create VBR in VTN     Tenant1    Vbridge1    odc_test
37
38
39 Create VBRIF in VBRIDGE Vbridge1 Interface1
40     [Documentation]   Create an interface to Vbridge1
41     [Tags]   vtnc 
42     Create VBRIF in VBR   Tenant1    Vbridge1   Interface1  Interface1
43
44
45 Create VBRIF in VBRIDGE Vbridge1 Interface2
46     [Documentation]   Create an interface to Vbridge1
47     [Tags]   vtnc 
48     Create VBRIF in VBR   Tenant1    Vbridge1   Interface2  Interface2
49
50
51 Define Portmap for Interface1
52     [Documentation]   Map Interface1 to a logical port
53     [Tags]   vtnc
54     Define Portmap for VBRIF    Tenant1    Vbridge1     Interface1    PP-OF:00:00:00:00:00:00:00:03-s3-eth1
55
56
57 Define Portmap for Interface2
58     [Documentation]   Map Interface2 to a logical port
59     [Tags]   vtnc 
60     Define Portmap for VBRIF    Tenant1    Vbridge1     Interface2    PP-OF:00:00:00:00:00:00:00:02-s2-eth1
61
62
63 Test Ping for Configuration1
64     [Documentation]   ping between hosts in mininet
65     [Tags]   vtnc 
66     Test Ping    h1    h3
67
68
69 Delete a VTN Tenant1
70     [Documentation]   Delete Vtn Tenant1
71     [Tags]   vtnc
72     Delete a VTN  Tenant1
73
74
75 Delete a Controller odc1
76     [Documentation]   Delete Controller odc1
77     [Tags]   vtnc
78     Remove Controller    odc_test
79
80
81
82 *** Keywords ***
83 Add a Controller
84    [Arguments]   ${ctrlname}   ${ctrlip}
85    [Documentation]    Create a controller
86    ${controllerinfo}    Create Dictionary   controller_id   ${ctrlname}   type    odc    ipaddr    ${CONTROLLER}    version    1.0    auditstatus    enable
87    ${controllercreate}    Create Dictionary   controller    ${controllerinfo}
88    ${resp}    PostJson    session    ${VTNWEBAPI}/${CTRLS_CREATE}    data=${controllercreate}
89    Should Be Equal As Strings    ${resp.status_code}    201
90
91
92 Remove Controller
93    [Arguments]   ${ctrlname}
94    [Documentation]   Delete a Controller
95    ${resp}    Delete   session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
96    Should Be Equal As Strings    ${resp.status_code}    204
97
98
99 Check Controller Status
100    [Arguments]   ${ctrlname}
101    [Documentation]    Get controller status
102    Sleep    15
103    ${resp}    Get   session    ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
104    ${contents}    To JSON    ${resp.content}
105    ${controllerblock}    Get From Dictionary    ${contents}   controller
106    ${status}    Get From Dictionary    ${controllerblock}     operstatus
107    Should Be Equal As Strings    ${status}    up
108
109
110 Add a VTN
111    [Arguments]   ${vtnname}    ${vtndescription}
112    [Documentation]    Create VTN in Coordinator
113    ${vtninfo}    Create Dictionary    vtn_name    ${vtnname}    description    ${vtndescription}
114    ${vtncreate}    Create Dictionary    vtn    ${vtninfo}
115    ${resp}    PostJson    session    ${VTNWEBAPI}/${VTNS_CREATE}    data=${vtncreate}
116    Should Be Equal As Strings    ${resp.status_code}    201
117
118
119 Delete a VTN
120    [Arguments]   ${vtnname}
121    [Documentation]  Delete a VTN Created
122    ${resp}    Delete    session    ${VTNWEBAPI}/${VTNS}/${vtnname}.json
123    Should Be Equal As Strings    ${resp.status_code}    204
124
125
126 Create VBR in VTN
127    [Arguments]   ${vtnname}    ${vbrname}    ${ctrlname}
128    [Documentation]    Create VBR for VTN in Coordinator
129    ${vbrinfo}    Create Dictionary   vbr_name    ${vbrname}    controller_id   ${ctrlname}    domain_id    (DEFAULT)
130    ${vbrcreate}   Create Dictionary   vbridge    ${vbrinfo}
131    ${resp}    PostJson    session    ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE}    data=${vbrcreate}
132    Should Be Equal As Strings    ${resp.status_code}    201
133
134
135 Create VBRIF in VBR
136    [Arguments]   ${vtnname}    ${vbrname}    ${vbrifname}    ${ifdescription}
137    [Documentation]    Create VBR Interface in VBR
138    ${vbrifinfo}    Create Dictionary   if_name    ${vbrifname}    description    ${ifdescription}
139    ${vbrifcreate}    Create Dictionary   interface    ${vbrifinfo}
140    ${resp}    PostJson    session    ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE}  data=${vbrifcreate}
141    Should Be Equal As Strings    ${resp.status_code}    201
142
143
144 Define Portmap for VBRIF
145    [Arguments]   ${vtnname}    ${vbrname}    ${vbrifname}   ${logical_port_id}
146    [Documentation]   Map  Interface to a logical port
147    ${logical_port_info}    Create Dictionary    logical_port_id    ${logical_port_id}
148    ${portmapdefine}     Create Dictionary     portmap     ${logical_port_info}
149    ${resp}   Put     session      ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE}    data=${portmapdefine}
150    Should Be Equal As Strings    ${resp.status_code}    204
151
152 Test Ping
153    [Arguments]   ${host1}    ${host2}
154    [Documentation]  Ping hosts to check connectivity
155    Sleep   5
156    Write    ${host1} ping -w 10 ${host2}
157    Sleep    10
158    ${result}    Read
159    Should Contain    ${result}    64 bytes