Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion test/integration/smoke/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,7 @@ def setUpClass(cls):
# Create Network Offering
cls.services["shared_network_offering"]["specifyVlan"] = "True"
cls.services["shared_network_offering"]["specifyIpRanges"] = "True"
cls.hv = cls.testClient.getHypervisorInfo()
cls.shared_network_offering = NetworkOffering.create(cls.apiclient, cls.services["shared_network_offering"],
conservemode=False)

Expand All @@ -1884,6 +1885,7 @@ def setUpClass(cls):
zoneid=cls.zone.id)
cls._cleanup = [
cls.service_offering,
cls.shared_network,
cls.shared_network_offering
]
return
Expand Down Expand Up @@ -1960,6 +1962,8 @@ def verify_ip_address_in_router(self, router, host, ipaddress, device, isExist=T

@attr(tags=["advanced", "shared"])
def test_01_deployVMInSharedNetwork(self):
if self.hv.lower() == 'simulator':
self.skipTest("Hypervisor is simulator - skipping Test..")
try:
self.virtual_machine = VirtualMachine.create(self.apiclient, self.services["virtual_machine"],
networkids=[self.shared_network.id],
Expand Down Expand Up @@ -1993,6 +1997,8 @@ def test_01_deployVMInSharedNetwork(self):

@attr(tags=["advanced", "shared"])
def test_02_verifyRouterIpAfterNetworkRestart(self):
if self.hv.lower() == 'simulator':
self.skipTest("Hypervisor is simulator - skipping Test..")
routerIp = self.services["shared_network"]["routerip"]
self.debug("restarting network with cleanup")
try:
Expand All @@ -2018,12 +2024,14 @@ def test_02_verifyRouterIpAfterNetworkRestart(self):

@attr(tags=["advanced", "shared"])
def test_03_destroySharedNetwork(self):
if self.hv.lower() == 'simulator':
self.skipTest("Hypervisor is simulator - skipping Test..")
routerIp = self.services["shared_network"]["routerip"]
try:
self.shared_network.delete(self.apiclient)
except Exception as e:
self.fail("Failed to destroy the shared network")

self._cleanup.remove(self.shared_network)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done in the teardown method,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention of removing the shared network from the cleanup list is that, if the deletion of the n/w happens as part of the test, then it need not be cleaned up during the teardown phase, else, if for any reason this test fails or is skipped, the network will be deleted during teardown

self.debug("Fetch the placeholder record for the router")
nic_ip_address = self.dbclient.execute(
"select ip4_address from nics where strategy='Placeholder' and ip4_address = '%s' and removed is NOT NULL;" % routerIp);
Expand Down