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
19 Add a vtn Tenant1 {"description": "Virtual Tenant 1 for Hackfest network"}
21 Add a vBridge vBridge1
22 [Documentation] Add a vBridge vBridge1 in vtn Tenant1
24 Add a vBridge Tenant1 vBridge1 {}
27 [Documentation] Add a interface if1 into vBridge vBrdige1
29 Add a interface Tenant1 vBridge1 if1 {}
32 [Documentation] Add a interface if2 into vBridge vBrdige1
34 Add a interface Tenant1 vBridge1 if2 {}
36 Add a portmap for interface if1
37 [Documentation] Create a portmap on Interface if1 of vBridge1
39 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:02
40 ${port} Create Dictionary name s2-eth1
41 ${portmap_data} Create Dictionary node ${node} port ${port}
42 Add a portmap Tenant1 vBridge1 if1 ${portmap_data}
44 Add a portmap for interface if2
45 [Documentation] Create a portmap on Interface if2 of vBridge1
46 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:03
47 ${port} Create Dictionary name s3-eth1
48 ${portmap_data} Create Dictionary node ${node} port ${port}
49 Add a portmap Tenant1 vBridge1 if2 ${portmap_data}
51 Add a vBridge vBridge2
52 [Documentation] Add a vBridge vBridge2 in vtn Tenant1
54 Add a vBridge Tenant1 vBridge2 {}
57 [Documentation] Add a interface if3 into vBridge vBrdige2
59 Add a interface Tenant1 vBridge2 if3 {}
62 [Documentation] Add a interface if4 into vBridge vBrdige2
64 Add a interface Tenant1 vBridge2 if4 {}
66 Add a portmap for interface if3
67 [Documentation] Create a portmap on Interface if3 of vBridge2
69 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:02
70 ${port} Create Dictionary name s2-eth2
71 ${portmap_data} Create Dictionary node ${node} port ${port}
72 Add a portmap Tenant1 vBridge2 if3 ${portmap_data}
74 Add a portmap for interface if4
75 [Documentation] Create a portmap on Interface if4 of vBridge2
76 ${node} Create Dictionary type OF id 00:00:00:00:00:00:00:03
77 ${port} Create Dictionary name s3-eth2
78 ${portmap_data} Create Dictionary node ${node} port ${port}
79 Add a portmap Tenant1 vBridge2 if4 ${portmap_data}
82 [Documentation] Ping h1 to h3, verify no packet loss
83 Write h1 ping -w 10 h3
84 ${result} Read Until mininet>
85 Should Contain ${result} 64 bytes
88 [Documentation] Ping h2 to h4, verify no packet loss
89 Write h2 ping -w 10 h4
90 ${result} Read Until mininet>
91 Should Contain ${result} 64 bytes
94 [Documentation] Delete a vtn Tenant1
100 [Arguments] ${vtn_name} ${vtn_data}
101 [Documentation] Create a vtn with specified parameters.
102 ${resp} Post session ${REST_CONTEXT_VTNS}/${vtn_name} data=${vtn_data}
103 Should Be Equal As Strings ${resp.status_code} 201
106 [Arguments] ${vtn_name}
107 [Documentation] Create a vtn with specified parameters.
108 ${resp} Delete session ${REST_CONTEXT_VTNS}/${vtn_name}
109 Should Be Equal As Strings ${resp.status_code} 200
112 [Arguments] ${vtn_name} ${vBridge_name} ${vBridge_data}
113 [Documentation] Create a vBridge in a VTN
114 ${resp} Post session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name} data=${vBridge_data}
115 Should Be Equal As Strings ${resp.status_code} 201
118 [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${interface_data}
119 [Documentation] Create a interface into a vBridge of a VTN
120 ${resp} Post session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name} data=${interface_data}
121 Should Be Equal As Strings ${resp.status_code} 201
124 [Arguments] ${vtn_name} ${vBridge_name} ${interface_name} ${portmap_data}
125 [Documentation] Create a portmap for a interface of a vbridge
126 ${resp} Put session ${REST_CONTEXT_VTNS}/${vtn_name}/vbridges/${vBridge_name}/interfaces/${interface_name}/portmap data=${portmap_data}
127 Should Be Equal As Strings ${resp.status_code} 200