From 1be9e42b93704e34342908d788d8d6a702612088 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Mon, 28 Mar 2016 16:06:57 +0530 Subject: [PATCH] [CLOUDSTACK-9328]: Fix vlan issues from test suite test_privategw_acl.py in BVT Bug-Id:## CLOUDSTACK-9328 [CLOUDSTACK-9328]: Made changes as per the review comment from Shwetaag [CLOUDSTACK-9328]: Made changes based on the CI results --- test/integration/smoke/test_privategw_acl.py | 28 +++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index d2e08f57d39..a1c5e85cf8c 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -24,6 +24,7 @@ from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * from nose.plugins.attrib import attr +from marvin.codes import PASS import time import logging @@ -195,8 +196,7 @@ class TestPrivateGwACL(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() - self.hypervisor = self.testClient.getHypervisorInfo() - + self.dbclient = self.testClient.getDbConnection() self.logger.debug("Creating Admin Account for Domain ID ==> %s" % self.domain.id) self.account = Account.create( self.apiclient, @@ -240,8 +240,16 @@ class TestPrivateGwACL(cloudstackTestCase): if not physical_networks: self.fail("No Physical Networks found!") - vlans = physical_networks[0].vlan.split('-') - vlan_1 = int(vlans[0]) + qresultset = self.dbclient.execute( + "select vnet from op_dc_vnet_alloc where physical_network_id=\ + (select id from physical_network where uuid='%s' ) and taken is NULL;" % physical_networks[0].id + ) + self.assertEqual(validateList(qresultset)[0], + PASS, + "Invalid sql query response" + ) + vlans = qresultset + vlan_1 = int(vlans[0][0]) acl = self.createACL(vpc) self.createACLItem(acl.id) @@ -308,8 +316,16 @@ class TestPrivateGwACL(cloudstackTestCase): if not physical_networks: self.fail("No Physical Networks found!") - vlans = physical_networks[0].vlan.split('-') - vlan_1 = int(vlans[0]) + qresultset = self.dbclient.execute( + "select vnet from op_dc_vnet_alloc where physical_network_id=\ + (select id from physical_network where uuid='%s' ) and taken is NULL;" % physical_networks[0].id + ) + self.assertEqual(validateList(qresultset)[0], + PASS, + "Invalid sql query response" + ) + vlans = qresultset + vlan_1 = int(vlans[0][0]) network_1 = self.createNetwork(vpc_1, gateway = '10.0.1.1') network_2 = self.createNetwork(vpc_2, gateway = '10.0.2.1')