Skip to content

Commit

Permalink
CLOUDSTACK-6776: Removed hard coded vlan ids from BVT test_non_contig…
Browse files Browse the repository at this point in the history
…uous_vlan.py

Conflicts:
	test/integration/smoke/test_non_contigiousvlan.py
  • Loading branch information
bvbharat authored and Girish Shilamkar committed Jun 5, 2014
1 parent 7ccf4bd commit 96272f4
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions test/integration/smoke/test_non_contigiousvlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,28 @@
# specific language governing permissions and limitations
# under the License.

from marvin import cloudstackTestCase
from marvin.cloudstackAPI import *
#from marvin.cloudstackAPI import *
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import Account
from marvin.lib.base import PhysicalNetwork
from marvin.lib.common import setNonContiguousVlanIds, get_zone
from nose.plugins.attrib import attr

class Services():
def __init__(self):
self.services = {
"vlan": {
"part": ["4090-4091", "4092-4095"],
"full": "4090-4095",
}
}


@attr(tags = ["simulator", "advanced", "selfservice"])
@attr(tags = ["simulator", "advanced", "selfservice"], BugId="CLOUDSTACK-6776")
class TestUpdatePhysicalNetwork(cloudstackTestCase):
"""
Test to extend physical network vlan range
"""
def setUp(self):
self.vlan = Services().services["vlan"]
self.apiClient = self.testClient.getApiClient()
self.zone = get_zone(self.apiClient, self.testClient.getZoneForTests())
self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiClient, self.zone.id)

self.physicalnetworkid = self.physicalnetwork.id
self.existing_vlan = self.physicalnetwork.vlan

if self.vlan is None:
raise Exception("Failed to set non contiguous vlan ids to test. Free some ids from \
from existing physical networks at ends")


def test_extendPhysicalNetworkVlan(self):
Expand All @@ -53,13 +50,13 @@ def test_extendPhysicalNetworkVlan(self):
self.network = phy_networks[0]
self.networkid = phy_networks[0].id
self.existing_vlan = phy_networks[0].vlan
vlan1 = self.existing_vlan+","+self.vlan["part"][0]
vlan1 = self.existing_vlan+","+self.vlan["partial_range"][0]
updatePhysicalNetworkResponse = self.network.update(self.apiClient, id = self.networkid, vlan = vlan1)
self.assert_(updatePhysicalNetworkResponse is not None,
msg="couldn't extend the physical network with vlan %s"%vlan1)
self.assert_(isinstance(self.network, PhysicalNetwork))

vlan2 = vlan1+","+self.vlan["part"][1]
vlan2 = vlan1+","+self.vlan["partial_range"][1]
updatePhysicalNetworkResponse2 = self.network.update(self.apiClient, id = self.networkid, vlan = vlan2)
self.assert_(updatePhysicalNetworkResponse2 is not None,
msg="couldn't extend the physical network with vlan %s"%vlan2)
Expand All @@ -68,7 +65,7 @@ def test_extendPhysicalNetworkVlan(self):
vlanranges= updatePhysicalNetworkResponse2.vlan
self.assert_(vlanranges is not None,
"No VLAN ranges found on the deployment")
self.assert_(vlanranges.find(self.vlan["full"]) > 0, "vlan ranges are not extended")
self.assert_(str(vlanranges) == vlan2, "vlan ranges are not extended")


def tearDown(self):
Expand All @@ -82,6 +79,6 @@ def tearDown(self):
self.network = phy_networks[0]
self.networkid = phy_networks[0].id
updateResponse = self.network.update(self.apiClient, id = self.networkid, vlan=self.existing_vlan)
self.assert_(updateResponse.vlan.find(self.vlan["full"]) < 0,
self.assert_(updateResponse.vlan.find(self.vlan["full_range"]) < 0,
"VLAN was not removed successfully")

0 comments on commit 96272f4

Please sign in to comment.