Skip to content

Commit 527f037

Browse files
Ashutosh KGirish Shilamkar
authored andcommitted
CLOUDSTACK-4996: Resolved gateway accessibility issue
Gateway of isolated network is pinged instead of shared network Signed-off-by: Girish Shilamkar <girish@clogeny.com>
1 parent de448ec commit 527f037

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

‎test/integration/component/test_vpc_vm_life_cycle.py‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from marvin.integration.lib.base import *
2727
from marvin.integration.lib.common import *
2828
from marvin.remoteSSHClient import remoteSSHClient
29+
from marvin.codes import PASS
2930

3031
import time
3132

@@ -1195,10 +1196,20 @@ def validate_network_rules(self):
11951196
)
11961197

11971198
self.debug("We should be allowed to ping virtual gateway")
1198-
self.debug("VM gateway: %s" % self.vm_1.nic[0].gateway)
1199+
self.debug("Finding the gateway corresponding to isolated network")
1200+
gateways = [nic.gateway for nic in self.vm_1.nic if nic.networkid == self.network_1.id]
11991201

1200-
res = ssh_1.execute("ping -c 1 %s" % self.vm_1.nic[0].gateway)
1201-
self.debug("ping -c 1 %s: %s" % (self.vm_1.nic[0].gateway, res))
1202+
gateway_list_validation_result = validateList(gateways)
1203+
1204+
self.assertEqual(gateway_list_validation_result[0], PASS, "gateway list validation failed due to %s" %
1205+
gateway_list_validation_result[2])
1206+
1207+
gateway = gateway_list_validation_result[1]
1208+
1209+
self.debug("VM gateway: %s" % gateway)
1210+
1211+
res = ssh_1.execute("ping -c 1 %s" % gateway)
1212+
self.debug("ping -c 1 %s: %s" % (gateway, res))
12021213

12031214
result = str(res)
12041215
self.assertEqual(

0 commit comments

Comments
 (0)