Skip to content

Commit e4acedb

Browse files
author
Girish Shilamkar
committed
CLOUDSTACK-5342: Add sleep before adding nic to verify qemu bug.
1 parent cbe93be commit e4acedb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎test/integration/component/test_add_remove_network.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
from marvin.codes import PASS
6262
import random
63+
import time
6364

6465
class Services:
6566
"""Test Add Remove Network Services
@@ -1159,6 +1160,8 @@ def test_15_add_nic_wrong_vm_id(self):
11591160
cmd.networkid = self.isolated_network.id
11601161

11611162
with self.assertRaises(Exception) as e:
1163+
# waiting before adding nic to avoid error while "plugging nic"
1164+
time.sleep(5)
11621165
self.apiclient.addNicToVirtualMachine(cmd)
11631166
self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception)
11641167

@@ -1178,6 +1181,8 @@ def test_16_add_nic_wrong_network_id(self):
11781181
cmd.networkid = random_gen(id="network_id", size=30)
11791182

11801183
with self.assertRaises(Exception) as e:
1184+
# waiting before adding nic to avoid error while "plugging nic"
1185+
time.sleep(5)
11811186
self.apiclient.addNicToVirtualMachine(cmd)
11821187
self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception)
11831188

@@ -1224,6 +1229,8 @@ def test_17_add_nic_different_zone(self):
12241229
cmd.networkid = isolated_network.id
12251230

12261231
with self.assertRaises(Exception) as e:
1232+
# waiting before adding nic to avoid error while "plugging nic"
1233+
time.sleep(5)
12271234
self.apiclient.addNicToVirtualMachine(cmd)
12281235
self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception)
12291236

@@ -1274,6 +1281,8 @@ def test_18_add_nic_basic_zone(self):
12741281
self.dedbug("Trying to add isolated network to VM (both in basic zone,\
12751282
this operation should fail")
12761283
with self.assertRaises(Exception) as e:
1284+
# waiting before adding nic to avoid error while "plugging nic"
1285+
time.sleep(5)
12771286
self.apiclient.addNicToVirtualMachine(cmd)
12781287
self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception)
12791288

‎tools/marvin/marvin/integration/lib/base.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ def add_nic(self, apiclient, networkId, ipaddress=None):
546546
if ipaddress:
547547
cmd.ipaddress = ipaddress
548548

549+
# waiting before adding nic to avoid error while "plugging nic"
550+
time.sleep(5)
551+
549552
return apiclient.addNicToVirtualMachine(cmd)
550553

551554
def remove_nic(self, apiclient, nicId):

0 commit comments

Comments
 (0)