Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C21F117DA1 for ; Wed, 26 Aug 2015 12:03:10 +0000 (UTC) Received: (qmail 28490 invoked by uid 500); 26 Aug 2015 12:03:10 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 28435 invoked by uid 500); 26 Aug 2015 12:03:10 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 28411 invoked by uid 99); 26 Aug 2015 12:03:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2015 12:03:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 06DD9DFE80; Wed, 26 Aug 2015 12:03:10 +0000 (UTC) From: sanju1010 To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-8728: Testcase to Verify if VR... Content-Type: text/plain Message-Id: <20150826120310.06DD9DFE80@git1-us-west.apache.org> Date: Wed, 26 Aug 2015 12:03:10 +0000 (UTC) Github user sanju1010 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/684#discussion_r37973579 --- Diff: test/integration/smoke/test_routers.py --- @@ -796,3 +830,122 @@ def test_09_reboot_router(self): "Router response after reboot is either is invalid\ or in stopped state") return + + def check_virtual_machine_accessibility(self, virtual_machine): + response = virtual_machine.getState( + self.userapiclient, + VirtualMachine.RUNNING + ) + self.assertEqual(response[0], PASS, "Virtual machine is not running") + + # Check VM Accessibility + try: + SshClient(host=virtual_machine.ssh_ip, + port=self.services['natrule']['publicport'], + user=virtual_machine.username, + passwd=virtual_machine.password) + except Exception as e: + raise Exception("Error while trying SSH to VM: %s" % e) + + def try_ssh_to_host(self): + list_virtual_machine_response = list_virtual_machines( + self.apiclient, + listall=True) + status = validateList(list_virtual_machine_response) + self.assertEqual( + status[0], + PASS, + "VM List Validation Failed due to %s" % + status[2]) + + host_id = list_virtual_machine_response[0].hostid + list_host_response = list_hosts(self.apiclient, id=host_id) + status = validateList(list_host_response) + self.assertEqual( + status[0], + PASS, + "Host List Validation Failed due to %s" % + status[2]) + + self.services['hosts'][self.hypervisor.lower()]['password'] = "xenroot" + ssh_object = SshClient( + host=list_host_response[0].ipaddress, + port=self.services['natrule']['publicport'], + user=self.services['hosts'][self.hypervisor.lower()]['username'], + passwd=self.services['hosts'][self.hypervisor.lower()]['password'] + ) + hostname_from_host = ssh_object.execute("uname -n") + ssh_object.execute("ssh-keygen -R %s" % hostname_from_host[0]) + ssh_object.execute("exit") + return ssh_object --- End diff -- What is the guarantee that RouterVM and Guest vm will be on the same host? We have to the host id of the VR and get the ssh object for that host. --- 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. ---