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/07/25 10:45:24 UTC

[1/2] git commit: updated refs/heads/master to e432ce6

Updated Branches:
  refs/heads/master 0010faee4 -> e432ce6f7


CLOUDSTACK-3021: Do not delete the domain

We delete the accounts within the domain thereby cleaning up resources.
Also corrected the typo in the test description. ForceDelete test was
called without force option and vice versa

Signed-off-by: Prasanna Santhanam <ts...@apache.org>
(cherry picked from commit a3c21b3682db51986e7cc54d8f25b1dbf4ae9eaa)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e432ce6f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e432ce6f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e432ce6f

Branch: refs/heads/master
Commit: e432ce6f774faa9d8d0832951910310a3a3c5027
Parents: 2d5fde3
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 25 14:11:25 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 25 14:14:49 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_accounts.py | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e432ce6f/test/integration/component/test_accounts.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py
index 726df42..1170c79 100644
--- a/test/integration/component/test_accounts.py
+++ b/test/integration/component/test_accounts.py
@@ -915,7 +915,7 @@ class TestTemplateHierarchy(cloudstackTestCase):
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
-    @attr(tags=["advanced", "basic", "eip", "advancedns", "sg"])
+    @attr(tags=["advanced", "basic", "eip", "advancedns", "sg", "needle"])
     def test_01_template_hierarchy(self):
         """Test to verify template at same level in hierarchy"""
 
@@ -1637,7 +1637,7 @@ class TestDomainForceRemove(cloudstackTestCase):
 
     @attr(tags=["domains", "advanced", "advancedns", "simulator"])
     def test_forceDeleteDomain(self):
-        """ Test delete domain without force option"""
+        """ Test delete domain with force option"""
 
         # Steps for validations
         # 1. create a domain DOM
@@ -1784,16 +1784,9 @@ class TestDomainForceRemove(cloudstackTestCase):
         self.debug("Waiting for account.cleanup.interval" +
                    " to cleanup any remaining resouces")
 
-        configurations = Configurations.list(
-                                            self.apiclient,
-                                            name="account.cleanup.interval",
-                                            listall=True
-                                            )
-        self.debug("account.cleanup.interval: %s" %
-                                            int(configurations[0].value))
-        # Sleep to ensure that all resources are deleted
-        time.sleep(int(configurations[0].value) * 2)
-        self.debug("Checking if the resources in domain are deleted or not..")
+        # Sleep 2*account.gc to ensure that all resources are deleted
+        wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*2)
+        self.debug("Checking if the resources in domain are deleted")
         with self.assertRaises(cloudstackAPIException):
             Account.list(
                         self.apiclient,
@@ -1805,7 +1798,7 @@ class TestDomainForceRemove(cloudstackTestCase):
 
     @attr(tags=["domains", "advanced", "advancedns", "simulator"])
     def test_DeleteDomain(self):
-        """ Test delete domain with force option"""
+        """ Test delete domain without force option"""
 
         # Steps for validations
         # 1. create a domain DOM
@@ -1827,7 +1820,6 @@ class TestDomainForceRemove(cloudstackTestCase):
                                 self.services["domain"],
                                 parentdomainid=self.domain.id
                                 )
-        self.cleanup.append(domain)
         self.debug("Domain: %s is created successfully." % domain.name)
         self.debug(
             "Checking if the created domain is listed in list domains API")


[2/2] git commit: updated refs/heads/master to e432ce6

Posted by ts...@apache.org.
Fix the simulator

Include the createTemplateFromSnapshot in the storageprocessor.

Signed-off-by: Prasanna Santhanam <ts...@apache.org>
(cherry picked from commit e8383121c60e7c815ba1990df1e8a440f7d87188)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2d5fde3d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2d5fde3d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2d5fde3d

Branch: refs/heads/master
Commit: 2d5fde3dc127d994d696aeacf01f73a5025aa403
Parents: 0010fae
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 25 12:08:55 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 25 14:14:49 2013 +0530

----------------------------------------------------------------------
 .../resource/SimulatorStorageProcessor.java     | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d5fde3d/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
index d2be9cf..0131c1d 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
@@ -94,6 +94,27 @@ public class SimulatorStorageProcessor implements StorageProcessor {
     }
 
     @Override
+    public Answer createTemplateFromSnapshot(CopyCommand cmd) {
+        TemplateObjectTO template = (TemplateObjectTO)cmd.getDestTO();
+        DataStoreTO imageStore = template.getDataStore();
+        String details;
+
+        try {
+            if (!(imageStore instanceof  NfsTO)) {
+                return new CopyCmdAnswer("Only support create template from snapshot, when the dest store is nfs");
+            }
+
+            template.setPath(template.getName());
+            template.setFormat(Storage.ImageFormat.RAW);
+
+            return new CopyCmdAnswer(template);
+        } catch (Throwable e) {
+            details = "CreatePrivateTemplateFromSnapshotCommand exception: " + e.toString();
+            return new CopyCmdAnswer(details);
+        }
+    }
+
+    @Override
     public Answer backupSnapshot(CopyCommand cmd) {
         DataTO srcData = cmd.getSrcTO();
         DataTO destData = cmd.getDestTO();