CLOUDSTACK-4780: Fixed BVT test case TestSnapshotRootDisk.test_01_snapshot_root_disk
Signed-off-by: Prasanna Santhanam <t...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/986ac0f1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/986ac0f1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/986ac0f1 Branch: refs/heads/ui-restyle Commit: 986ac0f124ab2960e13455736dfd467350e7f9e1 Parents: 0a8bce5 Author: Gaurav Aradhye <gaurav.arad...@clogeny.com> Authored: Mon Oct 14 20:56:16 2013 -0400 Committer: Prasanna Santhanam <t...@apache.org> Committed: Tue Oct 15 13:37:11 2013 +0530 ---------------------------------------------------------------------- test/integration/smoke/test_snapshots.py | 76 +-------------------------- 1 file changed, 2 insertions(+), 74 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/986ac0f1/test/integration/smoke/test_snapshots.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 06777e4..6ee7c62 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -269,77 +269,5 @@ class TestSnapshotRootDisk(cloudstackTestCase): "Check if backup_snap_id is not null" ) - # Get the Secondary Storage details from list Hosts - hosts = list_hosts( - self.apiclient, - type='SecondaryStorage', - zoneid=self.zone.id - ) - self.assertEqual( - isinstance(hosts, list), - True, - "Check list response returns a valid list" - ) - uuids = [] - for host in hosts: - # hosts[0].name = "nfs://192.168.100.21/export/test" - parse_url = (host.name).split('/') - # parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test'] - - # Split IP address and export path from name - sec_storage_ip = parse_url[2] - # Sec Storage IP: 192.168.100.21 - - export_path = '/'.join(parse_url[3:]) - # Export path: export/test - - try: - # Login to VM to check snapshot present on sec disk - ssh_client = self.virtual_machine_with_disk.get_ssh_client() - - cmds = [ - "mkdir -p %s" % self.services["paths"]["mount_dir"], - "mount %s/%s %s" % ( - sec_storage_ip, - export_path, - self.services["paths"]["mount_dir"] - ), - "ls %s/snapshots/%s/%s" % ( - self.services["paths"]["mount_dir"], - account_id, - volume_id - ), - ] - - for c in cmds: - self.debug(c) - result = ssh_client.execute(c) - self.debug(result) - - except Exception: - self.fail("SSH failed for Virtual machine: %s" % - self.virtual_machine_with_disk.ipaddress) - - uuids.append(result) - # Unmount the Sec Storage - cmds = [ - "umount %s" % (self.services["mount_dir"]), - ] - try: - for c in cmds: - self.debug(c) - result = ssh_client.execute(c) - self.debug(result) - - except Exception as e: - self.fail("SSH failed for Virtual machine: %s" % - self.virtual_machine_with_disk.ipaddress) - - res = str(uuids) - # Check snapshot UUID in secondary storage and database - self.assertEqual( - res.count(snapshot_uuid), - 1, - "Check snapshot UUID in secondary storage and database" - ) - return \ No newline at end of file + self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, snapshot.id)) + return