Revision a1baa42b snf-cyclades-app/synnefo/logic/tests/reconciliation.py
b/snf-cyclades-app/synnefo/logic/tests/reconciliation.py | ||
---|---|---|
122 | 122 |
"mtime": time(), |
123 | 123 |
"disk.sizes": [], |
124 | 124 |
"nic.ips": [], |
125 |
"nic.names": [], |
|
125 | 126 |
"nic.macs": [], |
126 |
"nic.networks": [], |
|
127 |
"nic.networks.names": [],
|
|
127 | 128 |
"tags": []}] |
128 | 129 |
self.reconciler.reconcile() |
129 | 130 |
cmrapi.DeleteInstance\ |
... | ... | |
142 | 143 |
"mtime": time(), |
143 | 144 |
"disk.sizes": [], |
144 | 145 |
"nic.ips": [], |
146 |
"nic.names": [], |
|
145 | 147 |
"nic.macs": [], |
146 |
"nic.networks": [], |
|
148 |
"nic.networks.names": [],
|
|
147 | 149 |
"tags": []}] |
148 | 150 |
with mocked_quotaholder(): |
149 | 151 |
self.reconciler.reconcile() |
... | ... | |
168 | 170 |
"mtime": time(), |
169 | 171 |
"disk.sizes": [], |
170 | 172 |
"nic.ips": [], |
173 |
"nic.names": [], |
|
171 | 174 |
"nic.macs": [], |
172 |
"nic.networks": [], |
|
175 |
"nic.networks.names": [],
|
|
173 | 176 |
"tags": []}] |
174 | 177 |
with mocked_quotaholder(): |
175 | 178 |
self.reconciler.reconcile() |
... | ... | |
183 | 186 |
vm1 = mfactory.VirtualMachineFactory(backend=self.backend, |
184 | 187 |
deleted=False, |
185 | 188 |
operstate="STOPPED") |
186 |
mfactory.NetworkInterfaceFactory(machine=vm1, network=network1, |
|
187 |
ipv4="10.0.0.0") |
|
189 |
nic = mfactory.NetworkInterfaceFactory(machine=vm1, network=network1,
|
|
190 |
ipv4="10.0.0.0")
|
|
188 | 191 |
mrapi().GetInstances.return_value =\ |
189 | 192 |
[{"name": vm1.backend_vm_id, |
190 | 193 |
"beparams": {"maxmem": 2048, |
... | ... | |
193 | 196 |
"oper_state": True, |
194 | 197 |
"mtime": time(), |
195 | 198 |
"disk.sizes": [], |
199 |
"nic.names": [nic.backend_uuid], |
|
196 | 200 |
"nic.ips": ["192.168.2.1"], |
197 | 201 |
"nic.macs": ["aa:00:bb:cc:dd:ee"], |
198 |
"nic.networks": [network2.backend_id], |
|
202 |
"nic.networks.names": [network2.backend_id],
|
|
199 | 203 |
"tags": []}] |
200 | 204 |
with mocked_quotaholder(): |
201 | 205 |
self.reconciler.reconcile() |
... | ... | |
227 | 231 |
# Test creation if exists in Ganeti |
228 | 232 |
self.assertEqual(net1.backend_networks.count(), 0) |
229 | 233 |
mrapi().GetNetworks.return_value = [{"name": net1.backend_id, |
230 |
"group_list": ["default"], |
|
234 |
"group_list": [["default", |
|
235 |
"bridged", |
|
236 |
"prv0"]], |
|
231 | 237 |
"network": net1.subnet, |
232 | 238 |
"map": "....", |
233 | 239 |
"external_reservations": ""}] |
Also available in: Unified diff