You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/08/12 10:16:13 UTC
git commit: updated refs/heads/master to bc92bfd
Repository: cloudstack
Updated Branches:
refs/heads/master 737f76df8 -> bc92bfd82
CLOUDSTACK: Test script to verify fix for CS-5332
Signed-off-by: sanjeev <sa...@apache.org>
Signed-off-by: Santhosh Edukulla <sa...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bc92bfd8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bc92bfd8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bc92bfd8
Branch: refs/heads/master
Commit: bc92bfd827d2d501675ae13ae90eda3c038d4280
Parents: 737f76d
Author: sanjeev <sa...@apache.org>
Authored: Tue Aug 12 10:59:09 2014 +0530
Committer: Santhosh Edukulla <sa...@gmail.com>
Committed: Tue Aug 12 13:45:55 2014 +0530
----------------------------------------------------------------------
.../component/test_network_offering.py | 118 ++++++++++++++++++-
1 file changed, 116 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc92bfd8/test/integration/component/test_network_offering.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py
index f2251ff8..2c9a057 100644
--- a/test/integration/component/test_network_offering.py
+++ b/test/integration/component/test_network_offering.py
@@ -21,7 +21,8 @@
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
#from marvin.cloudstackAPI import *
-from marvin.lib.utils import (cleanup_resources)
+from marvin.lib.utils import (cleanup_resources,
+ validateList)
from marvin.lib.base import (VirtualMachine,
Account,
Network,
@@ -35,6 +36,7 @@ from marvin.lib.base import (VirtualMachine,
from marvin.lib.common import (get_domain,
get_zone,
get_template)
+from marvin.codes import *
class Services:
@@ -735,7 +737,119 @@ class TestNOVirtualRouter(cloudstackTestCase):
)
return
-
+ @attr(tags=["advanced", "selfservice"])
+ def test_03_network_off_CS5332(self):
+ """
+ @Desc: Test Network offering with Custom system offering for VR
+ @Steps:
+ Step1: Create new system offering for domain router
+ Step2: Verify the custom system offering creation for domain router
+ Step3: Create new network offering with domain router system offering created in step1
+ Step4: Verify the network offering creation with custom system offering for VR
+ Step5: Enable the network offering created in step3
+ Step5: Create isolated guest network using network offering created in step3
+ Step6: Deploy guest vm in network created above
+ """
+ #create custom system offering for VR
+ self.services["service_offering"]["name"] = "test_service_offering_for_router"
+ self.services["service_offering"]["displaytext"] = "test_service_offering_for_router"
+ self.services["service_offering"]["cpuspeed"] = 500
+ self.services["service_offering"]["memory"] = 512
+ self.services["service_offering"]["systemvmtype"] = "domainrouter"
+ self.services["service_offering"]["storagetype"] = "shared"
+ self.services["service_offering"]["issystem"] = "true"
+ vr_sys_off = ServiceOffering.create(
+ self.apiclient,
+ self.services["service_offering"],
+ )
+ self.assertIsNotNone(
+ vr_sys_off,
+ "Failed to create custom system offering for VR"
+ )
+ vr_sys_off_res = ServiceOffering.list(
+ self.apiclient,
+ id = vr_sys_off.id,
+ issystem = "true"
+ )
+ status = validateList(vr_sys_off_res)
+ self.assertEquals(
+ PASS,
+ status[0],
+ "Listing of VR system offering failed"
+ )
+ self.assertEqual(
+ len(vr_sys_off_res),
+ 1,
+ "Listing more than VR system offerings created"
+ )
+ self.debug("Created system offering with id %s" % vr_sys_off.id)
+ # Create a network offering with all virtual router services enabled using custom system offering for VR
+ self.debug(
+ "Creating n/w offering with all services in VR & using custom system offering for VR"
+ )
+ self.network_offering = NetworkOffering.create(
+ self.apiclient,
+ self.services["network_offering"],
+ conservemode=False,
+ serviceofferingid=vr_sys_off.id
+ )
+ self.assertIsNotNone(
+ self.network_offering,
+ "Failed to create network offering with custom system offering for VR"
+ )
+ network_off_res = NetworkOffering.list(
+ self.apiclient,
+ id=self.network_offering.id
+ )
+ status = validateList(network_off_res)
+ self.assertEquals(
+ PASS,
+ status[0],
+ "Listing of network offerings failed"
+ )
+ self.assertEquals(
+ len(network_off_res),
+ 1,
+ "More than one network offerings are created"
+ )
+ self.assertEquals(
+ network_off_res[0].serviceofferingid,
+ vr_sys_off.id,
+ "FAIL: Network offering has been created with default system offering"
+ )
+ self.cleanup.append(self.network_offering)
+ self.cleanup.append(vr_sys_off)
+ self.debug("Created n/w offering with ID: %s" % self.network_offering.id)
+ # Enable Network offering
+ self.network_offering.update(self.apiclient, state='Enabled')
+ # Creating network using the network offering created
+ self.debug("Creating network with network offering: %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")
+ self.debug("Created network with ID: %s" % self.network.id)
+ self.debug("Deploying VM in account: %s" % self.account.name)
+ # Spawn an instance in that network
+ virtual_machine = VirtualMachine.create(
+ self.apiclient,
+ self.services["virtual_machine"],
+ accountid=self.account.name,
+ domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ networkids=[str(self.network.id)]
+ )
+ self.assertIsNotNone(
+ virtual_machine,
+ "VM creation failed with network %s" % self.network.id
+ )
+ self.debug("Deployed VM in network: %s" % self.network.id)
+ return
class TestNetworkUpgrade(cloudstackTestCase):