You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/08/09 08:40:23 UTC
[1/3] git commit: updated refs/heads/master to 75cd6cc
Updated Branches:
refs/heads/master 2cc13918a -> 75cd6cce4
Fix volumes tests
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bad72a0a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bad72a0a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bad72a0a
Branch: refs/heads/master
Commit: bad72a0aebe75030dffb5edc452743992668ff83
Parents: 2cc1391
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Fri Aug 9 12:08:02 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Fri Aug 9 12:08:02 2013 +0530
----------------------------------------------------------------------
test/integration/component/test_volumes.py | 190 ++++++++++++------------
1 file changed, 92 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bad72a0a/test/integration/component/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py
index 14109dc..ee0f91d 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -111,22 +111,22 @@ class TestAttachVolume(cloudstackTestCase):
#get max data volumes limit based on the hypervisor type and version
listHost = Host.list(
cls.api_client,
- hypervisor = cls.services["virtual_machine"]["hypervisor"],
type ='Routing',
zoneid = cls.zone.id,
podid = cls.pod.id,
)
ver = listHost[0].hypervisorversion
+ hv = listHost[0].hypervisor
cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
- cmd.hypervisor = cls.services["virtual_machine"]["hypervisor"]
+ cmd.hypervisor = hv
res = cls.api_client.listHypervisorCapabilities(cmd)
cls.debug('Hypervisor Capabilities: {}'.format(res))
for i in range(len(res)):
if res[i].hypervisorversion == ver:
break
- max_data_volumes = int(res[i].maxdatavolumeslimit)
- cls.debug('max data volumes:{}'.format(max_data_volumes))
- cls.services["volume"]["max"] = max_data_volumes
+ cls.max_data_volumes = int(res[i].maxdatavolumeslimit)
+ cls.debug('max data volumes:{}'.format(cls.max_data_volumes))
+ cls.services["volume"]["max"] = cls.max_data_volumes
# Create VMs, NAT Rules etc
cls.account = Account.create(
cls.api_client,
@@ -173,7 +173,7 @@ class TestAttachVolume(cloudstackTestCase):
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
- @attr(tags = ["advanced", "advancedns"])
+ @attr(tags = ["advanced", "advancedns", "needle"])
def test_01_volume_attach(self):
"""Test Attach volumes (max capacity)
"""
@@ -185,7 +185,8 @@ class TestAttachVolume(cloudstackTestCase):
# 5. Start The VM. Start VM should be successful
# Create 5 volumes and attach to VM
- for i in range(self.services["volume"]["max"] - 1):
+ for i in range(self.max_data_volumes):
+ self.debug(i)
volume = Volume.create(
self.apiclient,
self.services["volume"],
@@ -224,22 +225,21 @@ class TestAttachVolume(cloudstackTestCase):
type='DATADISK',
listall=True
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
-
self.assertNotEqual(
- list_volume_response,
- None,
- "Check if volume exists in ListVolumes"
- )
+ list_volume_response,
+ None,
+ "Check if volume exists in ListVolumes"
+ )
self.assertEqual(
- len(list_volume_response),
- self.services["volume"]["max"],
- "Check number of data volumes attached to VM"
- )
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
+ self.assertEqual(
+ len(list_volume_response),
+ self.max_data_volumes,
+ "Volumes attached to the VM %s. Expected %s" % (len(list_volume_response), self.max_data_volumes)
+ )
self.debug("Rebooting the VM: %s" % self.virtual_machine.id)
# Reboot VM
self.virtual_machine.reboot(self.apiclient)
@@ -352,17 +352,16 @@ class TestAttachVolume(cloudstackTestCase):
self.apiclient,
id=volume.id
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
-
self.assertNotEqual(
- list_volume_response,
- None,
- "Check if volume exists in ListVolumes"
- )
+ list_volume_response,
+ None,
+ "Check if volume exists in ListVolumes"
+ )
+ self.assertEqual(
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
# Attach volume to VM
with self.assertRaises(Exception):
self.debug("Trying to Attach volume: %s to VM: %s" % (
@@ -402,22 +401,22 @@ class TestAttachDetachVolume(cloudstackTestCase):
#get max data volumes limit based on the hypervisor type and version
listHost = Host.list(
cls.api_client,
- hypervisor = cls.services["virtual_machine"]["hypervisor"],
type ='Routing',
zoneid = cls.zone.id,
podid = cls.pod.id,
)
ver = listHost[0].hypervisorversion
+ hv = listHost[0].hypervisor
cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
- cmd.hypervisor = cls.services["virtual_machine"]["hypervisor"]
+ cmd.hypervisor = hv #cls.services["virtual_machine"]["hypervisor"]
res = cls.api_client.listHypervisorCapabilities(cmd)
cls.debug('Hypervisor Capabilities: {}'.format(res))
for i in range(len(res)):
if res[i].hypervisorversion == ver:
break
- max_data_volumes = int(res[i].maxdatavolumeslimit)
- cls.debug('max data volumes:{}'.format(max_data_volumes))
- cls.services["volume"]["max"] = max_data_volumes
+ cls.max_data_volumes = int(res[i].maxdatavolumeslimit)
+ cls.debug('max data volumes:{}'.format(cls.max_data_volumes))
+ cls.services["volume"]["max"] = cls.max_data_volumes
# Create VMs, NAT Rules etc
cls.account = Account.create(
cls.api_client,
@@ -477,7 +476,7 @@ class TestAttachDetachVolume(cloudstackTestCase):
volumes = []
# Create 5 volumes and attach to VM
- for i in range(self.services["volume"]["max"] - 1):
+ for i in range(self.max_data_volumes):
volume = Volume.create(
self.apiclient,
self.services["volume"],
@@ -498,17 +497,16 @@ class TestAttachDetachVolume(cloudstackTestCase):
self.apiclient,
id=volume.id
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
-
self.assertNotEqual(
- list_volume_response,
- None,
- "Check if volume exists in ListVolumes"
- )
+ list_volume_response,
+ None,
+ "Check if volume exists in ListVolumes"
+ )
+ self.assertEqual(
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
self.debug("Attach volume: %s to VM: %s" % (
volume.id,
self.virtual_machine.id
@@ -526,22 +524,21 @@ class TestAttachDetachVolume(cloudstackTestCase):
type='DATADISK',
listall=True
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
-
self.assertNotEqual(
list_volume_response,
None,
"Check if volume exists in ListVolumes"
)
self.assertEqual(
- len(list_volume_response),
- self.services["volume"]["max"],
- "Check number of data volumes attached to VM"
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
)
+ self.assertEqual(
+ len(list_volume_response),
+ self.max_data_volumes,
+ "Volumes attached to the VM %s. Expected %s" % (len(list_volume_response), self.max_data_volumes)
+ )
# Detach all volumes from VM
for volume in volumes:
@@ -668,22 +665,22 @@ class TestAttachVolumeISO(cloudstackTestCase):
#get max data volumes limit based on the hypervisor type and version
listHost = Host.list(
cls.api_client,
- hypervisor = cls.services["virtual_machine"]["hypervisor"],
type ='Routing',
zoneid = cls.zone.id,
podid = cls.pod.id,
)
ver = listHost[0].hypervisorversion
+ hv = listHost[0].hypervisor
cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
- cmd.hypervisor = cls.services["virtual_machine"]["hypervisor"]
+ cmd.hypervisor = hv
res = cls.api_client.listHypervisorCapabilities(cmd)
cls.debug('Hypervisor Capabilities: {}'.format(res))
for i in range(len(res)):
if res[i].hypervisorversion == ver:
break
- max_data_volumes = int(res[i].maxdatavolumeslimit)
- cls.debug('max data volumes:{}'.format(max_data_volumes))
- cls.services["volume"]["max"] = max_data_volumes
+ cls.max_data_volumes = int(res[i].maxdatavolumeslimit)
+ cls.debug('max data volumes:{}'.format(cls.max_data_volumes))
+ cls.services["volume"]["max"] = cls.max_data_volumes
# Create VMs, NAT Rules etc
cls.account = Account.create(
cls.api_client,
@@ -740,7 +737,7 @@ class TestAttachVolumeISO(cloudstackTestCase):
# 3. Verify that attach ISO is successful
# Create 5 volumes and attach to VM
- for i in range(self.services["volume"]["max"] - 1):
+ for i in range(self.max_data_volumes):
volume = Volume.create(
self.apiclient,
self.services["volume"],
@@ -758,16 +755,16 @@ class TestAttachVolumeISO(cloudstackTestCase):
self.apiclient,
id=volume.id
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
self.assertNotEqual(
list_volume_response,
None,
"Check if volume exists in ListVolumes"
)
+ self.assertEqual(
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
# Attach volume to VM
self.virtual_machine.attach_volume(
self.apiclient,
@@ -781,21 +778,21 @@ class TestAttachVolumeISO(cloudstackTestCase):
type='DATADISK',
listall=True
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
self.assertNotEqual(
list_volume_response,
None,
"Check if volume exists in ListVolumes"
)
self.assertEqual(
- len(list_volume_response),
- self.services["volume"]["max"],
- "Check number of data volumes attached to VM"
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
)
+ self.assertEqual(
+ len(list_volume_response),
+ self.max_data_volumes,
+ "Volumes attached to the VM %s. Expected %s" % (len(list_volume_response), self.max_data_volumes)
+ )
# Create an ISO and attach it to VM
iso = Iso.create(
self.apiclient,
@@ -943,17 +940,16 @@ class TestVolumes(cloudstackTestCase):
self.apiclient,
id=self.volume.id
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
self.assertNotEqual(
list_volume_response,
None,
"Check if volume exists in ListVolumes"
)
-
+ self.assertEqual(
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
volume = list_volume_response[0]
self.assertEqual(
@@ -987,16 +983,16 @@ class TestVolumes(cloudstackTestCase):
type='DATADISK',
listall=True
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
self.assertNotEqual(
- list_volume_response,
- None,
- "Check if volume exists in ListVolumes"
- )
+ list_volume_response,
+ None,
+ "Check if volume exists in ListVolumes"
+ )
+ self.assertEqual(
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
volume = list_volume_response[0]
self.assertEqual(
volume.vmname,
@@ -1033,17 +1029,16 @@ class TestVolumes(cloudstackTestCase):
self.apiclient,
id=self.volume.id
)
- self.assertEqual(
- isinstance(list_volume_response, list),
- True,
- "Check list volumes response for valid list"
- )
-
self.assertNotEqual(
list_volume_response,
None,
"Check if volume exists in ListVolumes"
)
+ self.assertEqual(
+ isinstance(list_volume_response, list),
+ True,
+ "Check list volumes response for valid list"
+ )
volume = list_volume_response[0]
self.assertEqual(
volume.virtualmachineid,
@@ -1077,12 +1072,11 @@ class TestVolumes(cloudstackTestCase):
list_volume_response = list_volumes(
self.apiclient,
id=self.volume.id,
- type='DATADISK'
)
self.assertEqual(
list_volume_response,
None,
- "Check if volume exists in ListVolumes"
+ "Volume %s was not deleted" % self.volume.id
)
return
[2/3] git commit: updated refs/heads/master to 75cd6cc
Posted by ts...@apache.org.
Fix redundant router deployment tests
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b3fb75e6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b3fb75e6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b3fb75e6
Branch: refs/heads/master
Commit: b3fb75e6c6f005a9d711e6f1952f92aa78f9554b
Parents: bad72a0
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Fri Aug 9 12:08:16 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Fri Aug 9 12:08:16 2013 +0530
----------------------------------------------------------------------
...test_redundant_router_deployment_planning.py | 51 +++++++++-----------
1 file changed, 24 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3fb75e6/test/integration/component/maint/test_redundant_router_deployment_planning.py
----------------------------------------------------------------------
diff --git a/test/integration/component/maint/test_redundant_router_deployment_planning.py b/test/integration/component/maint/test_redundant_router_deployment_planning.py
index f4a6fb7..879a4da 100644
--- a/test/integration/component/maint/test_redundant_router_deployment_planning.py
+++ b/test/integration/component/maint/test_redundant_router_deployment_planning.py
@@ -196,7 +196,7 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
try:
cleanup_resources(self.apiclient, self.cleanup)
except Exception as e:
- self.debug("Warning: Exception during cleanup : %s" % e)
+ self.warn("Warning: Exception during cleanup : %s" % e)
#raise Exception("Warning: Exception during cleanup : %s" % e)
return
@@ -391,7 +391,7 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
cmd.allocationstate = 'Disabled'
self.apiclient.updatePod(cmd)
- self.debug("Warning: Disabled all pods in zone")
+ self.warn("Warning: Disabled all pods in zone")
cmd = updatePod.updatePodCmd()
cmd.id = pods[0].id
@@ -528,11 +528,12 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
allocationstate="Disabled"
)
- for pod in pods:
- cmd = updatePod.updatePodCmd()
- cmd.id = pod.id
- cmd.allocationstate = 'Enabled'
- self.apiclient.updatePod(cmd)
+ if pods is not None:
+ for pod in pods:
+ cmd = updatePod.updatePodCmd()
+ cmd.id = pod.id
+ cmd.allocationstate = 'Enabled'
+ self.apiclient.updatePod(cmd)
return
@attr(tags=["advanced", "advancedns"])
@@ -611,7 +612,7 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
cmd.allocationstate = 'Disabled'
self.apiclient.updatePod(cmd)
- self.debug("Warning: Disabled all pods in zone")
+ self.warn("Warning: Disabled all pods in zone")
cmd = updatePod.updatePodCmd()
cmd.id = pods[0].id
@@ -627,7 +628,7 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
cmd.allocationstate = 'Disabled'
self.apiclient.updateCluster(cmd)
- self.debug("Warning: Disabled all pods in zone")
+ self.warn("Warning: Disabled all pods in zone")
cmd = updateCluster.updateClusterCmd()
cmd.id = clusters[0].id
@@ -751,17 +752,12 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
listall=True,
allocationstate="Disabled"
)
- self.assertEqual(
- isinstance(pods, list),
- True,
- "List pods should not return an empty response"
- )
-
- for pod in pods:
- cmd = updatePod.updatePodCmd()
- cmd.id = pod.id
- cmd.allocationstate = 'Enabled'
- self.apiclient.updatePod(cmd)
+ if pods is not None:
+ for pod in pods:
+ cmd = updatePod.updatePodCmd()
+ cmd.id = pod.id
+ cmd.allocationstate = 'Enabled'
+ self.apiclient.updatePod(cmd)
clusters = Cluster.list(
self.apiclient,
@@ -770,11 +766,12 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
listall=True
)
- for cluster in clusters:
- cmd = updateCluster.updateClusterCmd()
- cmd.id = cluster.id
- cmd.allocationstate = 'Enabled'
- self.apiclient.updateCluster(cmd)
+ if clusters is not None:
+ for cluster in clusters:
+ cmd = updateCluster.updateClusterCmd()
+ cmd.id = cluster.id
+ cmd.allocationstate = 'Enabled'
+ self.apiclient.updateCluster(cmd)
return
@attr(tags=["advanced", "advancedns", "ssh"])
@@ -852,7 +849,7 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
cmd.allocationstate = 'Disabled'
self.apiclient.updatePod(cmd)
- self.debug("Warning: Disabled all pods in zone")
+ self.warn("Warning: Disabled all pods in zone")
cmd = updatePod.updatePodCmd()
cmd.id = pods[0].id
@@ -868,7 +865,7 @@ class TestRvRDeploymentPlanning(cloudstackTestCase):
cmd.allocationstate = 'Disabled'
self.apiclient.updateCluster(cmd)
- self.debug("Warning: Disabled all pods in zone")
+ self.warn("Warning: Disabled all pods in zone")
cmd = updateCluster.updateClusterCmd()
cmd.id = clusters[0].id
[3/3] git commit: updated refs/heads/master to 75cd6cc
Posted by ts...@apache.org.
Fix VPC test
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/75cd6cce
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/75cd6cce
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/75cd6cce
Branch: refs/heads/master
Commit: 75cd6cce40a0a645d8a277f31d863d151c0037ec
Parents: b3fb75e
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Fri Aug 9 12:08:27 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Fri Aug 9 12:08:27 2013 +0530
----------------------------------------------------------------------
test/integration/component/test_vpc.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75cd6cce/test/integration/component/test_vpc.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py
index a79f110..1af8d81 100644
--- a/test/integration/component/test_vpc.py
+++ b/test/integration/component/test_vpc.py
@@ -1652,9 +1652,9 @@ class TestVPC(cloudstackTestCase):
if self.zone.domain == None:
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
- cmd.domain = "ROOT"
+ cmd.domain = "test.domain.org"
self.apiclient.updateZone(cmd)
- self.zone = Zone.list(self.apiclient, id=self.zone.id)
+ self.zone = Zone.list(self.apiclient, id=self.zone.id)[0]
self.services["vpc"]["cidr"] = "10.1.1.1/16"
self.debug("creating a VPC network in the account: %s" %