Skip to content

Commit 79d702c

Browse files
Gaurav AradhyePrasanna Santhanam
authored andcommitted
CLOUDSTACK-4780: Fixed BVT test case TestSnapshotRootDisk.test_01_snapshot_root_disk
Signed-off-by: Prasanna Santhanam <tsp@apache.org> (cherry picked from commit b12ff1d6ce964e30d0b919c29ab92af450e4dcf9)
1 parent 0dabc6a commit 79d702c

1 file changed

Lines changed: 2 additions & 74 deletions

File tree

‎test/integration/smoke/test_snapshots.py‎

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -269,77 +269,5 @@ def test_01_snapshot_root_disk(self):
269269
"Check if backup_snap_id is not null"
270270
)
271271

272-
# Get the Secondary Storage details from list Hosts
273-
hosts = list_hosts(
274-
self.apiclient,
275-
type='SecondaryStorage',
276-
zoneid=self.zone.id
277-
)
278-
self.assertEqual(
279-
isinstance(hosts, list),
280-
True,
281-
"Check list response returns a valid list"
282-
)
283-
uuids = []
284-
for host in hosts:
285-
# hosts[0].name = "nfs://192.168.100.21/export/test"
286-
parse_url = (host.name).split('/')
287-
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
288-
289-
# Split IP address and export path from name
290-
sec_storage_ip = parse_url[2]
291-
# Sec Storage IP: 192.168.100.21
292-
293-
export_path = '/'.join(parse_url[3:])
294-
# Export path: export/test
295-
296-
try:
297-
# Login to VM to check snapshot present on sec disk
298-
ssh_client = self.virtual_machine_with_disk.get_ssh_client()
299-
300-
cmds = [
301-
"mkdir -p %s" % self.services["paths"]["mount_dir"],
302-
"mount %s/%s %s" % (
303-
sec_storage_ip,
304-
export_path,
305-
self.services["paths"]["mount_dir"]
306-
),
307-
"ls %s/snapshots/%s/%s" % (
308-
self.services["paths"]["mount_dir"],
309-
account_id,
310-
volume_id
311-
),
312-
]
313-
314-
for c in cmds:
315-
self.debug(c)
316-
result = ssh_client.execute(c)
317-
self.debug(result)
318-
319-
except Exception:
320-
self.fail("SSH failed for Virtual machine: %s" %
321-
self.virtual_machine_with_disk.ipaddress)
322-
323-
uuids.append(result)
324-
# Unmount the Sec Storage
325-
cmds = [
326-
"umount %s" % (self.services["mount_dir"]),
327-
]
328-
try:
329-
for c in cmds:
330-
self.debug(c)
331-
result = ssh_client.execute(c)
332-
self.debug(result)
333-
334-
except Exception as e:
335-
self.fail("SSH failed for Virtual machine: %s" %
336-
self.virtual_machine_with_disk.ipaddress)
337-
338-
res = str(uuids)
339-
# Check snapshot UUID in secondary storage and database
340-
self.assertEqual(
341-
res.count(snapshot_uuid),
342-
1,
343-
"Check snapshot UUID in secondary storage and database"
344-
)
345-
return
272+
self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, snapshot.id))
273+
return

0 commit comments

Comments
 (0)