Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDD0D18EA6 for ; Thu, 27 Aug 2015 08:43:55 +0000 (UTC) Received: (qmail 78892 invoked by uid 500); 27 Aug 2015 08:43:55 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 78840 invoked by uid 500); 27 Aug 2015 08:43:55 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 78822 invoked by uid 99); 27 Aug 2015 08:43:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2015 08:43:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E4951DFC8C; Thu, 27 Aug 2015 08:43:54 +0000 (UTC) From: sanju1010 To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-8731-checking usage event for ... Content-Type: text/plain Message-Id: <20150827084354.E4951DFC8C@git1-us-west.apache.org> Date: Thu, 27 Aug 2015 08:43:54 +0000 (UTC) Github user sanju1010 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/691#discussion_r38073818 --- Diff: test/integration/component/test_persistent_networks.py --- @@ -1459,6 +1459,135 @@ def test_delete_account(self): return + def test_volume_delete_event_errorState(self): + """ + @summary: Test volume delete event generation in error state condition + @Steps: + + Step1: Create a network using network created in Step1 + Step2: Verifying that network creation is successful + Step3: Login to Virtual router and add iptable rule to block insertion of vm rules + Step6: deploy a vm using network created in step2 + Step7: check the Vm status for failure + Step8: destroy and expunge the vm + Step9: list the generated events for volume delete event. + """ + + # Listing all the networks available + + account = Account.create( + self.api_client, + self.services["account"], + domainid=self.domain.id) + + network = Network.create( + self.apiclient, + self.services["isolated_network"], + networkofferingid=self.isolated_persistent_network_offering.id, + accountid=self.account.name, + domainid=self.domain.id, + zoneid=self.zone.id) + + response = verifyNetworkState( + self.apiclient, + network.id, + "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) + self.assertIsNotNone( + network.vlan, + "vlan must not be null for persistent network") + try: + if self.zone.networktype == "Basic": + list_router_response = list_routers( + self.apiclient, + listall="true" + ) + else: + list_router_response = list_routers( + self.apiclient, + account=self.account.name, + domainid=self.account.domainid + ) + self.assertEqual( + isinstance(list_router_response, list), + True, + "Check list response returns a valid list" + ) + router = list_router_response[0] + + self.debug("Router ID: %s, state: %s" % (router.id, router.state)) + + self.assertEqual( + router.state, + 'Running', + "Check list router response for router state" + ) + self.hypervisor = self.testClient.getHypervisorInfo() + if self.hypervisor.lower() in ('vmware', 'hyperv'): + result = get_process_status( + self.apiclient.connection.mgtSvr, + 22, + self.apiclient.connection.user, + self.apiclient.connection.passwd, + router.linklocalip, + "iptables -I INPUT 1 -j DROP", + hypervisor=self.hypervisor + ) + else: + try: + hosts = list_hosts( + self.apiclient, + zoneid=router.zoneid, + type='Routing', + state='Up', + id=router.hostid + ) + + self.assertEqual( + isinstance(hosts, list), + True, + "Check list host returns a valid list" + ) + + host = hosts[0] + result = get_process_status( + host.ipaddress, + 22, "root", "xenroot", router.linklocalip, + "iptables -I INPUT 1 -j DROP" --- End diff -- Delete this rule once the test is done so that it won't have impact on the other tests. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---