mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4225: Fix template references in setUpClass
Signed-off-by: Prasanna Santhanam <tsp@apache.org> (cherry picked from commit 7768613edc4f9ae0787e555f2bf4bd2fb42a4c6e)
This commit is contained in:
parent
12380835b5
commit
f13a6a0deb
@ -264,6 +264,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
self.services["paths"]["mount_dir"]
|
self.services["paths"]["mount_dir"]
|
||||||
),
|
),
|
||||||
"cd %s" % self.services["paths"]["mount_dir"],
|
"cd %s" % self.services["paths"]["mount_dir"],
|
||||||
|
"ls -Rt",
|
||||||
"ls %s" % (
|
"ls %s" % (
|
||||||
snapshotPath
|
snapshotPath
|
||||||
),
|
),
|
||||||
@ -285,8 +286,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s - %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
(self.config.mgtSvr[0].mgtSvrIp, e))
|
(self.config.mgtSvr[0].mgtSvrIp, e))
|
||||||
res = str(snapshots)
|
return snapshots.count(snapshot_id) == 1
|
||||||
return res.count(snapshot_id) == 1
|
|
||||||
|
|
||||||
@attr(speed = "slow")
|
@attr(speed = "slow")
|
||||||
@attr(tags = ["advanced", "advancedns", "basic", "sg"])
|
@attr(tags = ["advanced", "advancedns", "basic", "sg"])
|
||||||
|
|||||||
@ -252,6 +252,7 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
self.services["paths"]["mount_dir"]
|
self.services["paths"]["mount_dir"]
|
||||||
),
|
),
|
||||||
"cd %s" % self.services["paths"]["mount_dir"],
|
"cd %s" % self.services["paths"]["mount_dir"],
|
||||||
|
"ls -Rt",
|
||||||
"ls %s" % (
|
"ls %s" % (
|
||||||
snapshotPath
|
snapshotPath
|
||||||
),
|
),
|
||||||
@ -273,8 +274,7 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s - %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
(self.config.mgtSvr[0].mgtSvrIp, e))
|
(self.config.mgtSvr[0].mgtSvrIp, e))
|
||||||
res = str(snapshots)
|
return snapshots.count(snapshot_id) == 1
|
||||||
return res.count(snapshot_id) == 1
|
|
||||||
|
|
||||||
@attr(speed = "slow")
|
@attr(speed = "slow")
|
||||||
@attr(tags = ["advanced", "advancedns"])
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
|
|||||||
@ -134,7 +134,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
cls.api_client,
|
cls.api_client,
|
||||||
cls.services["disk_offering"]
|
cls.services["disk_offering"]
|
||||||
)
|
)
|
||||||
template = get_template(
|
cls.template = get_template(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
cls.zone.id,
|
cls.zone.id,
|
||||||
cls.services["ostype"]
|
cls.services["ostype"]
|
||||||
@ -146,7 +146,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
|
|
||||||
cls.services["server_without_disk"]["zoneid"] = cls.zone.id
|
cls.services["server_without_disk"]["zoneid"] = cls.zone.id
|
||||||
|
|
||||||
cls.services["templates"]["ostypeid"] = template.ostypeid
|
cls.services["templates"]["ostypeid"] = cls.template.ostypeid
|
||||||
cls.services["zoneid"] = cls.zone.id
|
cls.services["zoneid"] = cls.zone.id
|
||||||
cls.services["diskoffering"] = cls.disk_offering.id
|
cls.services["diskoffering"] = cls.disk_offering.id
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
VirtualMachine.create(
|
VirtualMachine.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
cls.services["server_with_disk"],
|
cls.services["server_with_disk"],
|
||||||
templateid=template.id,
|
templateid=cls.template.id,
|
||||||
accountid=cls.account.name,
|
accountid=cls.account.name,
|
||||||
domainid=cls.account.domainid,
|
domainid=cls.account.domainid,
|
||||||
serviceofferingid=cls.service_offering.id,
|
serviceofferingid=cls.service_offering.id,
|
||||||
@ -177,7 +177,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
VirtualMachine.create(
|
VirtualMachine.create(
|
||||||
cls.api_client,
|
cls.api_client,
|
||||||
cls.services["server_without_disk"],
|
cls.services["server_without_disk"],
|
||||||
templateid=template.id,
|
templateid=cls.template.id,
|
||||||
accountid=cls.account.name,
|
accountid=cls.account.name,
|
||||||
domainid=cls.account.domainid,
|
domainid=cls.account.domainid,
|
||||||
serviceofferingid=cls.service_offering.id,
|
serviceofferingid=cls.service_offering.id,
|
||||||
@ -244,6 +244,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
self.services["paths"]["mount_dir"]
|
self.services["paths"]["mount_dir"]
|
||||||
),
|
),
|
||||||
"cd %s" % self.services["paths"]["mount_dir"],
|
"cd %s" % self.services["paths"]["mount_dir"],
|
||||||
|
"ls -Rt",
|
||||||
"ls %s" % (
|
"ls %s" % (
|
||||||
snapshotPath
|
snapshotPath
|
||||||
),
|
),
|
||||||
@ -265,8 +266,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s - %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
(self.config.mgtSvr[0].mgtSvrIp, e))
|
(self.config.mgtSvr[0].mgtSvrIp, e))
|
||||||
res = str(snapshots)
|
return snapshots.count(snapshot_id) == 1
|
||||||
return res.count(snapshot_id) == 1
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
@ -667,7 +667,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
self.services["volume"]["diskdevice"],
|
self.services["volume"]["diskdevice"],
|
||||||
self.services["paths"]["mount_dir"]
|
self.services["paths"]["mount_dir"]
|
||||||
),
|
),
|
||||||
"pushd %s" % self.services["mount_dir"],
|
"pushd %s" % self.services["paths"]["mount_dir"],
|
||||||
"mkdir -p %s/{%s,%s} " % (
|
"mkdir -p %s/{%s,%s} " % (
|
||||||
self.services["sub_dir"],
|
self.services["sub_dir"],
|
||||||
self.services["sub_lvl_dir1"],
|
self.services["sub_lvl_dir1"],
|
||||||
@ -924,7 +924,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||||||
)
|
)
|
||||||
# Unmount the volume
|
# Unmount the volume
|
||||||
cmds = [
|
cmds = [
|
||||||
"umount %s" % (self.services["mount_dir"]),
|
"umount %s" % (self.services["paths"]["mount_dir"]),
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
for c in cmds:
|
for c in cmds:
|
||||||
@ -1051,6 +1051,7 @@ class TestCreateVMSnapshotTemplate(cloudstackTestCase):
|
|||||||
self.services["paths"]["mount_dir"]
|
self.services["paths"]["mount_dir"]
|
||||||
),
|
),
|
||||||
"cd %s" % self.services["paths"]["mount_dir"],
|
"cd %s" % self.services["paths"]["mount_dir"],
|
||||||
|
"ls -Rt",
|
||||||
"ls %s" % (
|
"ls %s" % (
|
||||||
snapshotPath
|
snapshotPath
|
||||||
),
|
),
|
||||||
@ -1072,8 +1073,7 @@ class TestCreateVMSnapshotTemplate(cloudstackTestCase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail("SSH failed for management server: %s - %s" %
|
self.fail("SSH failed for management server: %s - %s" %
|
||||||
(self.services["mgmt_server"]["ipaddress"], e))
|
(self.services["mgmt_server"]["ipaddress"], e))
|
||||||
res = str(snapshots)
|
return snapshots.count(snapshot_id) == 1
|
||||||
return res.count(snapshot_id) == 1
|
|
||||||
|
|
||||||
@attr(speed = "slow")
|
@attr(speed = "slow")
|
||||||
@attr(tags = ["advanced", "advancedns"])
|
@attr(tags = ["advanced", "advancedns"])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user