You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by pritisarap12 <gi...@git.apache.org> on 2015/07/15 07:58:04 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

GitHub user pritisarap12 opened a pull request:

    https://github.com/apache/cloudstack/pull/590

    CLOUDSTACK-8632: Unable to revert snapshot on XenServer

    On XenServer check that volume snapshot fails for the ROOT volume of VM which has VM snapshot created. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pritisarap12/cloudstack CLOUDSTACK-8632-Unable-to-revert-snapshot-on-XenServer

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/590.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #590
    
----
commit e5aee72fd4940e4bd2a90f690e5ed033b54f1821
Author: Gaurav Aradhye <ga...@clogeny.com>
Date:   2015-07-15T05:45:47Z

    CLOUDSTACK-8632: Unable to revert snapshot on XenServer

----


---
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.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/590


---
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.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/590#issuecomment-121510634
  
    Hi @pritisarap12 
    
    The issue/PR title says "Unable to rever snapshot on XenServer", however you have created a component test to "check that volume snapshot fails for the ROOT volume of VM which has VM snapshot created."
    
    Could you please just elaborate a bit more on the meaning of this PR?
    
    Cheers,
    Wilder 


---
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.
---

Re: [GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

Posted by Sanjeev N <sa...@apache.org>.
LGTM

On Thu, Jul 16, 2015 at 11:34 AM, wilderrodrigues <gi...@git.apache.org>
wrote:

> Github user wilderrodrigues commented on the pull request:
>
>     https://github.com/apache/cloudstack/pull/590#issuecomment-121843137
>
>     LGTM
>
>
> ---
> 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.
> ---
>

[GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

Posted by wilderrodrigues <gi...@git.apache.org>.
Github user wilderrodrigues commented on the pull request:

    https://github.com/apache/cloudstack/pull/590#issuecomment-121843137
  
    LGTM


---
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.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

Posted by pritisarap12 <gi...@git.apache.org>.
Github user pritisarap12 commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/590#discussion_r34657738
  
    --- Diff: test/integration/testpaths/testpath_revert_snap.py ---
    @@ -0,0 +1,159 @@
    +# Licensed to the Apache Software Foundation (ASF) under one
    +# or more contributor license agreements.  See the NOTICE file
    +# distributed with this work for additional information
    +# regarding copyright ownership.  The ASF licenses this file
    +# to you under the Apache License, Version 2.0 (the
    +# "License"); you may not use this file except in compliance
    +# with the License.  You may obtain a copy of the License at
    +#
    +#   http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing,
    +# software distributed under the License is distributed on an
    +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +# KIND, either express or implied.  See the License for the
    +# specific language governing permissions and limitations
    +# under the License.
    +""" Test cases for Verifying revert snapshot 
    +"""
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import (cleanup_resources,
    +                             validateList)
    +from marvin.lib.base import (Account,
    +                             ServiceOffering,
    +                             Snapshot,
    +                             VmSnapshot,
    +                             VirtualMachine,
    +                             )
    +from marvin.lib.common import (get_domain,
    +                               get_zone,
    +                               get_template,
    +                               list_volumes,
    +                              )
    +
    +class TestUnableToRevertSnapshot(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        testClient = super(TestUnableToRevertSnapshot, cls).getClsTestClient()
    +        cls.apiclient = testClient.getApiClient()
    +        cls.testdata = testClient.getParsedTestDataConfig()
    +
    +        cls.hypervisor = cls.testClient.getHypervisorInfo()
    +        # Get Zone, Domain and templates
    +        cls.domain = get_domain(cls.apiclient)
    +        cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
    +
    +        cls.template = get_template(
    +            cls.apiclient,
    +            cls.zone.id,
    +            cls.testdata["ostype"])
    +
    +        cls._cleanup = []
    +
    +        try:
    +
    +            cls.skiptest = False
    +
    +            if cls.hypervisor.lower() not in ['xenserver']:
    +                cls.skiptest = True
    +                return     
    +            # Create an account
    +            cls.account = Account.create(
    +                cls.apiclient,
    +                cls.testdata["account"],
    +                domainid=cls.domain.id
    +            )
    +
    +            # Create user api client of the account
    +            cls.userapiclient = testClient.getUserApiClient(
    +                UserName=cls.account.name,
    +                DomainName=cls.account.domain
    +            )
    +            # Create Service offering
    +            cls.service_offering = ServiceOffering.create(
    +                cls.apiclient,
    +                cls.testdata["service_offering"],
    +            )
    +
    +            cls._cleanup = [
    +                cls.account,
    +                cls.service_offering,
    +            ]
    +        except Exception as e:
    +            cls.tearDownClass()
    +            raise e
    +        return
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.apiclient, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.dbclient = self.testClient.getDbConnection()
    +        self.cleanup = []
    +        if self.skiptest:
    +            self.skipTest("This test is to be checked on xenserver only  Hence, skip for %s"  % self.hypervisor)
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +        return
    +
    +    @attr(tags=["advanced", "basic"])
    +    def test_01_check_revert_snapshot(self):
    +        """ Test revert snapshot on XenServer
    +
    +        # 1. Deploy a VM.
    +        # 2. Take VM snapshot.
    +        # 3. Verify that volume snapshot fails with error 
    +                can not create volume snapshot for VM with VM-snapshot
    +
    +        """
    +        # Step 1
    +        # Create VM on cluster wide
    +        vm = VirtualMachine.create(
    +            self.userapiclient,
    +            self.testdata["small"],
    +            templateid=self.template.id,
    +            accountid=self.account.name,
    +            domainid=self.account.domainid,
    +            serviceofferingid=self.service_offering.id,
    +            zoneid=self.zone.id,
    +        )
    +        volumes_cluster_list = list_volumes(
    +                self.apiclient,
    +                virtualmachineid=vm.id,
    +                type='ROOT',
    +                listall=True
    +                )
    +
    +        volume_list_validation = validateList(volumes_cluster_list)
    +
    +        self.assertNotEqual(
    --- End diff --
    
    Updated testcase with review changes.


---
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.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8632: Unable to revert snapsho...

Posted by sanju1010 <gi...@git.apache.org>.
Github user sanju1010 commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/590#discussion_r34650668
  
    --- Diff: test/integration/testpaths/testpath_revert_snap.py ---
    @@ -0,0 +1,159 @@
    +# Licensed to the Apache Software Foundation (ASF) under one
    +# or more contributor license agreements.  See the NOTICE file
    +# distributed with this work for additional information
    +# regarding copyright ownership.  The ASF licenses this file
    +# to you under the Apache License, Version 2.0 (the
    +# "License"); you may not use this file except in compliance
    +# with the License.  You may obtain a copy of the License at
    +#
    +#   http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing,
    +# software distributed under the License is distributed on an
    +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +# KIND, either express or implied.  See the License for the
    +# specific language governing permissions and limitations
    +# under the License.
    +""" Test cases for Verifying revert snapshot 
    +"""
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import (cleanup_resources,
    +                             validateList)
    +from marvin.lib.base import (Account,
    +                             ServiceOffering,
    +                             Snapshot,
    +                             VmSnapshot,
    +                             VirtualMachine,
    +                             )
    +from marvin.lib.common import (get_domain,
    +                               get_zone,
    +                               get_template,
    +                               list_volumes,
    +                              )
    +
    +class TestUnableToRevertSnapshot(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        testClient = super(TestUnableToRevertSnapshot, cls).getClsTestClient()
    +        cls.apiclient = testClient.getApiClient()
    +        cls.testdata = testClient.getParsedTestDataConfig()
    +
    +        cls.hypervisor = cls.testClient.getHypervisorInfo()
    +        # Get Zone, Domain and templates
    +        cls.domain = get_domain(cls.apiclient)
    +        cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
    +
    +        cls.template = get_template(
    +            cls.apiclient,
    +            cls.zone.id,
    +            cls.testdata["ostype"])
    +
    +        cls._cleanup = []
    +
    +        try:
    +
    +            cls.skiptest = False
    +
    +            if cls.hypervisor.lower() not in ['xenserver']:
    +                cls.skiptest = True
    +                return     
    +            # Create an account
    +            cls.account = Account.create(
    +                cls.apiclient,
    +                cls.testdata["account"],
    +                domainid=cls.domain.id
    +            )
    +
    +            # Create user api client of the account
    +            cls.userapiclient = testClient.getUserApiClient(
    +                UserName=cls.account.name,
    +                DomainName=cls.account.domain
    +            )
    +            # Create Service offering
    +            cls.service_offering = ServiceOffering.create(
    +                cls.apiclient,
    +                cls.testdata["service_offering"],
    +            )
    +
    +            cls._cleanup = [
    +                cls.account,
    +                cls.service_offering,
    +            ]
    +        except Exception as e:
    +            cls.tearDownClass()
    +            raise e
    +        return
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.apiclient, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.dbclient = self.testClient.getDbConnection()
    +        self.cleanup = []
    +        if self.skiptest:
    +            self.skipTest("This test is to be checked on xenserver only  Hence, skip for %s"  % self.hypervisor)
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +        return
    +
    +    @attr(tags=["advanced", "basic"])
    +    def test_01_check_revert_snapshot(self):
    +        """ Test revert snapshot on XenServer
    +
    +        # 1. Deploy a VM.
    +        # 2. Take VM snapshot.
    +        # 3. Verify that volume snapshot fails with error 
    +                can not create volume snapshot for VM with VM-snapshot
    +
    +        """
    +        # Step 1
    +        # Create VM on cluster wide
    +        vm = VirtualMachine.create(
    +            self.userapiclient,
    +            self.testdata["small"],
    +            templateid=self.template.id,
    +            accountid=self.account.name,
    +            domainid=self.account.domainid,
    +            serviceofferingid=self.service_offering.id,
    +            zoneid=self.zone.id,
    +        )
    +        volumes_cluster_list = list_volumes(
    +                self.apiclient,
    +                virtualmachineid=vm.id,
    +                type='ROOT',
    +                listall=True
    +                )
    +
    +        volume_list_validation = validateList(volumes_cluster_list)
    +
    +        self.assertNotEqual(
    --- End diff --
    
    Instead of this, compare whether the list is returning PASS or not.


---
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.
---