From 51bfd56244d09701e4cc0368fb5fb4bc35343a94 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Tue, 12 Aug 2014 17:08:11 +0530 Subject: [PATCH] Test script to verify if there is an error in editing a network without network domain Signed-off-by: sanjeev --- .../component/test_network_offering.py | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 2c9a05734d2..9a7c78621d9 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -112,6 +112,19 @@ class Services: "SourceNat": 'VirtualRouter', }, }, + "network_offering_withoutDNS" : { + "name": 'NW offering without DNS', + "displaytext": 'NW offering without DNS', + "guestiptype": 'Isolated', + "supportedservices": 'SourceNat,StaticNat,Dhcp', + "traffictype": 'GUEST', + "availability": 'Optional', + "serviceProviderList": { + "Dhcp": 'VirtualRouter', + "SourceNat": 'VirtualRouter', + "StaticNat": 'VirtualRouter', + }, + }, "network": { "name": "Test Network", "displaytext": "Test Network", @@ -851,6 +864,57 @@ class TestNOVirtualRouter(cloudstackTestCase): self.debug("Deployed VM in network: %s" % self.network.id) return + @attr(tags=["advanced", "selfservice"]) + def test_04_network_without_domain_CS19303(self): + """ + @Desc: Errors editing a network without a network domain specified + @Steps: + Step1: Create a network offering with SourceNAT,staticNAT and dhcp services + Step2: Verify the network offering creation + Step3: Create an isolated network with the offering created in step1 and without a network domain specified + Step4: Verify the network creation + Step5: Edit the network and verify that updating network should not error out + """ + self.debug( + "Creating n/w offering with SourceNat,StaticNat and DHCP services in VR & conserve mode:off" + ) + self.network_offering = NetworkOffering.create( + self.api_client, + self.services["network_offering_withoutDNS"], + conservemode=False + ) + self.assertIsNotNone( + self.network_offering, + "Failed to create NO with Sourcenat,staticnat and dhcp only services" + ) + self.cleanup.append(self.network_offering) + self.debug("Created n/w offering with ID: %s" % self.network_offering.id) + # Enable Network offering + self.network_offering.update(self.apiclient, state='Enabled') + self.debug("Creating nw without dns service using no id: %s" % self.network_offering.id) + self.network = Network.create( + self.apiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.account.domainid, + networkofferingid=self.network_offering.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + self.network, + "Failed to create network without DNS service and network domain" + ) + self.debug("Created network with NO: %s" % self.network_offering.id) + try: + self.network_update = self.network.update( + self.apiclient, + name="NW without nw domain" + ) + self.debug("Success:Network update has been successful without network domain") + except Exception as e: + self.fail("Error editing a network without network domain specified: %s" % e) + return + class TestNetworkUpgrade(cloudstackTestCase): @classmethod