Fixing incorrect ipaddress references test_network: references to ipaddress are ipaddress.ipaddress Added more logging to volume tests
Signed-off-by: Prasanna Santhanam <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b2be0dbf Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b2be0dbf Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b2be0dbf Branch: refs/heads/rbd-snap-clone Commit: b2be0dbf6b48aa1d7a7e9cc7b5ab92dac84516b0 Parents: 3b48299 Author: Prasanna Santhanam <[email protected]> Authored: Fri May 24 11:12:39 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Fri May 24 14:24:06 2013 +0530 ---------------------------------------------------------------------- test/integration/smoke/test_network.py | 34 ++++++++++++--------------- test/integration/smoke/test_volumes.py | 2 +- 2 files changed, 16 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2be0dbf/test/integration/smoke/test_network.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 61ddf46..9dfdc6e 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -971,12 +971,12 @@ class TestLoadBalancingRule(cloudstackTestCase): try: self.debug("SSHing into IP address: %s after adding VMs (ID: %s , %s)" % ( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.vm_1.id, self.vm_2.id )) ssh_1 = remoteSSHClient( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, self.vm_1.password @@ -990,12 +990,12 @@ class TestLoadBalancingRule(cloudstackTestCase): self.debug("SSHing again into IP address: %s with VMs (ID: %s , %s) added to LB rule" % ( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.vm_1.id, self.vm_2.id )) ssh_2 = remoteSSHClient( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, self.vm_1.password @@ -1019,11 +1019,11 @@ class TestLoadBalancingRule(cloudstackTestCase): self.debug("SSHing into IP address: %s after removing VM (ID: %s) from LB rule" % ( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.vm_2.id )) ssh_1 = remoteSSHClient( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, self.vm_1.password @@ -1033,7 +1033,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.debug("Hostnames after removing VM2: %s" % str(hostnames)) except Exception as e: self.fail("%s: SSH failed for VM with IP Address: %s" % - (e, self.non_src_nat_ip.ipaddress)) + (e, self.non_src_nat_ip.ipaddress.ipaddress)) self.assertIn( self.vm_1.name, @@ -1045,11 +1045,11 @@ class TestLoadBalancingRule(cloudstackTestCase): with self.assertRaises(Exception): self.fail("SSHing into IP address: %s after removing VM (ID: %s) from LB rule" % ( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.vm_1.id )) ssh_1 = remoteSSHClient( - self.non_src_nat_ip.ipaddress, + self.non_src_nat_ip.ipaddress.ipaddress, self.services['lbrule']["publicport"], self.vm_1.username, self.vm_1.password @@ -1203,7 +1203,7 @@ class TestRebootRouter(cloudstackTestCase): self.debug("SSH into VM (ID : %s ) after reboot" % self.vm_1.id) remoteSSHClient( - self.nat_rule.ipaddress, + self.nat_rule.ipaddress.ipaddress, self.services["natrule"]["publicport"], self.vm_1.username, self.vm_1.password @@ -1211,8 +1211,7 @@ class TestRebootRouter(cloudstackTestCase): except Exception as e: self.fail( "SSH Access failed for %s: %s" % \ - (self.vm_1.ipaddress, e) - ) + (self.vm_1.ipaddress, e)) return def tearDown(self): @@ -1579,7 +1578,6 @@ class TestReleaseIP(cloudstackTestCase): "Check if disassociated IP Address is no longer available" ) - self.debug("List NAT Rule response" + str(list_nat_rule)) # ListPortForwardingRules should not list # associated rules with Public IP address try: @@ -1587,18 +1585,18 @@ class TestReleaseIP(cloudstackTestCase): self.apiclient, id=self.nat_rule.id ) + self.debug("List NAT Rule response" + str(list_nat_rule)) except cloudstackAPIException: self.debug("Port Forwarding Rule is deleted") # listLoadBalancerRules should not list # associated rules with Public IP address - self.debug("List LB Rule response" + str(list_lb_rule)) try: list_lb_rule = list_lb_rules( self.apiclient, id=self.lb_rule.id ) - + self.debug("List LB Rule response" + str(list_lb_rule)) except cloudstackAPIException: self.debug("Port Forwarding Rule is deleted") @@ -1658,7 +1656,6 @@ class TestDeleteAccount(cloudstackTestCase): try: src_nat_ip_addr = src_nat_ip_addrs[0] - except Exception as e: self.fail("SSH failed for VM with IP: %s" % src_nat_ip_addr.ipaddress) @@ -1740,10 +1737,9 @@ class TestDeleteAccount(cloudstackTestCase): "Check routers are properly deleted." ) except Exception as e: - raise Exception( - "Exception raised while fetching routers for account: %s" % - self.account.name) + "Encountered %s raised while fetching routers for account: %s" % (e, + self.account.name)) return def tearDown(self): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2be0dbf/test/integration/smoke/test_volumes.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 89b013a..7987136 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -209,8 +209,8 @@ class TestCreateVolume(cloudstackTestCase): ) try: ssh = self.virtual_machine.get_ssh_client() + self.debug("Rebooting VM %s" % self.virtual_machine.id) ssh.execute("reboot") - except Exception as e: self.fail("SSH access failed for VM %s - %s" % (self.virtual_machine.ipaddress, e))
