You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ta...@apache.org on 2013/10/25 11:17:43 UTC
git commit: updated refs/heads/master to da7d2fe
Updated Branches:
refs/heads/master 210306881 -> da7d2fe4f
CLOUDSTACK-4691: Deleted host maintenance tests from this file
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/da7d2fe4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/da7d2fe4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/da7d2fe4
Branch: refs/heads/master
Commit: da7d2fe4f3676be7d159a1235a2434ef1f83333b
Parents: 2103068
Author: SrikanteswaraRao Talluri <ta...@apache.org>
Authored: Fri Oct 25 14:44:37 2013 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Fri Oct 25 14:47:11 2013 +0530
----------------------------------------------------------------------
test/integration/component/test_egress_rules.py | 207 -------------------
1 file changed, 207 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da7d2fe4/test/integration/component/test_egress_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py
index 05b4544..f8e8e79 100644
--- a/test/integration/component/test_egress_rules.py
+++ b/test/integration/component/test_egress_rules.py
@@ -2149,211 +2149,4 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
return
-class TestEgressAfterHostMaintenance(cloudstackTestCase):
- def setUp(self):
-
- self.apiclient = self.testClient.getApiClient()
- self.dbclient = self.testClient.getDbConnection()
- self.cleanup = []
- return
-
- def tearDown(self):
- try:
- #Clean up, terminate the created templates
- cleanup_resources(self.apiclient, self.cleanup)
-
- except Exception as e:
- raise Exception("Warning: Exception during cleanup : %s" % e)
- return
-
- @classmethod
- def setUpClass(cls):
- cls.services = Services().services
- cls.api_client = super(
- TestEgressAfterHostMaintenance,
- cls
- ).getClsTestClient().getApiClient()
-
- # Get Zone, Domain and templates
- cls.domain = get_domain(cls.api_client, cls.services)
- cls.zone = get_zone(cls.api_client, cls.services)
- cls.services['mode'] = cls.zone.networktype
- cls.pod = get_pod(
- cls.api_client,
- zoneid=cls.zone.id
- )
-
- template = get_template(
- cls.api_client,
- cls.zone.id,
- cls.services["ostype"]
- )
- cls.services["domainid"] = cls.domain.id
- cls.services["virtual_machine"]["zoneid"] = cls.zone.id
- cls.services["virtual_machine"]["template"] = template.id
-
- cls.service_offering = ServiceOffering.create(
- cls.api_client,
- cls.services["service_offering"]
- )
- cls.account = Account.create(
- cls.api_client,
- cls.services["account"],
- domainid=cls.domain.id
- )
- cls.services["account"] = cls.account.name
- cls._cleanup = [
- cls.account,
- cls.service_offering
- ]
- return
-
- @classmethod
- def tearDownClass(cls):
- try:
- #Cleanup resources used
- cleanup_resources(cls.api_client, cls._cleanup)
-
- except Exception as e:
- raise Exception("Warning: Exception during cleanup : %s" % e)
-
- return
-
- @attr(speed = "slow")
- @attr(tags = ["sg", "eip", "maintenance"])
- def test_egress_after_host_maintenance(self):
- """Test maintenance case for egress
- """
-
- # Validate the following:
- # 1. createaccount of type user
- # 2. createsecuritygroup (ssh) for this account
- # 3. authorizeSecurityGroupIngress to allow ssh access to the VM
- # 4. authorizeSecurityGroupEgress to allow ssh access only out to
- # CIDR: 0.0.0.0/0
- # 5. deployVirtualMachine into this security group (ssh)
- # 6. deployed VM should be Running, ssh should be allowed into the VM
- # 7. Enable maintenance mode for host, cance maintenance mode
- # 8. User should be able to SSH into VM after maintainace
-
- security_group = SecurityGroup.create(
- self.apiclient,
- self.services["security_group"],
- account=self.account.name,
- domainid=self.account.domainid
- )
- self.debug("Created security group with ID: %s" % security_group.id)
-
- # Default Security group should not have any ingress rule
- sercurity_groups = SecurityGroup.list(
- self.apiclient,
- account=self.account.name,
- domainid=self.account.domainid
- )
- self.assertEqual(
- isinstance(sercurity_groups, list),
- True,
- "Check for list security groups response"
- )
-
- self.assertEqual(
- len(sercurity_groups),
- 2,
- "Check List Security groups response"
- )
- # Authorize Security group to SSH to VM
- self.debug(
- "Authorizing ingress rule for sec group ID: %s for ssh access"
- % security_group.id)
- ingress_rule = security_group.authorize(
- self.apiclient,
- self.services["security_group"],
- account=self.account.name,
- domainid=self.account.domainid
- )
-
- self.assertEqual(
- isinstance(ingress_rule, dict),
- True,
- "Check ingress rule created properly"
- )
-
- ssh_rule = (ingress_rule["ingressrule"][0]).__dict__
-
- # Authorize Security group to SSH to VM
- self.debug(
- "Authorizing egress rule for sec group ID: %s for ssh access"
- % security_group.id)
- egress_rule = security_group.authorizeEgress(
- self.apiclient,
- self.services["security_group"],
- account=self.account.name,
- domainid=self.account.domainid
- )
-
- self.assertEqual(
- isinstance(egress_rule, dict),
- True,
- "Check egress rule created properly"
- )
- ssh_egress_rule = (egress_rule["egressrule"][0]).__dict__
-
- self.virtual_machine = VirtualMachine.create(
- self.apiclient,
- self.services["virtual_machine"],
- accountid=self.account.name,
- domainid=self.account.domainid,
- serviceofferingid=self.service_offering.id,
- securitygroupids=[security_group.id]
- )
- self.debug("Deploying VM in account: %s" % self.account.name)
-
- # Should be able to SSH VM
- try:
- self.debug("SSH into VM: %s" % self.virtual_machine.id)
- ssh = self.virtual_machine.get_ssh_client()
- except Exception as e:
- self.fail("SSH Access failed for %s: %s" % \
- (self.virtual_machine.ipaddress, e)
- )
- vms = VirtualMachine.list(
- self.apiclient,
- id=self.virtual_machine.id,
- listall=True
- )
- self.assertEqual(
- isinstance(vms, list),
- True,
- "Check list VMs response for valid host"
- )
- vm = vms[0]
-
- self.debug("Enabling host maintenance for ID: %s" % vm.hostid)
- cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
- cmd.id = vm.hostid
- self.apiclient.prepareHostForMaintenance(cmd)
-
- self.debug("Canceling host maintenance for ID: %s" % vm.hostid)
- cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
- cmd.id = vm.hostid
- self.apiclient.cancelHostMaintenance(cmd)
-
- self.debug("Waiting for SSVMs to come up")
- wait_for_ssvms(
- self.apiclient,
- zoneid=self.zone.id,
- podid=self.pod.id,
- )
- self.debug("Starting VM: %s" % self.virtual_machine.id)
-
- self.virtual_machine.start(self.apiclient)
- # Should be able to SSH VM
- try:
- self.debug("SSH into VM: %s" % self.virtual_machine.id)
- ssh = self.virtual_machine.get_ssh_client(reconnect=True)
- except Exception as e:
- self.fail("SSH Access failed for %s: %s" % \
- (self.virtual_machine.ipaddress, e)
- )
- return