mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixed mount command and logging in snapshot tests
This commit is contained in:
parent
6e7b513810
commit
cdbffdb334
@ -64,9 +64,9 @@ class Services:
|
|||||||
"protocol": 'TCP',
|
"protocol": 'TCP',
|
||||||
},
|
},
|
||||||
"mgmt_server": {
|
"mgmt_server": {
|
||||||
"ipaddress": '10.223.133.41',
|
"ipaddress": '192.168.100.21',
|
||||||
"username": "root",
|
"username": "root",
|
||||||
"password": "password",
|
"password": "fr3sca",
|
||||||
"port": 22,
|
"port": 22,
|
||||||
},
|
},
|
||||||
"recurring_snapshot": {
|
"recurring_snapshot": {
|
||||||
@ -80,7 +80,7 @@ class Services:
|
|||||||
"templates": {
|
"templates": {
|
||||||
"displaytext": 'Template',
|
"displaytext": 'Template',
|
||||||
"name": 'Template',
|
"name": 'Template',
|
||||||
"ostypeid": 'd847814b-e1fb-4310-afd5-ed64c1d13e6c',
|
"ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea',
|
||||||
"templatefilter": 'self',
|
"templatefilter": 'self',
|
||||||
},
|
},
|
||||||
"diskdevice": "/dev/xvda",
|
"diskdevice": "/dev/xvda",
|
||||||
@ -93,7 +93,7 @@ class Services:
|
|||||||
"sub_lvl_dir2": "test2",
|
"sub_lvl_dir2": "test2",
|
||||||
"random_data": "random.data",
|
"random_data": "random.data",
|
||||||
|
|
||||||
"ostypeid": 'd847814b-e1fb-4310-afd5-ed64c1d13e6c',
|
"ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea',
|
||||||
# Cent OS 5.3 (64 bit)
|
# Cent OS 5.3 (64 bit)
|
||||||
"sleep": 60,
|
"sleep": 60,
|
||||||
"timeout": 10,
|
"timeout": 10,
|
||||||
@ -327,9 +327,13 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
@ -347,7 +351,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount -t nfs %s:/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -364,8 +369,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
self.debug("Result: %s" % result)
|
self.debug("Result: %s" % result)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for Management server: %s" %
|
self.fail("SSH failed for Management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
uuids.append(result)
|
uuids.append(result)
|
||||||
# Unmount the Sec Storage
|
# Unmount the Sec Storage
|
||||||
cmds = [
|
cmds = [
|
||||||
@ -378,8 +383,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||||||
self.debug("Result: %s" % result)
|
self.debug("Result: %s" % result)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for Management server: %s" %
|
self.fail("SSH failed for Management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -586,10 +591,15 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
|
|
||||||
@ -606,7 +616,8 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount -t nfs %s:/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -631,9 +642,9 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
]
|
]
|
||||||
for c in cmds:
|
for c in cmds:
|
||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -677,16 +688,22 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmds = [
|
cmds = [
|
||||||
"mount -t %s:/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -713,9 +730,9 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
self.debug("Result: %s" % result)
|
self.debug("Result: %s" % result)
|
||||||
|
|
||||||
except Exception:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertNotEqual(
|
self.assertNotEqual(
|
||||||
@ -907,8 +924,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
"Check snapshot id in list resources call"
|
"Check snapshot id in list resources call"
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for VM with IP: %s" %
|
self.fail("SSH failed for VM with IP: %s - %s" %
|
||||||
self.virtual_machine.ipaddress)
|
(self.virtual_machine.ipaddress, e))
|
||||||
|
|
||||||
# Fetch values from database
|
# Fetch values from database
|
||||||
qresultset = self.dbclient.execute(
|
qresultset = self.dbclient.execute(
|
||||||
@ -949,10 +966,16 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
|
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
|
|
||||||
@ -970,7 +993,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount -t nfs %s:/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -993,8 +1017,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||||||
for c in cmds:
|
for c in cmds:
|
||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -1202,10 +1226,15 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
parse_url = (host.name).split('/')
|
parse_url = (host.name).split('/')
|
||||||
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
# parse_url = ['nfs:', '', '192.168.100.21', 'export', 'test']
|
||||||
|
|
||||||
|
# Stripping end ':' from storage type
|
||||||
|
storage_type = parse_url[0][:-1]
|
||||||
# Split IP address and export path from name
|
# Split IP address and export path from name
|
||||||
sec_storage_ip = parse_url[2]
|
sec_storage_ip = parse_url[2]
|
||||||
# Sec Storage IP: 192.168.100.21
|
# Sec Storage IP: 192.168.100.21
|
||||||
|
|
||||||
|
if sec_storage_ip[-1] != ":":
|
||||||
|
sec_storage_ip = sec_storage_ip + ":"
|
||||||
|
|
||||||
export_path = '/'.join(parse_url[3:])
|
export_path = '/'.join(parse_url[3:])
|
||||||
# Export path: export/test
|
# Export path: export/test
|
||||||
try:
|
try:
|
||||||
@ -1219,7 +1248,8 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"mkdir -p %s" % self.services["mount_dir"],
|
"mkdir -p %s" % self.services["mount_dir"],
|
||||||
"mount -t %s:/%s %s" % (
|
"mount -t %s %s/%s %s" % (
|
||||||
|
storage_type,
|
||||||
sec_storage_ip,
|
sec_storage_ip,
|
||||||
export_path,
|
export_path,
|
||||||
self.services["mount_dir"]
|
self.services["mount_dir"]
|
||||||
@ -1244,8 +1274,8 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
result = ssh_client.execute(c)
|
result = ssh_client.execute(c)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"SSH access failed for management server: %s" %
|
"SSH access failed for management server: %s - %s" %
|
||||||
self.services["mgmt_server"]["ipaddress"])
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
|
|
||||||
res = str(uuids)
|
res = str(uuids)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user