You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by abhinandanprateek <gi...@git.apache.org> on 2016/11/25 10:39:16 UTC

[GitHub] cloudstack pull request #1784: CS-505: Marvin test to VR DNS Service

GitHub user abhinandanprateek opened a pull request:

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

    CS-505: Marvin test to VR DNS Service

    

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

    $ git pull https://github.com/shapeblue/cloudstack CS-505

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

    https://github.com/apache/cloudstack/pull/1784.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 #1784
    
----
commit 4e96d4f1626ff785c40addc333a54846dd3e0f02
Author: Abhinandan Prateek <ap...@apache.org>
Date:   2016-11-25T10:28:28Z

    CS-505: Marvin test to VR DNS Service

----


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by murali-reddy <gi...@git.apache.org>.
Github user murali-reddy commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @abhinandanprateek Multi-nic will be different scenario, we can skip that in this test case.


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90411534
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    +        cls.vm2 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm2.password = "password"
    +        cls.logger.debug("Created VM named dilton");
    +
    +        cls.services["natrule1"] = {
    +            "privateport": 22,
    +            "publicport": 22,
    +            "protocol": "TCP"
    +        }
    +
    +        cls.services["configurableData"] = {
    +            "host": {
    +                "password": "password",
    +                "username": "root",
    +                "port": 22
    +            },
    +            "input": "INPUT",
    +            "forward": "FORWARD"
    +        }
    +
    +        cls._cleanup = [
    +            cls.vm1,
    +            cls.vm2,
    +            cls.network,
    +            cls.network_offering,
    +            cls.service_offering,
    +            cls.account
    +        ]
    +
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.api_client, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def test_router_common(self):
    +        """Performs common router tests and returns router public_ips"""
    +
    +        routers = list_routers(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid
    +        )
    +
    +        self.assertEqual(
    +            isinstance(routers, list),
    +            True,
    +            "Check for list routers response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(routers) >= 1,
    +            "Check list router response"
    +        )
    +
    +        router = routers[0]
    +
    +        self.assertEqual(
    +            router.state,
    +            'Running',
    +            "Check list router response for router state"
    +        )
    +
    +        public_ips = list_publicIP(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            zoneid=self.zone.id
    +        )
    +
    +        self.assertEqual(
    +            isinstance(public_ips, list),
    +            True,
    +            "Check for list public IPs response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(public_ips) >= 1,
    +            "Check public IP list has at least one IP"
    +        )
    +        return public_ips
    +
    +
    +    @attr(tags=["advanced", "advancedns", "ssh"], required_hardware="true")
    +    def test_router_dns_guestipquery(self):
    +        """Checks that guest VM can query VR DNS"""
    +
    +        self.logger.debug("Starting test_router_dns_guestipquery...")
    +        public_ip = self.test_router_common()[0]
    +
    +        self.logger.debug("Creating Firewall rule for VM ID: %s" % self.vm1.id)
    +        FireWallRule.create(
    +            self.apiclient,
    +            ipaddressid=public_ip.id,
    +            protocol=self.services["natrule1"]["protocol"],
    +            cidrlist=['0.0.0.0/0'],
    +            startport=self.services["natrule1"]["publicport"],
    +            endport=self.services["natrule1"]["publicport"]
    +        )
    +
    +        self.logger.debug("Creating NAT rule for VM ID: %s" % self.vm1.id)
    +        nat_rule1 = NATRule.create(
    +            self.apiclient,
    +            self.vm1,
    +            self.services["natrule1"],
    +            public_ip.id
    +        )
    +        nat_rules = list_nat_rules(
    +            self.apiclient,
    +            id=nat_rule1.id
    +        )
    --- End diff --
    
    This is followed by a set of assertions to ensure that valid nat rules are there.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    Packaging result: \u2714centos6 \u2714centos7 \u2714debian. JID-551


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90411487
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    +        cls.vm2 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm2.password = "password"
    +        cls.logger.debug("Created VM named dilton");
    +
    +        cls.services["natrule1"] = {
    +            "privateport": 22,
    +            "publicport": 22,
    +            "protocol": "TCP"
    +        }
    +
    +        cls.services["configurableData"] = {
    +            "host": {
    +                "password": "password",
    +                "username": "root",
    +                "port": 22
    +            },
    +            "input": "INPUT",
    +            "forward": "FORWARD"
    +        }
    +
    +        cls._cleanup = [
    +            cls.vm1,
    +            cls.vm2,
    +            cls.network,
    +            cls.network_offering,
    +            cls.service_offering,
    +            cls.account
    +        ]
    +
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.api_client, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def test_router_common(self):
    +        """Performs common router tests and returns router public_ips"""
    +
    +        routers = list_routers(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid
    +        )
    --- End diff --
    
    This is followed by a set of assertions to ensure that that there is a router with valid state.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90380041
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    +        cls.vm2 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm2.password = "password"
    +        cls.logger.debug("Created VM named dilton");
    +
    +        cls.services["natrule1"] = {
    +            "privateport": 22,
    +            "publicport": 22,
    +            "protocol": "TCP"
    +        }
    +
    +        cls.services["configurableData"] = {
    +            "host": {
    +                "password": "password",
    +                "username": "root",
    +                "port": 22
    +            },
    +            "input": "INPUT",
    +            "forward": "FORWARD"
    +        }
    +
    +        cls._cleanup = [
    +            cls.vm1,
    +            cls.vm2,
    +            cls.network,
    +            cls.network_offering,
    +            cls.service_offering,
    +            cls.account
    +        ]
    +
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.api_client, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def test_router_common(self):
    +        """Performs common router tests and returns router public_ips"""
    +
    +        routers = list_routers(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid
    +        )
    +
    +        self.assertEqual(
    +            isinstance(routers, list),
    +            True,
    +            "Check for list routers response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(routers) >= 1,
    +            "Check list router response"
    +        )
    +
    +        router = routers[0]
    +
    +        self.assertEqual(
    +            router.state,
    +            'Running',
    +            "Check list router response for router state"
    +        )
    +
    +        public_ips = list_publicIP(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            zoneid=self.zone.id
    +        )
    +
    +        self.assertEqual(
    +            isinstance(public_ips, list),
    +            True,
    +            "Check for list public IPs response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(public_ips) >= 1,
    +            "Check public IP list has at least one IP"
    +        )
    +        return public_ips
    +
    +
    +    @attr(tags=["advanced", "advancedns", "ssh"], required_hardware="true")
    +    def test_router_dns_guestipquery(self):
    +        """Checks that guest VM can query VR DNS"""
    +
    +        self.logger.debug("Starting test_router_dns_guestipquery...")
    +        public_ip = self.test_router_common()[0]
    +
    +        self.logger.debug("Creating Firewall rule for VM ID: %s" % self.vm1.id)
    +        FireWallRule.create(
    +            self.apiclient,
    +            ipaddressid=public_ip.id,
    +            protocol=self.services["natrule1"]["protocol"],
    +            cidrlist=['0.0.0.0/0'],
    +            startport=self.services["natrule1"]["publicport"],
    +            endport=self.services["natrule1"]["publicport"]
    +        )
    +
    +        self.logger.debug("Creating NAT rule for VM ID: %s" % self.vm1.id)
    +        nat_rule1 = NATRule.create(
    +            self.apiclient,
    +            self.vm1,
    +            self.services["natrule1"],
    +            public_ip.id
    +        )
    +        nat_rules = list_nat_rules(
    +            self.apiclient,
    +            id=nat_rule1.id
    +        )
    +        self.assertEqual(
    +            isinstance(nat_rules, list),
    +            True,
    +            "Check for list NAT rules response return valid data"
    +        )
    +        self.assertTrue(
    +            len(nat_rules) >= 1,
    +            "Check for list NAT rules to have at least one rule"
    +        )
    +        self.assertEqual(
    +            nat_rules[0].state,
    +            'Active',
    +            "Check list port forwarding rules"
    +        )
    +
    +        result = None
    +        try:
    +            self.logger.debug("SSH into guest VM with IP: %s" % nat_rule1.ipaddress)
    +            ssh = self.vm1.get_ssh_client(ipaddress=nat_rule1.ipaddress, port=self.services['natrule1']["publicport"], retries=8)
    +            result = str(ssh.execute("ping drump"))
    +            self.logger.debug("pinging drump: %s " % result)
    +            result = str(ssh.execute("ping dilton"))
    --- End diff --
    
    Please consider creating a common function to ping a host from another VM.  We seem to do it a lot, and a common function would be both more expressive and reduce duplication.


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90380262
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    +        cls.vm2 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm2.password = "password"
    +        cls.logger.debug("Created VM named dilton");
    +
    +        cls.services["natrule1"] = {
    +            "privateport": 22,
    +            "publicport": 22,
    +            "protocol": "TCP"
    +        }
    +
    +        cls.services["configurableData"] = {
    +            "host": {
    +                "password": "password",
    +                "username": "root",
    +                "port": 22
    +            },
    +            "input": "INPUT",
    +            "forward": "FORWARD"
    +        }
    +
    +        cls._cleanup = [
    +            cls.vm1,
    +            cls.vm2,
    +            cls.network,
    +            cls.network_offering,
    +            cls.service_offering,
    +            cls.account
    +        ]
    +
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.api_client, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def test_router_common(self):
    +        """Performs common router tests and returns router public_ips"""
    +
    +        routers = list_routers(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid
    +        )
    --- End diff --
    
    Please add an assertion that `routers` is not `None`.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

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

    https://github.com/apache/cloudstack/pull/1784
  
    Test looks good to me, @abhinandanprateek should we target/include this in 4.9 as well?


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke 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.
---

[GitHub] cloudstack issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by abhinandanprateek <gi...@git.apache.org>.
Github user abhinandanprateek commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @rhtyd this can be merged if Murali feels multi nic test is also good to have we can add it later. cc @murali-reddy but lets not delay this as this test is complete in itself.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    Packaging result: \u2714centos6 \u2714centos7 \u2714debian. JID-265


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90380926
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    +        cls.vm2 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm2.password = "password"
    +        cls.logger.debug("Created VM named dilton");
    +
    +        cls.services["natrule1"] = {
    +            "privateport": 22,
    +            "publicport": 22,
    +            "protocol": "TCP"
    +        }
    +
    +        cls.services["configurableData"] = {
    +            "host": {
    +                "password": "password",
    +                "username": "root",
    +                "port": 22
    +            },
    +            "input": "INPUT",
    +            "forward": "FORWARD"
    +        }
    +
    +        cls._cleanup = [
    +            cls.vm1,
    +            cls.vm2,
    +            cls.network,
    +            cls.network_offering,
    +            cls.service_offering,
    +            cls.account
    +        ]
    +
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.api_client, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def test_router_common(self):
    +        """Performs common router tests and returns router public_ips"""
    +
    +        routers = list_routers(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid
    +        )
    +
    +        self.assertEqual(
    +            isinstance(routers, list),
    +            True,
    +            "Check for list routers response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(routers) >= 1,
    +            "Check list router response"
    +        )
    +
    +        router = routers[0]
    +
    +        self.assertEqual(
    +            router.state,
    +            'Running',
    +            "Check list router response for router state"
    +        )
    +
    +        public_ips = list_publicIP(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            zoneid=self.zone.id
    +        )
    +
    +        self.assertEqual(
    +            isinstance(public_ips, list),
    +            True,
    +            "Check for list public IPs response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(public_ips) >= 1,
    +            "Check public IP list has at least one IP"
    +        )
    +        return public_ips
    +
    +
    +    @attr(tags=["advanced", "advancedns", "ssh"], required_hardware="true")
    +    def test_router_dns_guestipquery(self):
    +        """Checks that guest VM can query VR DNS"""
    +
    +        self.logger.debug("Starting test_router_dns_guestipquery...")
    +        public_ip = self.test_router_common()[0]
    +
    +        self.logger.debug("Creating Firewall rule for VM ID: %s" % self.vm1.id)
    +        FireWallRule.create(
    +            self.apiclient,
    +            ipaddressid=public_ip.id,
    +            protocol=self.services["natrule1"]["protocol"],
    +            cidrlist=['0.0.0.0/0'],
    +            startport=self.services["natrule1"]["publicport"],
    +            endport=self.services["natrule1"]["publicport"]
    +        )
    +
    +        self.logger.debug("Creating NAT rule for VM ID: %s" % self.vm1.id)
    +        nat_rule1 = NATRule.create(
    +            self.apiclient,
    +            self.vm1,
    +            self.services["natrule1"],
    +            public_ip.id
    +        )
    +        nat_rules = list_nat_rules(
    +            self.apiclient,
    +            id=nat_rule1.id
    +        )
    +        self.assertEqual(
    +            isinstance(nat_rules, list),
    +            True,
    +            "Check for list NAT rules response return valid data"
    +        )
    +        self.assertTrue(
    +            len(nat_rules) >= 1,
    +            "Check for list NAT rules to have at least one rule"
    +        )
    +        self.assertEqual(
    +            nat_rules[0].state,
    +            'Active',
    +            "Check list port forwarding rules"
    +        )
    +
    +        result = None
    +        try:
    +            self.logger.debug("SSH into guest VM with IP: %s" % nat_rule1.ipaddress)
    +            ssh = self.vm1.get_ssh_client(ipaddress=nat_rule1.ipaddress, port=self.services['natrule1']["publicport"], retries=8)
    +            result = str(ssh.execute("ping drump"))
    +            self.logger.debug("pinging drump: %s " % result)
    +            result = str(ssh.execute("ping dilton"))
    +            self.logger.debug("pinging dilton: %s " % result)
    +        except Exception as e:
    +            self.fail("Failed to SSH into VM - %s due to exception: %s" % (nat_rule1.ipaddress, e))
    +
    +        if not result:
    +            self.fail("Did not to receive any response from the guest VM, failing.")
    +
    +        self.assertTrue("dilton" in result and "#53" in result,
    --- End diff --
    
    Where is the check of the result `ping drump` command?


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90380579
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    +        cls.vm2 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm2.password = "password"
    +        cls.logger.debug("Created VM named dilton");
    +
    +        cls.services["natrule1"] = {
    +            "privateport": 22,
    +            "publicport": 22,
    +            "protocol": "TCP"
    +        }
    +
    +        cls.services["configurableData"] = {
    +            "host": {
    +                "password": "password",
    +                "username": "root",
    +                "port": 22
    +            },
    +            "input": "INPUT",
    +            "forward": "FORWARD"
    +        }
    +
    +        cls._cleanup = [
    +            cls.vm1,
    +            cls.vm2,
    +            cls.network,
    +            cls.network_offering,
    +            cls.service_offering,
    +            cls.account
    +        ]
    +
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.api_client, cls._cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            cleanup_resources(self.apiclient, self.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def test_router_common(self):
    +        """Performs common router tests and returns router public_ips"""
    +
    +        routers = list_routers(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid
    +        )
    +
    +        self.assertEqual(
    +            isinstance(routers, list),
    +            True,
    +            "Check for list routers response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(routers) >= 1,
    +            "Check list router response"
    +        )
    +
    +        router = routers[0]
    +
    +        self.assertEqual(
    +            router.state,
    +            'Running',
    +            "Check list router response for router state"
    +        )
    +
    +        public_ips = list_publicIP(
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            zoneid=self.zone.id
    +        )
    +
    +        self.assertEqual(
    +            isinstance(public_ips, list),
    +            True,
    +            "Check for list public IPs response return valid data"
    +        )
    +
    +        self.assertTrue(
    +            len(public_ips) >= 1,
    +            "Check public IP list has at least one IP"
    +        )
    +        return public_ips
    +
    +
    +    @attr(tags=["advanced", "advancedns", "ssh"], required_hardware="true")
    +    def test_router_dns_guestipquery(self):
    +        """Checks that guest VM can query VR DNS"""
    +
    +        self.logger.debug("Starting test_router_dns_guestipquery...")
    +        public_ip = self.test_router_common()[0]
    +
    +        self.logger.debug("Creating Firewall rule for VM ID: %s" % self.vm1.id)
    +        FireWallRule.create(
    +            self.apiclient,
    +            ipaddressid=public_ip.id,
    +            protocol=self.services["natrule1"]["protocol"],
    +            cidrlist=['0.0.0.0/0'],
    +            startport=self.services["natrule1"]["publicport"],
    +            endport=self.services["natrule1"]["publicport"]
    +        )
    +
    +        self.logger.debug("Creating NAT rule for VM ID: %s" % self.vm1.id)
    +        nat_rule1 = NATRule.create(
    +            self.apiclient,
    +            self.vm1,
    +            self.services["natrule1"],
    +            public_ip.id
    +        )
    +        nat_rules = list_nat_rules(
    +            self.apiclient,
    +            id=nat_rule1.id
    +        )
    --- End diff --
    
    Please add an assertion that `nat_rules` is not `None`.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

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

    https://github.com/apache/cloudstack/pull/1784
  
    @blueorangutan package


---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90380293
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    --- End diff --
    
    Please consider extracting these hostnames to constants as the names are used throughout the test case.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by jburwell <gi...@git.apache.org>.
Github user jburwell commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @murali-reddy is internal DNS service impacted by having multiple NICs?


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by abhinandanprateek <gi...@git.apache.org>.
Github user abhinandanprateek commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @jburwell made the appropriate changes.
    @murali-reddy impact of multiple NIC on DNS .... do you think we add a test for that too ?


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

Posted by abhinandanprateek <gi...@git.apache.org>.
Github user abhinandanprateek commented on the issue:

    https://github.com/apache/cloudstack/pull/1784
  
    @rhtyd the test_router_dns checks external dns service on virtual router. This test case checks the internal dns service from the user VMs.



---
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 #1784: CS-505: Marvin test to check VR internal DNS ...

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

    https://github.com/apache/cloudstack/pull/1784#discussion_r90380120
  
    --- Diff: test/integration/smoke/test_router_dnsservice.py ---
    @@ -0,0 +1,268 @@
    +# 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.
    +
    +import logging
    +import dns.resolver
    +
    +from nose.plugins.attrib import attr
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.utils import cleanup_resources
    +from marvin.lib.base import (ServiceOffering,
    +                             VirtualMachine,
    +                             Account,
    +                             NATRule,
    +                             FireWallRule,
    +                             NetworkOffering,
    +                             Network)
    +from marvin.lib.common import (get_zone,
    +                               get_template,
    +                               get_domain,
    +                               list_routers,
    +                               list_nat_rules,
    +                               list_publicIP)
    +
    +
    +class TestRouterDnsService(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        cls.logger = logging.getLogger('TestRouterDnsService')
    +        cls.stream_handler = logging.StreamHandler()
    +        cls.logger.setLevel(logging.DEBUG)
    +        cls.logger.addHandler(cls.stream_handler)
    +
    +        cls.testClient = super(TestRouterDnsService, cls).getClsTestClient()
    +        cls.api_client = cls.testClient.getApiClient()
    +        cls.services = cls.testClient.getParsedTestDataConfig()
    +
    +        cls.domain = get_domain(cls.api_client)
    +        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +        cls.template = get_template(
    +            cls.api_client,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
    +
    +        cls.logger.debug("Creating Admin Account for domain %s on zone %s" % (cls.domain.id, cls.zone.id))
    +        cls.account = Account.create(
    +            cls.api_client,
    +            cls.services["account"],
    +            admin=True,
    +            domainid=cls.domain.id
    +        )
    +
    +        cls.logger.debug("Creating Service Offering on zone %s" % (cls.zone.id))
    +        cls.service_offering = ServiceOffering.create(
    +            cls.api_client,
    +            cls.services["service_offering"]
    +        )
    +
    +        cls.logger.debug("Creating Network Offering on zone %s" % (cls.zone.id))
    +        cls.services["isolated_network_offering"]["egress_policy"] = "true"
    +        cls.network_offering = NetworkOffering.create(cls.api_client,
    +                                                       cls.services["isolated_network_offering"],
    +                                                       conservemode=True)
    +        cls.network_offering.update(cls.api_client, state='Enabled')
    +
    +        cls.logger.debug("Creating Network for Account %s using offering %s" % (cls.account.name, cls.network_offering.id))
    +        cls.network = Network.create(cls.api_client,
    +                                      cls.services["network"],
    +                                      accountid=cls.account.name,
    +                                      domainid=cls.account.domainid,
    +                                      networkofferingid=cls.network_offering.id,
    +                                      zoneid=cls.zone.id)
    +
    +        cls.logger.debug("Creating guest VM for Account %s using offering %s" % (cls.account.name, cls.service_offering.id))
    +        cls.services["virtual_machine"]["displayname"] = 'drump';
    +        cls.services["virtual_machine"]["name"] = 'drump';
    +        cls.vm1 = VirtualMachine.create(cls.api_client,
    +                                         cls.services["virtual_machine"],
    +                                         templateid=cls.template.id,
    +                                         accountid=cls.account.name,
    +                                         domainid=cls.domain.id,
    +                                         serviceofferingid=cls.service_offering.id,
    +                                         networkids=[str(cls.network.id)])
    +        cls.vm1.password = "password"
    +        cls.logger.debug("Created VM named drump");
    +                
    +        cls.services["virtual_machine"]["displayname"] = 'dilton';
    +        cls.services["virtual_machine"]["name"] = 'dilton';
    --- End diff --
    
    Please consider extracting these hostnames to constants as the names are used throughout the test case.


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

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

    https://github.com/apache/cloudstack/pull/1784
  
    @blueorangutan package


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

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

    https://github.com/apache/cloudstack/pull/1784
  
    @abhinandanprateek can you check if `test_router_dns.py` is similar to your test, you may also move your test case in that test file? 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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

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

    https://github.com/apache/cloudstack/pull/1784
  
    @abhinandanprateek @murali-reddy please let me know any help needed?


---
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 issue #1784: CS-505: Marvin test to check VR internal DNS Service

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

    https://github.com/apache/cloudstack/pull/1784
  
    @blueorangutan test centos7 vmware-55u3


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