cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] 26/34: fix volume usage test case
Date Sat, 16 Dec 2017 06:46:19 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 2716ede1133db78fb82f5d70a30d7dcce5b84081
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Tue Dec 12 20:52:24 2017 +0530

    fix volume usage test case
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 server/src/com/cloud/server/StatsCollector.java |  2 +-
 test/integration/smoke/test_usage.py            | 22 ++++------------------
 2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 96b51f5..d32ed98 100644
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -937,7 +937,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
     }
 
     public VolumeStats getVolumeStats(String volumeLocator) {
-        if (_volumeStats.containsKey(volumeLocator)) {
+        if (volumeLocator != null && _volumeStats.containsKey(volumeLocator)) {
             return _volumeStats.get(volumeLocator);
         }
         return null;
diff --git a/test/integration/smoke/test_usage.py b/test/integration/smoke/test_usage.py
index e6c6565..4419835 100644
--- a/test/integration/smoke/test_usage.py
+++ b/test/integration/smoke/test_usage.py
@@ -680,26 +680,12 @@ class TestVolumeUsage(cloudstackTestCase):
             "Check VOLUME.DELETE in events table"
         )
         self.hypervisor = str(get_hypervisor_type(self.apiclient)).lower()
-        if self.hypervisor == "vmware":
-            self.testdata["coreos_volume"][
-                "url"] = self.testdata["coreos_volume"]["urlvmware"]
-            self.testdata["coreos_volume"]["format"] = "OVA"
-        elif self.hypervisor == "xenserver":
-            self.testdata["coreos_volume"][
-                "url"] = self.testdata["coreos_volume"]["urlxen"]
-            self.testdata["coreos_volume"]["format"] = "VHD"
-        elif self.hypervisor == "kvm":
-            self.testdata["coreos_volume"][
-                "url"] = self.testdata["coreos_volume"]["urlkvm"]
-            self.testdata["coreos_volume"]["format"] = "QCOW2"
-        elif self.hypervisor == "hyperv":
-            self.testdata["coreos_volume"][
-                "url"] = self.testdata["coreos_volume"]["urlxen"]
-            self.testdata["coreos_volume"]["format"] = "VHD"
-
+        volume_template = self.testdata["test_templates"][self.hypervisor]
+        volume_template["diskname"] = "Volume_tiny"
+        volume_template["format"] = volume_template["format"].upper()
         volume_uploaded = Volume.upload(
             self.apiclient,
-            self.testdata["coreos_volume"],
+            volume_template,
             self.zone.id,
             account=self.account.name,
             domainid=self.account.domainid)

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.

Mime
View raw message