2 Documentation Test suite for VTN Manager
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
7 Library ../../../libraries/RequestsLibrary.py
8 Library ../../../libraries/Common.py
9 Library ../../../libraries/Topology.py
10 Variables ../../../variables/Variables.py
13 ${REST_CONTEXT_VTNS} controller/nb/v2/vtn/default/vtns
17 [Documentation] Add a vtn Tenant1
18 Add a vtn Tenant1 {"description": "Virtual Tenant 1 for Hackfest network"}
20 Add a vBridge vBridge1
21 [Documentation] Add a vBridge vBridge1 in vtn Tenant1
22 Add a vBridge Tenant1 vBridge1 {}
25 [Documentation] Add a interface if1 into vBridge vBrdige1
26 Add a interface Tenant1 vBridge1 if1 {}
29 [Documentation] Add a interface if2 into vBridge vBrdige1
30 Add a interface Tenant1 vBridge1 if2 {}
32 Add a portmap for interface if1
33 [Documentation] Create a portmap on Interface if1 of vBridge1
34 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:02
35 ${port} Create Dictionary name s2-eth1
36 ${portmap_data} Create Dictionary node ${node} port ${port}
37 Add a portmap Tenant1 vBridge1 if1 ${portmap_data}
39 Add a portmap for interface if2
40 [Documentation] Create a portmap on Interface if2 of vBridge1
41 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:03
42 ${port} Create Dictionary name s3-eth1
43 ${portmap_data} Create Dictionary node ${node} port ${port}
44 Add a portmap Tenant1 vBridge1 if2 ${portmap_data}
46 Add a vBridge vBridge2
47 [Documentation] Add a vBridge vBridge2 in vtn Tenant1
48 Add a vBridge Tenant1 vBridge2 {}
51 [Documentation] Add a interface if3 into vBridge vBrdige2
52 Add a interface Tenant1 vBridge2 if3 {}
55 [Documentation] Add a interface if4 into vBridge vBrdige2
56 Add a interface Tenant1 vBridge2 if4 {}
58 Add a portmap for interface if3
59 [Documentation] Create a portmap on Interface if3 of vBridge2
60 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:02
61 ${port} Create Dictionary name s2-eth2
62 ${portmap_data} Create Dictionary node ${node} port ${port}
63 Add a portmap Tenant1 vBridge2 if3 ${portmap_data}
65 Add a portmap for interface if4
66 [Documentation] Create a portmap on Interface if4 of vBridge2
67 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:03
68 ${port} Create Dictionary name s3-eth2
69 ${portmap_data} Create Dictionary node ${node} port ${port}
70 Add a portmap Tenant1 vBridge2 if4 ${portmap_data}
73 [Documentation] Ping h1 to h3, verify no packet loss
74 Write h1 ping -w 10 h3
75 ${result} Read Until mininet>
76 Should Contain ${result} 64 bytes
79 [Documentation] Ping h2 to h4, verify no packet loss
80 Write h2 ping -w 10 h4
81 ${result} Read Until mininet>
82 Should Contain ${result} 64 bytes
85 [Documentation] Delete a vtn Tenant1
90 [Arguments] ${vtn_name} ${vtn_data}
91 [Documentation] Create a vtn with specified parameters.
92 ${resp} Post session ${REST_CONTEXT_VTNS}/${vtn_name} data=${vtn_data}
93 Should Be Equal As Strings ${resp.status_code} 201
96 [Arguments] ${vtn_name}
97 [Documentation] Create a vtn with specified parameters.
98 ${resp} Delete session ${REST_CONTEXT_VTNS}/${vtn_name}
99 Should Be Equal As Strings ${resp.status_code} 200
102 [Arguments] ${vtn_name} ${vBridge_name} ${vBridge_data}
103 [Documentation] Create a vBridge in a VTN
104 ${resp} Post session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name} data=${vBridge_data}
105 Should Be Equal As Strings ${resp.status_code} 201
108 [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${interface_data}
109 [Documentation] Create a interface into a vBridge of a VTN
110 ${resp} Post session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name} data=${interface_data}
111 Should Be Equal As Strings ${resp.status_code} 201
114 [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${portmap_data}
115 [Documentation] Create a portmap for a interface of a vbridge
116 ${resp} Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/portmap data=${portmap_data}
117 Should Be Equal As Strings ${resp.status_code} 200