Revision ddfd3c3d qa/qa_network.py

b/qa/qa_network.py
122 122

  
123 123
  # Note: Using RFC5737 addresses.
124 124
  # Add a network without subnet
125
  # TODO: make this fail=False once abstract networks are implemented
126
  AssertCommand(["gnt-network", "add", network1], fail=True)
125
  AssertCommand(["gnt-network", "add", network1])
127 126
  # remove non-existing network
128
  AssertCommand(["gnt-network", "remove", network1], fail=True)
127
  AssertCommand(["gnt-network", "remove", network2], fail=True)
128
  AssertCommand(["gnt-network", "remove", network1])
129 129

  
130 130
  # Check wrong opcode parameters
131 131
  # wrone cidr notation
......
257 257

  
258 258
def TestInstanceAddAndNetAdd():
259 259
  """ gnt-istance add / gnt-instance modify --net -1:add """
260
  (network1, network2) = qa_utils.GetNonexistentNetworks(2)
260
  (network1, network2, network3) = qa_utils.GetNonexistentNetworks(3)
261 261
  defmode, deflink = GetNicParams()
262 262

  
263 263
  AssertCommand(["gnt-network", "add", "--network", TEST_NET_1,
......
270 270
  AssertCommand(["gnt-network", "add", "--network", TEST_NET_2, network2])
271 271
  AssertCommand(["gnt-network", "connect", network2, "routed", "rt5000"])
272 272

  
273
  AssertCommand(["gnt-network", "add", network3])
274
  AssertCommand(["gnt-network", "connect", network3, "routed", "rt5000"])
275

  
273 276
  # (mac, ip, network, mode, link)
274 277
  success_cases = [
275 278
    (None, None, None, None, None),  # random mac and default nicparams
......
289 292
    ModifyInstance(instance1, idx=1, action="remove")
290 293
    RemoveInstance(instance1)
291 294

  
295
  # test _AllIPs()
296
  instance1 = GetInstance()
297
  LaunchInstance(instance1, ip=IP_IN_NET_3)
298
  # this results to "Configuration data not consistent
299
  ModifyInstance(instance1, idx=-1, action="add", ip=IP_IN_NET_3)
300
  ModifyInstance(instance1, idx=-1, action="add",
301
                 ip=IP_IN_NET_3, network=network3)
302
  # this raises Corrupt configuration data
303
  ModifyInstance(instance1, idx=-1, action="add",
304
                 ip=IP_IN_NET_3, network=network3, fail=True)
305
  RemoveInstance(instance1)
306

  
307

  
292 308
  fail_cases = [
293 309
    (None, None, None, "lala", None),
294 310
    (None, "lala", None, None, None),
......
315 331
  AssertCommand(["gnt-network", "remove", network1])
316 332
  AssertCommand(["gnt-network", "disconnect", network2])
317 333
  AssertCommand(["gnt-network", "remove", network2])
334
  AssertCommand(["gnt-network", "disconnect", network3])
335
  AssertCommand(["gnt-network", "remove", network3])
318 336

  
319 337

  
320 338
def TestInstanceNetMod():

Also available in: Unified diff