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 788FF1975A for ; Thu, 21 Apr 2016 13:44:50 +0000 (UTC) Received: (qmail 56339 invoked by uid 500); 21 Apr 2016 13:44:50 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 56278 invoked by uid 500); 21 Apr 2016 13:44:50 -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 56267 invoked by uid 99); 21 Apr 2016 13:44:49 -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, 21 Apr 2016 13:44:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4892BDFF41; Thu, 21 Apr 2016 13:44:49 +0000 (UTC) From: dmabry To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-9349: Enable root disk detach ... Content-Type: text/plain Message-Id: <20160421134449.4892BDFF41@git1-us-west.apache.org> Date: Thu, 21 Apr 2016 13:44:49 +0000 (UTC) Github user dmabry commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1500#discussion_r60581671 --- Diff: test/integration/component/test_volumes.py --- @@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self): "Check the state of VM" ) except Exception as e: - self.fail("Exception occuered: %s" % e) + self.fail("Exception occurred: %s" % e) + return + + @attr(tags=["advanced", "advancedns"], required_hardware="false") + def test_02_root_volume_attach_detach(self): + """Test Root Volume attach/detach to VM + """ + + # Validate the following + # 1. Deploy a VM + # 2. Verify that we are testing a supported hypervisor + # 3. Check for root volume + # 4. Stop VM + # 5. Detach root volume + # 6. Verify root volume detached + # 7. Attach root volume + # 8. Start VM + + # Verify we are using a supported hypervisor + if (self.hypervisor.lower() == 'vmware' + or self.hypervisor.lower() == 'kvm' + or self.hypervisor.lower() == 'simulator' + or self.hypervisor.lower() == 'xenserver'): + + try: + # Check for root volume + root_volume_response = Volume.list( + self.apiclient, + virtualmachineid=self.virtual_machine.id, + type='ROOT', + listall=True + ) + self.assertNotEqual( --- End diff -- @nitt10prashant - Thanks for the feedback. I was merely following an established pattern that I observed earlier in the file. Please look at lines 499 - 510 as an example. I have put the code below for your convenience. Should that code be refactored as well? I just want to understand if my situation that I'm testing is different than the code I'm referencing below. In the end, I'm happy to make the change. Thanks again for the feedback. ` # Check List Volume response for newly created volume list_volume_response = Volume.list( self.apiclient, id=volume.id ) self.assertNotEqual( list_volume_response, None, "Check if volume exists in ListVolumes") self.assertEqual( isinstance(list_volume_response, list), True, "Check list volumes response for valid list")` --- 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. ---