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/12/15 12:11:50 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-9168: Testpath to check if wro...

GitHub user pritisarap12 opened a pull request:

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

    CLOUDSTACK-9168: Testpath to check if wrong value is inserted into nics table netmask field when creating a VM

    Testcase Result:
    
    Check Netmask value in database ... === TestName: test_01_netmask_value_check | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 1 test in 143.944s
    
    OK


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

    $ git pull https://github.com/pritisarap12/cloudstack CLOUDSTACK-9168-Check-if-wrong-value-is-inserted-into-nics-table-netmask-field-when-creating-a-VM

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

    https://github.com/apache/cloudstack/pull/1245.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 #1245
    
----
commit b7e0941158521b1e1330b51f1a151f6b9b9f543b
Author: Priti Sarap <pr...@clogeny.com>
Date:   2015-12-15T11:08:17Z

    CLOUDSTACK-9168: Testpath to check if wrong value is inserted into nics table netmask field when creating a VM

----


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-222335221
  
    ### ACS CI BVT Run
     **Sumarry:**
     Build Number 76
     Hypervisor xenserver
     NetworkType Advanced
     Passed=72
     Failed=1
     Skipped=3
    
    _Link to logs Folder (search by build_no):_ https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0
    
    
    **Failed tests:**
    * test_vm_life_cycle.py
    
     * test_10_attachAndDetach_iso Failing since 2 runs
    
    
    **Skipped tests:**
    test_vm_nic_adapter_vmxnet3
    test_static_role_account_acls
    test_deploy_vgpu_enabled_vm
    
    **Passed test suits:**
    test_deploy_vm_with_userdata.py
    test_affinity_groups_projects.py
    test_portable_publicip.py
    test_vpc_vpn.py
    test_over_provisioning.py
    test_global_settings.py
    test_scale_vm.py
    test_service_offerings.py
    test_routers_iptables_default_policy.py
    test_routers.py
    test_reset_vm_on_reboot.py
    test_snapshots.py
    test_deploy_vms_with_varied_deploymentplanners.py
    test_login.py
    test_list_ids_parameter.py
    test_public_ip_range.py
    test_multipleips_per_nic.py
    test_regions.py
    test_affinity_groups.py
    test_network_acl.py
    test_pvlan.py
    test_volumes.py
    test_nic.py
    test_deploy_vm_root_resize.py
    test_resource_detail.py
    test_secondary_storage.py
    test_disk_offerings.py


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#discussion_r51686104
  
    --- Diff: test/integration/testpaths/testpath_netmask.py ---
    @@ -0,0 +1,152 @@
    +# 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 to Check Snapshots size in database
    +"""
    +
    +import re
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import (cleanup_resources,
    +                              )
    +from marvin.lib.base import (Account,
    +                             ServiceOffering,
    +                             VirtualMachine,
    +                             )
    +from marvin.lib.common import (get_domain,
    +                               get_zone,
    +                               get_template,
    +                               )
    +
    +
    +class TestCheckNetmask(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        testClient = super(TestCheckNetmask, 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 = []
    +
    +        cls.skiptest = False
    +
    +        if cls.hypervisor.lower() not in ["xenserver"]:
    +            cls.skiptest = True
    +            return
    +
    +        try:
    +
    +            # Create an account
    +            cls.account = Account.create(
    +                cls.apiclient,
    +                cls.testdata["account"],
    +                domainid=cls.domain.id
    +            )
    +            cls._cleanup.append(cls.account)
    +
    +            # 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.append(cls.service_offering)
    +
    +            cls.vm = VirtualMachine.create(
    +                cls.apiclient,
    +                cls.testdata["small"],
    +                templateid=cls.template.id,
    +                accountid=cls.account.name,
    +                domainid=cls.account.domainid,
    +                serviceofferingid=cls.service_offering.id,
    +                zoneid=cls.zone.id,
    +                mode=cls.zone.networktype
    +            )
    +
    +        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):
    +        if self.skiptest:
    +            self.skipTest(
    +                "Test not to be run on %s" %
    +                self.hypervisor)
    +        self.apiclient = self.testClient.getApiClient()
    +        self.dbclient = self.testClient.getDbConnection()
    +        self.cleanup = []
    +
    +    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=["basic"], required_hardware="false")
    +    def test_01_netmask_value_check(self):
    +        """ Check Netmask value in database
    +            1. Check if netmask attribute in nics table
    +                stores correct value.
    +        """
    +
    +        qryresult_netmask = self.dbclient.execute(
    +            " select id, uuid, netmask\
    +                    from nics where netmask = '%s';" %
    +            self.vm.nic[0].netmask)
    +
    +        self.assertNotEqual(
    +            len(qryresult_netmask),
    +            0,
    +            "Check if netmask attribute in nics table \
    +            stores correct value")
    +
    +        netmask_id = qryresult_netmask[0][2]
    +        if netmask_id != "NULL":
    +            netmask_value = re.match(
    --- End diff --
    
    This regex only checks for valid netmask. However, it does not validate whether the netmask is from the guest cidr.


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-189233999
  
    -1
    This test is not passing on a basic zone. In basic zone we don't list the network cidr in list network response. So test is failing at line no: 163. It only works for shared networks in advanced zone. So please add following steps in the test:
    1.Create a shared network in advanced zone (Change the tagging to advanced)
    2.Deploy vm in the shared network
    3.Do the validation


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-216208576
  
    @pritisarap12 please modify the test to be able to run on basic zone as well.
    
    rebase against master thanks


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-190057225
  
    Changed the tags to advanced zone:
    
    Testcase result:
    Check Netmask value in database ... === TestName: test_01_netmask_value_check | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 1 test in 122.485s
    
    OK



---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-189116369
  
    I have reviewed the code and it looks good to me as per the code review.


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#discussion_r51685979
  
    --- Diff: test/integration/testpaths/testpath_netmask.py ---
    @@ -0,0 +1,152 @@
    +# 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 to Check Snapshots size in database
    +"""
    +
    +import re
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import (cleanup_resources,
    +                              )
    +from marvin.lib.base import (Account,
    +                             ServiceOffering,
    +                             VirtualMachine,
    +                             )
    +from marvin.lib.common import (get_domain,
    +                               get_zone,
    +                               get_template,
    +                               )
    +
    +
    +class TestCheckNetmask(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        testClient = super(TestCheckNetmask, 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 = []
    +
    +        cls.skiptest = False
    +
    +        if cls.hypervisor.lower() not in ["xenserver"]:
    +            cls.skiptest = True
    +            return
    +
    +        try:
    +
    +            # Create an account
    +            cls.account = Account.create(
    +                cls.apiclient,
    +                cls.testdata["account"],
    +                domainid=cls.domain.id
    +            )
    +            cls._cleanup.append(cls.account)
    +
    +            # 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.append(cls.service_offering)
    +
    +            cls.vm = VirtualMachine.create(
    +                cls.apiclient,
    +                cls.testdata["small"],
    +                templateid=cls.template.id,
    +                accountid=cls.account.name,
    +                domainid=cls.account.domainid,
    +                serviceofferingid=cls.service_offering.id,
    +                zoneid=cls.zone.id,
    +                mode=cls.zone.networktype
    +            )
    +
    +        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):
    +        if self.skiptest:
    +            self.skipTest(
    +                "Test not to be run on %s" %
    +                self.hypervisor)
    +        self.apiclient = self.testClient.getApiClient()
    +        self.dbclient = self.testClient.getDbConnection()
    +        self.cleanup = []
    +
    +    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=["basic"], required_hardware="false")
    +    def test_01_netmask_value_check(self):
    +        """ Check Netmask value in database
    +            1. Check if netmask attribute in nics table
    +                stores correct value.
    +        """
    +
    +        qryresult_netmask = self.dbclient.execute(
    --- End diff --
    
    How can you make sure that this sql query would return the netmak belongs to the vm you had created? It is possible to have more than one isolated network with same CIDR. While running this test if there was already a vm created in a network with same CIDR, then this qurey would return multiple results.


---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-185550931
  
    Updated the testpath with review comments:
        --Validation of netmask 
            --check it is from correct CIDR



---
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-9168: Testpath to check if wro...

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

    https://github.com/apache/cloudstack/pull/1245#issuecomment-185550227
  
    Test result after modifications:
    
    Check Netmask value in database ... === TestName: test_01_netmask_value_check | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 1 test in 121.854s
    
    OK



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