cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gir...@apache.org
Subject [2/4] git commit: updated refs/heads/marvin to 6a2cc9f
Date Wed, 22 Jan 2014 06:52:25 GMT
CLOUDSTACK-5674: Added Fix for CLOUDSTACK-5674,5498,5500 and other issues as
 part of cleanup


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

Branch: refs/heads/marvin
Commit: 939327561192eba7f21f6d5acb0119278984b510
Parents: 99b9198
Author: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
Authored: Mon Jan 20 13:19:39 2014 +0530
Committer: Girish Shilamkar <girish@clogeny.com>
Committed: Wed Jan 22 12:19:20 2014 +0530

----------------------------------------------------------------------
 setup/dev/advanced.cfg                          |  15 +-
 setup/dev/basic.cfg                             |  11 +-
 .../component/test_add_remove_network.py        |   6 +-
 .../component/test_affinity_groups.py           |  24 +-
 .../component/test_cpu_domain_limits.py         |  12 +-
 test/integration/component/test_cpu_limits.py   |   8 +-
 .../component/test_cpu_max_limits.py            |   8 +-
 .../component/test_cpu_project_limits.py        |   2 +-
 .../integration/component/test_memory_limits.py |   8 +-
 .../component/test_mm_domain_limits.py          |  12 +-
 .../integration/component/test_mm_max_limits.py |   8 +-
 .../component/test_mm_project_limits.py         |   2 +-
 test/integration/component/test_portable_ip.py  |   8 +-
 test/integration/component/test_vpc.py          |   2 +-
 test/integration/component/test_vpn_users.py    |   4 +-
 test/integration/smoke/test_affinity_groups.py  |   4 +-
 test/integration/smoke/test_deploy_vm.py        |   2 +-
 .../smoke/test_deploy_vm_with_userdata.py       |   2 +-
 tools/marvin/marvin/asyncJobMgr.py              |   4 +-
 tools/marvin/marvin/cloudstackConnection.py     | 426 +++++++++-------
 tools/marvin/marvin/cloudstackException.py      |  15 +-
 tools/marvin/marvin/cloudstackTestClient.py     | 495 +++++++++++++------
 tools/marvin/marvin/codegenerator.py            |   4 +-
 tools/marvin/marvin/codes.py                    |  15 +
 tools/marvin/marvin/config/__init__.py          |   0
 tools/marvin/marvin/config/test_data.cfg        | 160 ++++++
 tools/marvin/marvin/configGenerator.py          |  84 ++--
 tools/marvin/marvin/dbConnection.py             |   4 +-
 tools/marvin/marvin/deployDataCenter.py         | 321 ++++++++----
 tools/marvin/marvin/integration/lib/common.py   | 243 +++++----
 tools/marvin/marvin/jsonHelper.py               |   4 +-
 tools/marvin/marvin/lib/__init__.py             |   0
 tools/marvin/marvin/marvinInit.py               | 172 ++++---
 tools/marvin/marvin/marvinLog.py                | 122 ++++-
 tools/marvin/marvin/marvinPlugin.py             | 139 ++++--
 tools/marvin/marvin/src/__init__.py             |   0
 tools/marvin/marvin/tcExecuteEngine.py          |   7 +-
 37 files changed, 1603 insertions(+), 750 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/setup/dev/advanced.cfg
----------------------------------------------------------------------
diff --git a/setup/dev/advanced.cfg b/setup/dev/advanced.cfg
index 23981f0..7982217 100644
--- a/setup/dev/advanced.cfg
+++ b/setup/dev/advanced.cfg
@@ -17,7 +17,7 @@
 {
     "zones": [
         {
-            "name": "Sandbox-simulator",
+            "name": "Sandbox-simulator-new",
             "guestcidraddress": "10.1.1.0/24",
             "dns1": "10.147.28.6",
             "physical_networks": [
@@ -137,7 +137,7 @@
         "port": 3306,
         "user": "cloud"
     },
-    "logger": 
+    "logger":
         {
             "LogFolderPath": "/tmp/"
         },
@@ -218,5 +218,14 @@
             "certCAPath":  "NA",
             "certPath":  "NA"
         }
-    ]
+    ],
+    "ApiLoadCfg":
+    {
+        "ParsedApiDestFolder": ".",
+        "ApiSpecFile": "/etc/cloud/cli/commands.xml"
+    },
+    "TestData":
+    {
+      "Path": "config/config.cfg"
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/setup/dev/basic.cfg
----------------------------------------------------------------------
diff --git a/setup/dev/basic.cfg b/setup/dev/basic.cfg
index 3e39d6d..196a191 100644
--- a/setup/dev/basic.cfg
+++ b/setup/dev/basic.cfg
@@ -172,5 +172,14 @@
             "user": "root",
             "port": 8096
         }
-    ]
+    ],
+    "ApiLoadCfg":
+    {
+        "ParsedApiDestFolder": ".",
+        "ApiSpecFile": "/etc/cloud/cli/commands.xml"
+    },
+    "TestData":
+    {
+      "Path": "config/config.cfg"
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index 4529ec7..6eef71e 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -1300,7 +1300,7 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase):
         self.debug("Created account %s" % account.name)
 
         self.debug("creating user api client for account: %s" % account.name)
-        api_client = self.testClient.createUserApiClient(UserName=account.name, DomainName=self.account.domain)
+        api_client = self.testClient.getUserApiClient(UserName=account.name, DomainName=self.account.domain)
 
         self.debug("Trying to add network to vm with this api client, this should fail due to \
                     insufficient permission")
@@ -1478,7 +1478,7 @@ class TestFailureScenariosRemoveNicFromVM(cloudstackTestCase):
         self.debug("Created account %s" % account.name)
 
         self.debug("creating user api client for account: %s" % account.name)
-        api_client = self.testClient.createUserApiClient(UserName=account.name, DomainName=self.account.domain)
+        api_client = self.testClient.getUserApiClient(UserName=account.name, DomainName=self.account.domain)
 
         self.debug("Trying to add network to vm with this api client, this should fail due to \
                     insufficient permission")
@@ -1749,7 +1749,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase):
         self.debug("Created account %s" % account.name)
 
         self.debug("creating user api client for account: %s" % account.name)
-        api_client = self.testClient.createUserApiClient(UserName=account.name, DomainName=self.account.domain)
+        api_client = self.testClient.getUserApiClient(UserName=account.name, DomainName=self.account.domain)
 
         self.debug("Listing virtual machine so that to retrive the list of non-default and default nic")
         vm_list = list_virtual_machines(self.apiclient, id=self.virtual_machine.id)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py
index 7e4fabe..4fdb8f6 100644
--- a/test/integration/component/test_affinity_groups.py
+++ b/test/integration/component/test_affinity_groups.py
@@ -197,7 +197,7 @@ class TestCreateAffinityGroup(cloudstackTestCase):
         self.cleanup.append(self.do_admin)
         self.cleanup.append(self.new_domain)
 
-        domainapiclient = self.testClient.createUserApiClient(self.do_admin.name, self.new_domain.name, 2)
+        domainapiclient = self.testClient.getUserApiClient(self.do_admin.name, self.new_domain.name, 2)
 
         aff_grp = self.create_aff_grp(api_client=domainapiclient, aff_grp=self.services["host_anti_affinity"],
                                             acc=self.do_admin.name, domainid=self.new_domain.id)
@@ -214,7 +214,7 @@ class TestCreateAffinityGroup(cloudstackTestCase):
         self.user = Account.create(self.api_client, self.services["new_account"],
                                   domainid=self.domain.id)
 
-        userapiclient = self.testClient.createUserApiClient(self.user.name, self.domain.name)
+        userapiclient = self.testClient.getUserApiClient(self.user.name, self.domain.name)
 
         self.cleanup.append(self.user)
         aff_grp = self.create_aff_grp(api_client=userapiclient, aff_grp=self.services["host_anti_affinity"],
@@ -704,7 +704,7 @@ class TestDeleteAffinityGroups(cloudstackTestCase):
         self.user2 = Account.create(self.apiclient, self.services["new_account1"])
         self.cleanup.append(self.user2)
 
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user2.name,
                                         DomainName=self.user2.domain,
                                         acctType=0)
@@ -740,7 +740,7 @@ class TestDeleteAffinityGroups(cloudstackTestCase):
         self.user2 = Account.create(self.apiclient, self.services["new_account1"])
         self.cleanup.append(self.user2)
 
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user2.name,
                                         DomainName=self.user2.domain,
                                         acctType=0)
@@ -781,7 +781,7 @@ class TestDeleteAffinityGroups(cloudstackTestCase):
                                        self.services["new_account"])
 
         self.cleanup.append(self.user1)
-        user1apiclient = self.testClient.createUserApiClient(
+        user1apiclient = self.testClient.getUserApiClient(
                                         UserName=self.user1.name,
                                         DomainName=self.user1.domain,
                                         acctType=0)
@@ -1294,7 +1294,7 @@ class TestDeployVMAffinityGroups(cloudstackTestCase):
         self.user2 = Account.create(self.apiclient, self.services["new_account1"])
         self.cleanup.append(self.user2)
 
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user2.name,
                                         DomainName=self.user2.domain,
                                         acctType=0)
@@ -1327,7 +1327,7 @@ class TestDeployVMAffinityGroups(cloudstackTestCase):
         self.user2 = Account.create(self.apiclient, self.services["new_account1"])
         self.cleanup.append(self.user2)
 
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user2.name,
                                         DomainName=self.user2.domain,
                                         acctType=0)
@@ -1549,7 +1549,7 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
                                        self.services["new_account"])
 
         self.cleanup.append(self.user1)
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user1.name,
                                         DomainName=self.user1.domain,
                                         acctType=0)
@@ -1588,7 +1588,7 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
                                        self.services["new_account"])
 
         self.cleanup.append(self.user1)
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user1.name,
                                         DomainName=self.user1.domain,
                                         acctType=0)
@@ -1638,7 +1638,7 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
                                        self.services["new_account"])
 
         self.cleanup.append(self.user1)
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user1.name,
                                         DomainName=self.user1.domain,
                                         acctType=0)
@@ -1674,7 +1674,7 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
                                        self.services["new_account"])
 
         self.cleanup.append(self.user1)
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user1.name,
                                         DomainName=self.user1.domain,
                                         acctType=0)
@@ -1706,7 +1706,7 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
                                        self.services["new_account"])
 
         self.cleanup.append(self.user1)
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=self.user1.name,
                                         DomainName=self.user1.domain,
                                         acctType=0)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_cpu_domain_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_domain_limits.py b/test/integration/component/test_cpu_domain_limits.py
index c427e4f..cd2ab54 100644
--- a/test/integration/component/test_cpu_domain_limits.py
+++ b/test/integration/component/test_cpu_domain_limits.py
@@ -236,7 +236,7 @@ class TestDomainCPULimitsUpdateResources(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                 UserName=self.account.name,
                 DomainName=self.account.domain)
 
@@ -309,7 +309,7 @@ class TestDomainCPULimitsUpdateResources(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                 UserName=self.account.name,
                 DomainName=self.account.domain)
 
@@ -368,7 +368,7 @@ class TestDomainCPULimitsUpdateResources(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                 UserName=self.account.name,
                 DomainName=self.account.domain)
 
@@ -432,7 +432,7 @@ class TestDomainCPULimitsUpdateResources(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                 UserName=self.account.name,
                 DomainName=self.account.domain)
 
@@ -684,11 +684,11 @@ class TestMultipleChildDomains(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts()
 
-        api_client_cadmin_1 = self.testClient.createUserApiClient(
+        api_client_cadmin_1 = self.testClient.getUserApiClient(
             UserName=self.cadmin_1.name,
             DomainName=self.cadmin_1.domain)
 
-        api_client_cadmin_2 = self.testClient.createUserApiClient(
+        api_client_cadmin_2 = self.testClient.getUserApiClient(
             UserName=self.cadmin_2.name,
             DomainName=self.cadmin_2.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_cpu_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_limits.py b/test/integration/component/test_cpu_limits.py
index bdf2869..c6d8d14 100644
--- a/test/integration/component/test_cpu_limits.py
+++ b/test/integration/component/test_cpu_limits.py
@@ -478,7 +478,7 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
             UserName=self.account.name,
             DomainName=self.account.domain)
 
@@ -550,7 +550,7 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
             UserName=self.account.name,
             DomainName=self.account.domain)
 
@@ -608,7 +608,7 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
             UserName=self.account.name,
             DomainName=self.account.domain)
 
@@ -680,7 +680,7 @@ class TestDomainCPULimitsConfiguration(cloudstackTestCase):
             if cpu_account_gc[0].max != 16:
                 self.skipTest("This test case requires configuration value max.account.cpus to be 16")
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                 UserName=self.account.name,
                 DomainName=self.account.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_cpu_max_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_max_limits.py b/test/integration/component/test_cpu_max_limits.py
index 317df16..afbfcb4 100644
--- a/test/integration/component/test_cpu_max_limits.py
+++ b/test/integration/component/test_cpu_max_limits.py
@@ -251,7 +251,7 @@ class TestMaxCPULimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=4, domain_limit=2)
 
-        api_client_admin = self.testClient.createUserApiClient(
+        api_client_admin = self.testClient.getUserApiClient(
             UserName=self.child_do_admin.name,
             DomainName=self.child_do_admin.domain)
 
@@ -284,7 +284,7 @@ class TestMaxCPULimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=6, domain_limit=8)
 
-        api_client_admin = self.testClient.createUserApiClient(
+        api_client_admin = self.testClient.getUserApiClient(
             UserName=self.child_do_admin.name,
             DomainName=self.child_do_admin.domain)
 
@@ -325,7 +325,7 @@ class TestMaxCPULimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=4, domain_limit=4, project_limit=2)
 
-        api_client_admin = self.testClient.createUserApiClient(
+        api_client_admin = self.testClient.getUserApiClient(
             UserName=self.child_do_admin.name,
             DomainName=self.child_do_admin.domain)
 
@@ -360,7 +360,7 @@ class TestMaxCPULimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=6, domain_limit=6, project_limit=6)
 
-        api_client_admin = self.testClient.createUserApiClient(
+        api_client_admin = self.testClient.getUserApiClient(
             UserName=self.child_do_admin.name,
             DomainName=self.child_do_admin.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_cpu_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_project_limits.py b/test/integration/component/test_cpu_project_limits.py
index a8a1b3c..a81c70a 100644
--- a/test/integration/component/test_cpu_project_limits.py
+++ b/test/integration/component/test_cpu_project_limits.py
@@ -136,7 +136,7 @@ class TestProjectsCPULimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupProjectAccounts()
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
             UserName=self.admin.name,
             DomainName=self.admin.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_memory_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_memory_limits.py b/test/integration/component/test_memory_limits.py
index 7921e4b..84af4b1 100644
--- a/test/integration/component/test_memory_limits.py
+++ b/test/integration/component/test_memory_limits.py
@@ -495,7 +495,7 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                              UserName=self.account.name,
                              DomainName=self.account.domain)
 
@@ -567,7 +567,7 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                              UserName=self.account.name,
                              DomainName=self.account.domain)
 
@@ -625,7 +625,7 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
             self.account = admin
             self.domain = domain
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                              UserName=self.account.name,
                              DomainName=self.account.domain)
 
@@ -698,7 +698,7 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
             if memory_account_gc[0].max != 8192:
                 self.skipTest("This test case requires configuration value max.account.memory to be 8192")
 
-	        api_client = self.testClient.createUserApiClient(
+	        api_client = self.testClient.getUserApiClient(
                              UserName=self.account.name,
                              DomainName=self.account.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_mm_domain_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_domain_limits.py b/test/integration/component/test_mm_domain_limits.py
index 68660c1..a6c4de8 100644
--- a/test/integration/component/test_mm_domain_limits.py
+++ b/test/integration/component/test_mm_domain_limits.py
@@ -233,7 +233,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.debug("Creating an instance with service offering: %s" %
                                                     self.service_offering.name)
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                             UserName=self.account.name,
                             DomainName=self.account.domain)
 
@@ -370,7 +370,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.debug("Creating an instance with service offering: %s" %
                                                     self.service_offering.name)
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                             UserName=self.account.name,
                             DomainName=self.account.domain)
 
@@ -429,7 +429,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.debug("Creating an instance with service offering: %s" %
                                                     self.service_offering.name)
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                             UserName=self.account.name,
                             DomainName=self.account.domain)
 
@@ -489,7 +489,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.debug("Creating an instance with service offering: %s" %
                                                     self.service_offering.name)
 
-            api_client = self.testClient.createUserApiClient(
+            api_client = self.testClient.getUserApiClient(
                             UserName=self.account.name,
                             DomainName=self.account.domain)
 
@@ -706,11 +706,11 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts()
 
-        api_client_cadmin_1 = self.testClient.createUserApiClient(
+        api_client_cadmin_1 = self.testClient.getUserApiClient(
                             UserName=self.cadmin_1.name,
                             DomainName=self.cadmin_1.domain)
 
-        api_client_cadmin_2 = self.testClient.createUserApiClient(
+        api_client_cadmin_2 = self.testClient.getUserApiClient(
                             UserName=self.cadmin_2.name,
                             DomainName=self.cadmin_2.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_mm_max_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_max_limits.py b/test/integration/component/test_mm_max_limits.py
index e10c119..df29ea9 100644
--- a/test/integration/component/test_mm_max_limits.py
+++ b/test/integration/component/test_mm_max_limits.py
@@ -253,7 +253,7 @@ class TestMaxMemoryLimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=8, domain_limit=4)
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                             UserName=self.child_do_admin.name,
                             DomainName=self.child_do_admin.domain)
 
@@ -280,7 +280,7 @@ class TestMaxMemoryLimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=7, domain_limit=14)
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                             UserName=self.child_do_admin.name,
                             DomainName=self.child_do_admin.domain)
 
@@ -310,7 +310,7 @@ class TestMaxMemoryLimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=8,domain_limit=8, project_limit=4)
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                             UserName=self.child_do_admin.name,
                             DomainName=self.child_do_admin.domain)
 
@@ -334,7 +334,7 @@ class TestMaxMemoryLimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts(account_limit=6, project_limit=12, domain_limit=12)
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                             UserName=self.child_do_admin.name,
                             DomainName=self.child_do_admin.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_mm_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_project_limits.py b/test/integration/component/test_mm_project_limits.py
index c314011..d030692 100644
--- a/test/integration/component/test_mm_project_limits.py
+++ b/test/integration/component/test_mm_project_limits.py
@@ -136,7 +136,7 @@ class TestProjectsMemoryLimits(cloudstackTestCase):
         self.debug("Setting up account and domain hierarchy")
         self.setupProjectAccounts()
 
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                             UserName=self.admin.name,
                             DomainName=self.admin.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_portable_ip.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py
index d397ec4..8c65214 100644
--- a/test/integration/component/test_portable_ip.py
+++ b/test/integration/component/test_portable_ip.py
@@ -221,7 +221,7 @@ class TestCreatePortablePublicIpRanges(cloudstackTestCase):
                             domainid=self.domain.id
                             )
 
-        self.api_client_user = self.testClient.createUserApiClient(
+        self.api_client_user = self.testClient.getUserApiClient(
                                             UserName=self.account.name,
                                             DomainName=self.account.domain
                                             )
@@ -361,7 +361,7 @@ class TestDeletePortablePublicIpRanges(cloudstackTestCase):
 
         self.cleanup.append(self.account)
 
-        self.api_client_user = self.testClient.createUserApiClient(
+        self.api_client_user = self.testClient.getUserApiClient(
                                             UserName=self.account.name,
                                             DomainName=self.account.domain
                                             )
@@ -552,7 +552,7 @@ class TestListPortablePublicIpRanges(cloudstackTestCase):
 
         self.cleanup.append(self.account)
 
-        self.api_client_user = self.testClient.createUserApiClient(
+        self.api_client_user = self.testClient.getUserApiClient(
                                             UserName=self.account.name,
                                             DomainName=self.account.domain
                                             )
@@ -1110,7 +1110,7 @@ class TestDisassociatePublicIp(cloudstackTestCase):
                             domainid=self.domain.id
                             )
 
-        self.api_client_user = self.testClient.createUserApiClient(
+        self.api_client_user = self.testClient.getUserApiClient(
                                             UserName=self.user_account.name,
                                             DomainName=self.user_account.domain
                                             )

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_vpc.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py
index 1af8d81..ab3b5ab 100644
--- a/test/integration/component/test_vpc.py
+++ b/test/integration/component/test_vpc.py
@@ -1934,7 +1934,7 @@ class TestVPC(cloudstackTestCase):
         self.debug("creating a VPC network in the account: %s" %
                                                     user.name)
 
-        userapiclient = self.testClient.createUserApiClient(
+        userapiclient = self.testClient.getUserApiClient(
                                         UserName=user.name,
                                         DomainName=user.domain,
                                         acctType=0)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/component/test_vpn_users.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpn_users.py b/test/integration/component/test_vpn_users.py
index 02dd026..d76cbf8 100644
--- a/test/integration/component/test_vpn_users.py
+++ b/test/integration/component/test_vpn_users.py
@@ -396,7 +396,7 @@ class TestVPNUsers(cloudstackTestCase):
                                domainid=self.account.domainid)
         self.cleanup.append(admin)
         self.debug("Creating API client for newly created user")
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
 
@@ -438,7 +438,7 @@ class TestVPNUsers(cloudstackTestCase):
                                domainid=self.account.domainid)
         self.cleanup.append(admin)
         self.debug("Creating API client for newly created user")
-        api_client = self.testClient.createUserApiClient(
+        api_client = self.testClient.getUserApiClient(
                                     UserName=self.account.name,
                                     DomainName=self.account.domain)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/smoke/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py
index c96a580..0f8bdc4 100644
--- a/test/integration/smoke/test_affinity_groups.py
+++ b/test/integration/smoke/test_affinity_groups.py
@@ -70,7 +70,9 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.api_client = super(TestDeployVmWithAffinityGroup, cls).getClsTestClient().getApiClient()
+        cls.test_client = super(TestDeployVmWithAffinityGroup, cls).getClsTestClient()
+        zone_name = cls.test_client.getZoneForTests() 
+        cls.api_client = cls.test_client.getApiClient()
         cls.services = Services().services
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.api_client, cls.services)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/smoke/test_deploy_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py
index 425aeb7..4104386 100644
--- a/test/integration/smoke/test_deploy_vm.py
+++ b/test/integration/smoke/test_deploy_vm.py
@@ -153,4 +153,4 @@ class TestDeployVM(cloudstackTestCase):
         try:
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
-            self.debug("Warning! Exception in tearDown: %s" % e)
\ No newline at end of file
+            self.debug("Warning! Exception in tearDown: %s" % e)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/test/integration/smoke/test_deploy_vm_with_userdata.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm_with_userdata.py b/test/integration/smoke/test_deploy_vm_with_userdata.py
index e3788cf..85e768e 100644
--- a/test/integration/smoke/test_deploy_vm_with_userdata.py
+++ b/test/integration/smoke/test_deploy_vm_with_userdata.py
@@ -92,7 +92,7 @@ class TestDeployVmWithUserData(cloudstackTestCase):
         user_data = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(2500))
         cls.services["virtual_machine"]["userdata"] = user_data
 
-    @attr(tags=["simulator", "devcloud", "basic", "advanced"])
+    @attr(tags=["simulator", "devcloud", "basic", "advanced", "post"])
     def test_deployvm_userdata_post(self):
         """Test userdata as POST, size > 2k
         """

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/asyncJobMgr.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/asyncJobMgr.py b/tools/marvin/marvin/asyncJobMgr.py
index e24170e..dab85ca 100644
--- a/tools/marvin/marvin/asyncJobMgr.py
+++ b/tools/marvin/marvin/asyncJobMgr.py
@@ -62,7 +62,7 @@ class workThread(threading.Thread):
         try:
             self.lock.acquire()
             result = self.connection.poll(job.jobId, job.responsecls).jobresult
-        except cloudstackException.cloudstackAPIException, e:
+        except cloudstackException.CloudstackAPIException, e:
             result = str(e)
         finally:
             self.lock.release()
@@ -102,7 +102,7 @@ class workThread(threading.Thread):
                     except:
                         pass
                     jobstatus.status = True
-        except cloudstackException.cloudstackAPIException, e:
+        except cloudstackException.CloudstackAPIException, e:
             jobstatus.result = str(e)
             jobstatus.status = False
         except:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/cloudstackConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py
index fb03e3b..8413ac0 100644
--- a/tools/marvin/marvin/cloudstackConnection.py
+++ b/tools/marvin/marvin/cloudstackConnection.py
@@ -21,21 +21,33 @@ import base64
 import hmac
 import hashlib
 import time
-import cloudstackException
 from cloudstackAPI import *
 import jsonHelper
+from codes import (
+    FAILED,
+    INVALID_RESPONSE,
+    INVALID_INPUT,
+    JOB_FAILED,
+    JOB_INPROGRESS,
+    JOB_CANCELLED,
+    JOB_SUCCEEDED
+)
 from requests import (
     ConnectionError,
     HTTPError,
     Timeout,
     RequestException
-    )
+)
+from cloudstackException import GetDetailExceptionInfo
 
 
-class cloudConnection(object):
-
-    """ Connections to make API calls to the cloudstack management server
-    """
+class CSConnection(object):
+    '''
+    @Desc: Connection Class to make API\Command calls to the
+           CloudStack Management Server
+           Sends the GET\POST requests to CS based upon the
+           information provided and retrieves the parsed response.
+    '''
     def __init__(self, mgmtDet, asyncTimeout=3600, logger=None,
                  path='client/api'):
         self.apiKey = mgmtDet.apiKey
@@ -44,68 +56,79 @@ class cloudConnection(object):
         self.port = mgmtDet.port
         self.user = mgmtDet.user
         self.passwd = mgmtDet.passwd
-        self.certCAPath = mgmtDet.certCAPath
-        self.certPath = mgmtDet.certPath
+        if mgmtDet.certCAPath != "NA" and mgmtDet.certPath != "NA":
+            self.certPath = (mgmtDet.certCAPath, mgmtDet.certPath)
+        else:
+            self.certPath = ()
         self.logger = logger
         self.path = path
         self.retries = 5
         self.mgtDetails = mgmtDet
-        self.protocol = "http"
         self.asyncTimeout = asyncTimeout
         self.auth = True
         if self.port == 8096 or \
            (self.apiKey is None and self.securityKey is None):
             self.auth = False
-        if mgmtDet.useHttps == "True":
-            self.protocol = "https"
-        self.baseurl = "%s://%s:%d/%s"\
+        self.protocol = "https" if mgmtDet.useHttps == "True" else "http"
+        self.httpsFlag = True if self.protocol == "https" else False
+        self.baseUrl = "%s://%s:%d/%s"\
                        % (self.protocol, self.mgtSvr, self.port, self.path)
 
     def __copy__(self):
-        return cloudConnection(self.mgtDetails,
-                               self.asyncTimeout,
-                               self.logger,
-                               self.path)
-
-    def poll(self, jobid, response):
-        """
-        polls the completion of a given jobid
-        @param jobid:
-        @param response:
-        @return:
-        """
-        cmd = queryAsyncJobResult.queryAsyncJobResultCmd()
-        cmd.jobid = jobid
-        timeout = self.asyncTimeout
-
-        while timeout > 0:
-            asyncResonse = self.marvinRequest(cmd, response_type=response)
+        return CSConnection(self.mgtDetails,
+                            self.asyncTimeout,
+                            self.logger,
+                            self.path)
 
-            if asyncResonse.jobstatus == 2:
-                raise cloudstackException.cloudstackAPIException(
-                    "asyncquery", asyncResonse.jobresult)
-            elif asyncResonse.jobstatus == 1:
-                return asyncResonse
-
-            time.sleep(5)
-            if self.logger is not None:
-                self.logger.debug("job: %s still processing,"
-                                  "will timeout in %ds" % (jobid, timeout))
-            timeout = timeout - 5
+    def __poll(self, jobid, response_cmd):
+        '''
+        @Desc: polls for the completion of a given jobid
+        @param 1. jobid: Monitor the Jobid for CS
+               2. response_cmd:response command for request cmd
+        @return: FAILED if jobid is cancelled,failed
+                 Else return async_response
+        '''
+        try:
+            cmd = queryAsyncJobResult.queryAsyncJobResultCmd()
+            cmd.jobid = jobid
+            timeout = self.asyncTimeout
 
-        raise cloudstackException.cloudstackAPIException(
-            "asyncquery", "Async job timeout %s" % jobid)
+            while timeout > 0:
+                async_response = self.\
+                    marvinRequest(cmd, response_type=response_cmd)
+                if async_response != FAILED:
+                    job_status = async_response.jobstatus
+                    if job_status in [JOB_FAILED, JOB_CANCELLED]:
+                        self.logger.debug("=====JobId:%s Either "
+                                          "got Cancelled or Failed======"
+                                          % (str(jobid)))
+                        return FAILED
+                    if job_status == JOB_SUCCEEDED:
+                        self.logger.debug("======JobId:%s Succeeded====="
+                                          % (str(jobid)))
+                        return async_response
+                time.sleep(5)
+                timeout -= 5
+                self.logger.debug("JobId:%s is Still Processing, "
+                                  "Will TimeOut in:%s" % (str(jobid),
+                                                          str(timeout)))
+            return FAILED
+        except Exception, e:
+            self.logger.exception("__poll: Exception Occurred :%s" %
+                                  GetDetailExceptionInfo(e))
+            return FAILED
 
-    def sign(self, payload):
+    def __sign(self, payload):
         """
-        signs a given request URL when the apiKey and secretKey are known
-
+        @Name : __sign
+        @Desc:signs a given request URL when the apiKey and
+              secretKey are known
         @param payload: dict of GET params to be signed
         @return: the signature of the payload
         """
         params = zip(payload.keys(), payload.values())
         params.sort(key=lambda k: str.lower(k[0]))
-        hashStr = "&".join(
+        hash_str = "&".join(
             ["=".join(
                 [str.lower(r[0]),
                  str.lower(
@@ -114,168 +137,209 @@ class cloudConnection(object):
             ) for r in params]
         )
         signature = base64.encodestring(hmac.new(
-            self.securityKey, hashStr, hashlib.sha1).digest()).strip()
-        self.logger.debug("Computed Signature by Marvin: %s" % signature)
+            self.securityKey, hash_str, hashlib.sha1).digest()).strip()
         return signature
 
-    def request(self, command, auth=True, payload={}, method='GET'):
+    def __sendPostReqToCS(self, url, payload):
+        '''
+        @Name : __sendPostReqToCS
+        @Desc : Sends the POST Request to CS
+        @Input : url: URL to send post req
+                 payload:Payload information as part of request
+        '''
+        try:
+            response = requests.post(url,
+                                     params=payload,
+                                     cert=self.certPath,
+                                     verify=self.httpsFlag)
+            return response
+        except Exception, e:
+            self.logger.\
+                exception("__sendPostReqToCS : Exception "
+                          "Occurred: %s" % GetDetailExceptionInfo(e))
+            return FAILED
+
+    def __sendGetReqToCS(self, url, payload):
+        '''
+        @Name : __sendGetReqToCS
+        @Desc : Sends the GET Request to CS
+        @Input : url: URL to send post req
+                 payload:Payload information as part of request
+        '''
+        try:
+            response = requests.get(url,
+                                    params=payload,
+                                    cert=self.certPath,
+                                    verify=self.httpsFlag)
+            return response
+        except Exception, e:
+            self.logger.exception("__sendGetReqToCS : Exception Occurred: %s" %
+                                  GetDetailExceptionInfo(e))
+            return FAILED
+
+    def __sendCmdToCS(self, command, auth=True, payload={}, method='GET'):
         """
-        Makes requests using auth or over integration port
+        @Name : __sendCmdToCS
+        @Desc : Makes requests to CS using the Inputs provided
         @param command: cloudstack API command name
                     eg: deployVirtualMachineCommand
         @param auth: Authentication (apikey,secretKey) => True
                      else False for integration.api.port
         @param payload: request data composed as a dictionary
         @param method: GET/POST via HTTP
-        @return:
+        @output: FAILED or else response from CS
         """
-        payload["command"] = command
-        payload["response"] = "json"
-
-        if auth:
-            payload["apiKey"] = self.apiKey
-            signature = self.sign(payload)
-            payload["signature"] = signature
-
         try:
-            #https_flag : Signifies whether to verify connection over \
-            #http or https, \
-            #initialized to False, will be set to true if user provided https
-            #connection
-            https_flag = False
-            cert_path = ()
-            if self.protocol == "https":
-                https_flag = True
-                if self.certCAPath != "NA" and self.certPath != "NA":
-                    cert_path = (self.certCAPath, self.certPath)
+            payload["command"] = command
+            payload["response"] = "json"
+
+            if auth:
+                payload["apiKey"] = self.apiKey
+                payload["signature"] = self.__sign(payload)
 
             #Verify whether protocol is "http", then call the request over http
             if self.protocol == "http":
+                self.logger.debug("Payload: %s" % str(payload))
                 if method == 'POST':
-                    response = requests.post(self.baseurl, params=payload,
-                                             verify=https_flag)
-                else:
-                    response = requests.get(self.baseurl, params=payload,
-                                            verify=https_flag)
+                    self.logger.debug("=======Sending POST Cmd : %s======="
+                                      % str(command))
+                    return self.__sendPostReqToCS(self.baseUrl, payload)
+                if method == "GET":
+                    self.logger.debug("========Sending GET Cmd : %s======="
+                                      % str(command))
+                    return self.__sendGetReqToCS(self.baseUrl, payload)
             else:
-                '''
-                If protocol is https, then create the  connection url with \
-                user provided certificates \
-                provided as part of cert
-                '''
-                try:
-                    if method == 'POST':
-                        response = requests.post(self.baseurl,
-                                                 params=payload,
-                                                 cert=cert_path,
-                                                 verify=https_flag)
-                    else:
-                        response = requests.get(self.baseurl, params=payload,
-                                                cert=cert_path,
-                                                verify=https_flag)
-                except Exception, e:
-                    '''
-                    If an exception occurs with user provided CA certs, \
-                    then try with default certs, \
-                    we dont need to mention here the cert path
-                    '''
-                    self.logger.debug("Creating CS connection over https \
-                                        didnt worked with user provided certs \
-                                            , so trying with no certs %s" % e)
-                    if method == 'POST':
-                        response = requests.post(self.baseurl,
-                                                 params=payload,
-                                                 verify=https_flag)
-                    else:
-                        response = requests.get(self.baseurl,
-                                                params=payload,
-                                                verify=https_flag)
-        except ConnectionError, c:
-            self.logger.debug("Connection refused. Reason: %s : %s" %
-                              (self.baseurl, c))
-            raise c
-        except HTTPError, h:
-            self.logger.debug("Http Error.Server returned error code: %s" % h)
-            raise h
-        except Timeout, t:
-            self.logger.debug("Connection timed out with %s" % t)
-            raise t
-        except RequestException, r:
-            self.logger.debug("RequestException from server %s" % r)
-            raise r
+                self.logger.exception("__sendCmdToCS: Invalid Protocol")
+                return FAILED
         except Exception, e:
-            self.logger.debug("Error returned by server %s" % r)
-            raise e
-        else:
-            return response
+            self.logger.exception("__sendCmdToCS: Exception:%s" %
+                                  GetDetailExceptionInfo(e))
+            return FAILED
 
-    def sanitizeCommand(self, cmd):
+    def __sanitizeCmd(self, cmd):
         """
-        Removes None values, Validates all required params are present
+        @Name : __sanitizeCmd
+        @Desc : Removes None values, Validates all required params are present
         @param cmd: Cmd object eg: createPhysicalNetwork
-        @return:
+        @Output: Returns command name, asynchronous or not , request payload
+                 INVALID_INPUT if cmd is invalid
         """
-        requests = {}
-        required = []
-        for attribute in dir(cmd):
-            if not attribute.startswith('__'):
-                if attribute == "isAsync":
-                    isAsync = getattr(cmd, attribute)
-                elif attribute == "required":
-                    required = getattr(cmd, attribute)
-                else:
-                    requests[attribute] = getattr(cmd, attribute)
-
-        cmdname = cmd.__class__.__name__.replace("Cmd", "")
-        for requiredPara in required:
-            if requests[requiredPara] is None:
-                raise cloudstackException.cloudstackAPIException(
-                    cmdname, "%s is required" % requiredPara)
-        for param, value in requests.items():
-            if value is None:
-                requests.pop(param)
-            elif isinstance(value, list):
-                if len(value) == 0:
-                    requests.pop(param)
-                else:
-                    if not isinstance(value[0], dict):
-                        requests[param] = ",".join(value)
+        try:
+            cmd_name = ''
+            payload = {}
+            required = []
+            for attribute in dir(cmd):
+                if not attribute.startswith('__'):
+                    if attribute == "isAsync":
+                        isAsync = getattr(cmd, attribute)
+                    elif attribute == "required":
+                        required = getattr(cmd, attribute)
                     else:
-                        requests.pop(param)
-                        i = 0
-                        for val in value:
-                            for k, v in val.iteritems():
-                                requests["%s[%d].%s" % (param, i, k)] = v
-                            i = i + 1
-        return cmdname.strip(), isAsync, requests
+                        payload[attribute] = getattr(cmd, attribute)
+            cmd_name = cmd.__class__.__name__.replace("Cmd", "")
+            for required_param in required:
+                if payload[required_param] is None:
+                    self.logger.debug("CmdName: %s Parameter : %s is Required"
+                                      % (cmd_name, required_param))
+                    return INVALID_INPUT
+            for param, value in payload.items():
+                if value is None:
+                    payload.pop(param)
+                elif isinstance(value, list):
+                    if len(value) == 0:
+                        payload.pop(param)
+                    else:
+                        if not isinstance(value[0], dict):
+                            payload[param] = ",".join(value)
+                        else:
+                            payload.pop(param)
+                            i = 0
+                            for val in value:
+                                for k, v in val.iteritems():
+                                    payload["%s[%d].%s" % (param, i, k)] = v
+                                i += 1
+
+            return cmd_name.strip(), isAsync, payload
+        except Exception, e:
+            self.logger.\
+                exception("__sanitizeCmd: CmdName : "
+                          "%s : Exception:%s" % (cmd_name,
+                                                 GetDetailExceptionInfo(e)))
+            return FAILED
+
+    def __parseAndGetResponse(self, cmd_response, response_cls, is_async):
+        '''
+        @Name : __parseAndGetResponse
+        @Desc : Verifies the  Response(from CS) and returns an
+                appropriate json parsed Response
+        @Output:
+        '''
+        if cmd_response == FAILED:
+            return FAILED
+        try:
+            ret = jsonHelper.getResultObj(cmd_response.json(), response_cls)
+        except TypeError:
+            ret = jsonHelper.getResultObj(cmd_response.json, response_cls)
+
+        '''
+        If the response is asynchronous, poll and return response
+        else return response as it is
+        '''
+        if is_async == "false":
+            self.logger.debug("Response : %s" % str(ret))
+            return ret
+        else:
+            response = self.__poll(ret.jobid, response_cls)
+            self.logger.debug("Response : %s" % str(response))
+            return response.jobresult if response != FAILED else FAILED
 
     def marvinRequest(self, cmd, response_type=None, method='GET', data=''):
         """
-        Requester for marvin command objects
+        @Name : marvinRequest
+        @Desc: Handles Marvin Requests
         @param cmd: marvin's command from cloudstackAPI
         @param response_type: response type of the command in cmd
         @param method: HTTP GET/POST, defaults to GET
-        @return:
+        @return: Response received from CS
+                 FAILED In case of Error\Exception
         """
-        cmdname, isAsync, payload = self.sanitizeCommand(cmd)
-        self.logger.debug("sending %s request: %s %s" % (method, cmdname,
-                                                         str(payload)))
-        response = self.request(cmdname,
-                                self.auth,
-                                payload=payload,
-                                method=method)
-        if response is None:
-            return None
-        self.logger.debug("Request: %s Response: %s" % (response.url,
-                                                        response.text))
         try:
-            response = jsonHelper.getResultObj(response.json(), response_type)
-        except TypeError:
-            response = jsonHelper.getResultObj(response.json, response_type)
+            '''
+            1. Verify the Inputs Provided
+            '''
+            if (cmd is None or cmd == '')or \
+                    (response_type is None or response_type == ''):
+                self.logger.exception("marvinRequest : Invalid Command Input")
+                return FAILED
 
-        if isAsync == "false":
-            return response
-        else:
-            asyncJobId = response.jobid
-            response = self.poll(asyncJobId, response_type)
-            return response.jobresult
+            '''
+            2. Sanitize the Command
+            '''
+            if self.__sanitizeCmd(cmd) != INVALID_INPUT:
+                cmd_name, is_async, payload = self.__sanitizeCmd(cmd)
+            else:
+                self.logger.exception("marvinRequest : Cmd: "
+                                      "Sanitizing Command Failed")
+                return FAILED
+
+            '''
+            3. Send Command to CS
+            '''
+            cmd_response = self.__sendCmdToCS(cmd_name,
+                                              self.auth,
+                                              payload=payload,
+                                              method=method)
+            if cmd_response == FAILED:
+                return FAILED
+
+            '''
+            4. Check if the Command Response received above is valid or Not.
+               If not return Invalid Response
+            '''
+            return self.__parseAndGetResponse(cmd_response,
+                                              response_type,
+                                              is_async)
+        except Exception, e:
+            self.logger.exception("marvinRequest : CmdName: %s Exception: %s" %
+                                  (str(cmd), GetDetailExceptionInfo(e)))
+            return FAILED

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/cloudstackException.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackException.py b/tools/marvin/marvin/cloudstackException.py
index 6200003..3da28b7 100644
--- a/tools/marvin/marvin/cloudstackException.py
+++ b/tools/marvin/marvin/cloudstackException.py
@@ -15,8 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
+import sys
+import traceback
+from marvin.codes import (INVALID_INPUT, EXCEPTION_OCCURRED)
 
-class cloudstackAPIException(Exception):
+
+class CloudstackAPIException(Exception):
     def __init__(self, cmd="", result=""):
         self.errorMsg = "Execute cmd: %s failed, due to: %s" % (cmd, result)
 
@@ -46,3 +50,12 @@ class internalError(Exception):
 
     def __str__(self):
         return self.errorMsg
+
+
+def GetDetailExceptionInfo(e):
+    if e is not None:
+        exc_type, exc_value, exc_traceback = sys.exc_info()
+        return str(repr(traceback.format_exception(
+            exc_type, exc_value, exc_traceback)))
+    else:
+        return EXCEPTION_OCCURRED

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/cloudstackTestClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py
index 4ac510b..f0ba135 100644
--- a/tools/marvin/marvin/cloudstackTestClient.py
+++ b/tools/marvin/marvin/cloudstackTestClient.py
@@ -15,201 +15,406 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import cloudstackConnection
+from cloudstackConnection import CSConnection
 import asyncJobMgr
-import dbConnection
+from dbConnection import DbConnection
 from cloudstackAPI import *
 import random
 import string
 import hashlib
+from codes import (FAILED, PASS, ADMIN, DOMAIN_ADMIN,
+                   USER, SUCCESS, XEN_SERVER)
 from configGenerator import ConfigManager
-from marvin.integration.lib.utils import random_gen
+from marvin.integration.lib import utils
+from cloudstackException import GetDetailExceptionInfo
+from marvin.integration.lib.utils import (random_gen,
+                                          validateList)
+from marvin.cloudstackAPI.cloudstackAPIClient import CloudStackAPIClient
 
 '''
-@Desc  : CloudStackTestClient is encapsulated class for getting various \
-         clients viz., apiclient,dbconnection etc
+@Desc  : CloudStackTestClient is encapsulated entity for creating and
+         getting various clients viz., apiclient,
+         user api client, dbconnection, test Data parsed
+         information etc
 @Input : mgmtDetails : Management Server Details
          dbSvrDetails: Database Server details of Management \
                        Server. Retrieved from configuration file.
-         asyncTimeout :
-         defaultWorkerThreads :
-         logger : provides logging facilities for this library 
+         asyncTimeout : Timeout for Async queries
+         defaultWorkerThreads : Number of worker threads
+         logger : provides logging facilities for this library
+         zone : The zone on which test suites using this test client will run
 '''
 
 
-class cloudstackTestClient(object):
-    def __init__(self, mgmtDetails,
-                 dbSvrDetails, asyncTimeout=3600,
-                 defaultWorkerThreads=10,
-                 logger=None):
-        self.mgmtDetails = mgmtDetails
-        self.connection = \
-            cloudstackConnection.cloudConnection(self.mgmtDetails,
-                                                 asyncTimeout,
-                                                 logger)
-        self.apiClient =\
-            cloudstackAPIClient.CloudStackAPIClient(self.connection)
-        self.dbConnection = None
-        if dbSvrDetails is not None:
-                self.createDbConnection(dbSvrDetails.dbSvr, dbSvrDetails.port,
-                                        dbSvrDetails.user,
-                                        dbSvrDetails.passwd, dbSvrDetails.db)
-        '''
-        Provides the Configuration Object to users through getConfigParser
-        The purpose of this object is to parse the config
-        and provide dictionary of the config so users can
-        use that configuration.Users can later call getConfig
-        on this object and it will return the default parsed
-        config dictionary from default configuration file,
-        they can overwrite it with providing their own
-        configuration file as well.
-        '''
-        self.configObj = ConfigManager()
-        self.asyncJobMgr = None
-        self.id = None
-        self.defaultWorkerThreads = defaultWorkerThreads
+class CSTestClient(object):
+    def __init__(self, mgmt_details,
+                 dbsvr_details,
+                 async_timeout=3600,
+                 default_worker_threads=10,
+                 logger=None,
+                 test_data_filepath=None,
+                 zone=None):
+        self.__mgmtDetails = mgmt_details
+        self.__dbSvrDetails = dbsvr_details
+        self.__csConnection = None
+        self.__dbConnection = None
+        self.__testClient = None
+        self.__asyncTimeOut = async_timeout
+        self.__logger = logger
+        self.__defaultWorkerThreads = default_worker_threads
+        self.__apiClient = None
+        self.__userApiClient = None
+        self.__asyncJobMgr = None
+        self.__id = None
+        self.__testDataFilePath = test_data_filepath
+        self.__parsedTestDataConfig = None
+        self.__zone = zone
 
     @property
     def identifier(self):
-        return self.id
+        return self.__id
 
     @identifier.setter
     def identifier(self, id):
-        self.id = id
+        self.__id = id
 
-    def createDbConnection(self, host="localhost", port=3306, user='cloud',
-                           passwd='cloud', db='cloud'):
-        self.dbConnection = dbConnection.dbConnection(host, port, user,
-                                                      passwd, db)
+    def getParsedTestDataConfig(self):
+        '''
+        @Name : getParsedTestDataConfig
+        @Desc : Provides the TestData Config needed for
+                Tests are to Run
+        @Output : Returns the Parsed Test Data Dictionary
+        '''
+        return self.__parsedTestDataConfig
+
+    def getZoneForTests(self):
+        '''
+        @Name : getZoneForTests
+        @Desc : Provides the Zone against which Tests are to run
+                If zone name provided to marvin plugin is none
+                it will get it from Test Data Config File
+                Even, if  it is not available, return None
+        @Output : Returns the Zone Name
+        '''
+        if self.__zone is None:
+            if self.__parsedTestDataConfig is not None:
+                self.__zone = self.__parsedTestDataConfig.get("zone")
+        return self.__zone
+
+    def __setHypervisorToClient(self):
+        '''
+        @Name : ___setHypervisorToClient
+        @Desc:  Set the HyperVisor Details under API Client;
+                default to Xen
+        '''
+        if self.__mgmtDetails.hypervisor:
+            self.__apiClient.hypervisor = self.__mgmtDetails.hypervisor
+        else:
+            self.__apiClient.hypervisor = XEN_SERVER
+
+    def __createApiClient(self):
+        try:
+            '''
+            Step1 : Create a CS Connection Object
+            '''
+            self.__csConnection = CSConnection(self.__mgmtDetails,
+                                               self.__asyncTimeOut,
+                                               self.__logger)
+
+            '''
+            Step2 : Create API Client with earlier created connection object
+            '''
+            self.__apiClient = CloudStackAPIClient(self.__csConnection)
+
+            '''
+            Step3:  If API Key is not provided as part of Management Details,
+                    then verify and register
+            '''
+            if self.__mgmtDetails.apiKey is None:
+                list_user = listUsers.listUsersCmd()
+                list_user.account = "admin"
+                list_user_res = self.__apiClient.listUsers(list_user)
+                if list_user_res is None or\
+                        (validateList(list_user_res)[0] != PASS):
+                    self.__logger.debug("__createApiClient: API "
+                                        "Client Creation Failed")
+                    return FAILED
+
+                user_id = list_user_res[0].id
+                api_key = list_user_res[0].apikey
+                security_key = list_user_res[0].secretkey
+
+                if api_key is None:
+                    ret = self.__getKeys(user_id)
+                    if ret != FAILED:
+                        self.__mgmtDetails.port = 8080
+                        self.__mgmtDetails.apiKey = ret[0]
+                        self.__mgmtDetails.securityKey = ret[1]
+                    else:
+                        self.__logger.error("__createApiClient: API Client "
+                                            "Creation Failed while "
+                                            "Registering User")
+                        return FAILED
+                '''
+                Now Create the Connection objects and Api Client using
+                new details
+                '''
+                self.__csConnection = CSConnection(self.__mgmtDetails,
+                                                   self.__asyncTimeOut,
+                                                   self.__logger)
+                self.__apiClient = CloudStackAPIClient(self.__csConnection)
+            '''
+            Set the HyperVisor Details to Client default to Xen
+            '''
+            self.__setHypervisorToClient()
+            return SUCCESS
+        except Exception, e:
+            self.__logger.exception(" Exception Occurred Under "
+                                    "__createApiClient: %s" %
+                                    GetDetailExceptionInfo(e))
+            return FAILED
+
+    def __createDbConnection(self):
+        '''
+        @Name : ___createDbConnection
+        @Desc : Creates the CloudStack DB Connection
+        '''
+        host = "localhost" if self.__dbSvrDetails.dbSvr is None \
+            else self.__dbSvrDetails.dbSvr
+        port = 3306 if self.__dbSvrDetails.port is None \
+            else self.__dbSvrDetails.port
+        user = "cloud" if self.__dbSvrDetails.user is None \
+            else self.__dbSvrDetails.user
+        passwd = 'cloud' if self.__dbSvrDetails.passd is None \
+            else self.__dbSvrDetails.passd
+        db = 'cloud' if self.__dbSvrDetails.db is None \
+            else self.__dbSvrDetails.db
+        self.__dbConnection = DbConnection(host, port, user, passwd, db)
+
+    def __getKeys(self, userid):
+        '''
+        @Name : ___getKeys
+        @Desc : Retrieves the API and Secret Key for the provided Userid
+        '''
+        try:
+            register_user = registerUserKeys.registerUserKeysCmd()
+            register_user.id = userid
+            register_user_res = \
+                self.__apiClient.registerUserKeys(register_user)
+
+            if register_user_res == FAILED:
+                return FAILED
+            return (register_user_res.apikey, register_user_res.secretkey)
+        except Exception, e:
+            self.__logger.exception("Exception Occurred Under __geKeys : "
+                                    "%s" % GetDetailExceptionInfo(e))
+            return FAILED
+
+    def createTestClient(self):
+        '''
+        @Name : createTestClient
+        @Desc : Creates the Test Client.
+                The test Client is used by test suites
+                Here we create ParsedTestData Config.
+                Creates a DB Connection.
+                Creates an API Client
+        @Output : FAILED In case of an issue\Failure
+                  SUCCESS in case of Success of this function
+        '''
+        try:
+            '''
+            1. Create Config Object
+               Provides the Configuration Object to test suites through
+               getConfigParser. The purpose of this config object is to
+               parse the default config and provide dictionary of the
+               config so users can use that configuration.
+               Users can later call getConfig on this object and it will
+               return the default parsed config dictionary from default
+               configuration file. They can overwrite it with
+               providing their own configuration file as well.
+            '''
+            self.__configObj = ConfigManager(self.__testDataFilePath)
+            if self.__configObj is not None:
+                self.__parsedTestDataConfig = self.__configObj.getConfig()
+            else:
+                self.__logger.error("createTestClient : Not able to create "
+                                    "ConfigManager Object")
+                return FAILED
+            '''
+            2. Create DB Connection
+            '''
+            self.__createDbConnection()
+            '''
+            3. Creates API Client
+            '''
+            return self.__createApiClient()
+        except Exception, e:
+            self.__logger.exception("Exception Occurred "
+                                    "Under createTestClient "
+                                    ": %s" % GetDetailExceptionInfo(e))
+            return FAILED
 
     def isAdminContext(self):
         """
-        A user is a regular user if he fails to listDomains;
+        @Name : isAdminContext
+        @Desc:A user is a regular user if he fails to listDomains;
         if he is a domain-admin, he can list only domains that are non-ROOT;
         if he is an admin, he can list the ROOT domain successfully
         """
         try:
             listdom = listDomains.listDomainsCmd()
             listdom.name = 'ROOT'
-            listdomres = self.apiClient.listDomains(listdom)
-            rootdom = listdomres[0].name
-            if rootdom == 'ROOT':
-                return 1  # admin
-            else:
-                return 2  # domain-admin
+            listdomres = self.__apiClient.listDomains(listdom)
+            if listdomres != FAILED:
+                rootdom = listdomres[0].name
+                if rootdom == 'ROOT':
+                    return ADMIN
+                else:
+                    return DOMAIN_ADMIN
+            return USER
         except:
-            return 0  # user
-
-    def createUserApiClient(self, UserName, DomainName, acctType=0):
-        if not self.isAdminContext():
-            return self.apiClient
+            return USER
 
-        listDomain = listDomains.listDomainsCmd()
-        listDomain.listall = True
-        listDomain.name = DomainName
-        try:
-            domains = self.apiClient.listDomains(listDomain)
-            domId = domains[0].id
-        except:
-            cdomain = createDomain.createDomainCmd()
-            cdomain.name = DomainName
-            domain = self.apiClient.createDomain(cdomain)
-            domId = domain.id
-
-        cmd = listAccounts.listAccountsCmd()
-        cmd.name = UserName
-        cmd.domainid = domId
+    def __createUserApiClient(self, UserName, DomainName, acctType=0):
+        '''
+        @Name : ___createUserApiClient
+        @Desc : Creates a User API Client with given
+                UserName\DomainName Parameters
+        '''
         try:
-            accounts = self.apiClient.listAccounts(cmd)
-            acctId = accounts[0].id
-        except:
-            createAcctCmd = createAccount.createAccountCmd()
-            createAcctCmd.accounttype = acctType
-            createAcctCmd.domainid = domId
-            createAcctCmd.email = "test-" + random_gen()\
-                + "@cloudstack.org"
-            createAcctCmd.firstname = UserName
-            createAcctCmd.lastname = UserName
-            createAcctCmd.password = 'password'
-            createAcctCmd.username = UserName
-            acct = self.apiClient.createAccount(createAcctCmd)
-            acctId = acct.id
-
-        listuser = listUsers.listUsersCmd()
-        listuser.username = UserName
-
-        listuserRes = self.apiClient.listUsers(listuser)
-        userId = listuserRes[0].id
-        apiKey = listuserRes[0].apikey
-        securityKey = listuserRes[0].secretkey
-
-        if apiKey is None:
-            registerUser = registerUserKeys.registerUserKeysCmd()
-            registerUser.id = userId
-            registerUserRes = self.apiClient.registerUserKeys(registerUser)
-            apiKey = registerUserRes.apikey
-            securityKey = registerUserRes.secretkey
-
-        mgtDetails = self.mgmtDetails
-        mgtDetails.apiKey = apiKey
-        mgtDetails.securityKey = securityKey
-
-        newUserConnection =\
-            cloudstackConnection.cloudConnection(mgtDetails,
-                                                 self.connection.asyncTimeout,
-                                                 self.connection.logger)
-        self.userApiClient =\
-            cloudstackAPIClient.CloudStackAPIClient(newUserConnection)
-        self.userApiClient.connection = newUserConnection
-        self.userApiClient.hypervisor = self.apiClient.hypervisor
-        return self.userApiClient
+            if not self.isAdminContext():
+                return self.__apiClient
+
+            listDomain = listDomains.listDomainsCmd()
+            listDomain.listall = True
+            listDomain.name = DomainName
+            try:
+                domains = self.__apiClient.listDomains(listDomain)
+                domId = domains[0].id
+            except:
+                cdomain = createDomain.createDomainCmd()
+                cdomain.name = DomainName
+                domain = self.__apiClient.createDomain(cdomain)
+                domId = domain.id
+
+            cmd = listAccounts.listAccountsCmd()
+            cmd.name = UserName
+            cmd.domainid = domId
+            try:
+                accounts = self.__apiClient.listAccounts(cmd)
+                acctId = accounts[0].id
+            except:
+                createAcctCmd = createAccount.createAccountCmd()
+                createAcctCmd.accounttype = acctType
+                createAcctCmd.domainid = domId
+                createAcctCmd.email = "test-" + random_gen()\
+                    + "@cloudstack.org"
+                createAcctCmd.firstname = UserName
+                createAcctCmd.lastname = UserName
+                createAcctCmd.password = 'password'
+                createAcctCmd.username = UserName
+                acct = self.__apiClient.createAccount(createAcctCmd)
+                acctId = acct.id
+
+            listuser = listUsers.listUsersCmd()
+            listuser.username = UserName
+
+            listuserRes = self.__apiClient.listUsers(listuser)
+            userId = listuserRes[0].id
+            apiKey = listuserRes[0].apikey
+            securityKey = listuserRes[0].secretkey
+
+            if apiKey is None:
+                ret = self.__getKeys(userId)
+                if ret != FAILED:
+                    mgtDetails = self.__mgmtDetails
+                    mgtDetails.apiKey = ret[0]
+                    mgtDetails.securityKey = ret[1]
+                else:
+                    self.__logger.error("__createUserApiClient: "
+                                        "User API Client Creation."
+                                        " While Registering User Failed")
+                    return FAILED
+
+            newUserConnection =\
+                CSConnection(mgtDetails,
+                             self.__csConnection.asyncTimeout,
+                             self.__csConnection.logger)
+            self.__userApiClient = CloudStackAPIClient(newUserConnection)
+            self.__userApiClient.connection = newUserConnection
+            self.__userApiClient.hypervisor = self.__apiClient.hypervisor
+            return self.__userApiClient
+        except Exception, e:
+            self.__logger.exception("Exception Occurred "
+                                    "Under getUserApiClient : %s" %
+                                    GetDetailExceptionInfo(e))
+            return FAILED
 
     def close(self):
-        if self.connection is not None:
-            self.connection.close()
+        if self.__csConnection is not None:
+            self.__csConnection.close()
 
     def getDbConnection(self):
-        return self.dbConnection
+        '''
+        @Name : getDbConnection
+        @Desc : Retrieves the DB Connection Handle
+        '''
+        return self.__dbConnection
 
     def getConfigParser(self):
-        return self.configObj
+        '''
+        @Name : getConfigParser
+        @Desc : Provides the ConfigManager Interface to TestClients
+        '''
+        return self.__configObj
 
     def getApiClient(self):
-        self.apiClient.id = self.identifier
-        return self.apiClient
+        if self.__apiClient is not None:
+            self.__apiClient.id = self.identifier
+            return self.__apiClient
+        return None
 
     def getUserApiClient(self, account, domain, type=0):
         """
-        0 - user
-        1 - admin
-        2 - domain admin
+        @Name : getUserApiClient
+        @Desc : Provides the User API Client to Users
+        0 - user ; 1 - admin;2 - domain admin
+        @OutPut : FAILED In case of an issue
+                  else User API Client
         """
-        self.createUserApiClient(account, domain, type)
-        if hasattr(self, "userApiClient"):
-            return self.userApiClient
-        return None
+        return FAILED if (self.__createUserApiClient(account,
+                                                     domain,
+                                                     type)
+                          == FAILED) \
+            else self.__userApiClient
 
     def submitCmdsAndWait(self, cmds, workers=1):
-        '''FixME, httplib has issue if more than one thread submitted'''
-        if self.asyncJobMgr is None:
-            self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient,
-                                                       self.dbConnection)
-        return self.asyncJobMgr.submitCmdsAndWait(cmds, workers)
+        '''
+        @Desc : FixME, httplib has issue if more than one thread submitted
+        '''
+        if self.__asyncJobMgr is None:
+            self.__asyncJobMgr = asyncJobMgr.asyncJobMgr(self.__apiClient,
+                                                         self.__dbConnection)
+        return self.__asyncJobMgr.submitCmdsAndWait(cmds, workers)
 
     def submitJob(self, job, ntimes=1, nums_threads=10, interval=1):
         '''
-        submit one job and execute the same job ntimes, with nums_threads
-        of threads
+        @Desc : submit one job and execute the same job
+                ntimes, with nums_threads of threads
         '''
-        if self.asyncJobMgr is None:
-            self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient,
-                                                       self.dbConnection)
-        self.asyncJobMgr.submitJobExecuteNtimes(job, ntimes, nums_threads,
-                                                interval)
+        if self.__asyncJobMgr is None:
+            self.__asyncJobMgr = asyncJobMgr.asyncJobMgr(self.__apiClient,
+                                                         self.__dbConnection)
+        self.__asyncJobMgr.submitJobExecuteNtimes(job, ntimes,
+                                                  nums_threads,
+                                                  interval)
 
     def submitJobs(self, jobs, nums_threads=10, interval=1):
-        '''submit n jobs, execute them with nums_threads of threads'''
-        if self.asyncJobMgr is None:
-            self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient,
-                                                       self.dbConnection)
-        self.asyncJobMgr.submitJobs(jobs, nums_threads, interval)
+        '''
+        @Desc :submit n jobs, execute them with nums_threads
+               of threads
+        '''
+        if self.__asyncJobMgr is None:
+            self.__asyncJobMgr = asyncJobMgr.asyncJobMgr(self.__apiClient,
+                                                         self.__dbConnection)
+        self.__asyncJobMgr.submitJobs(jobs, nums_threads, interval)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/codegenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/codegenerator.py b/tools/marvin/marvin/codegenerator.py
index e0f056f..d4a81cf 100644
--- a/tools/marvin/marvin/codegenerator.py
+++ b/tools/marvin/marvin/codegenerator.py
@@ -42,7 +42,7 @@ class cloudStackCmd(object):
         self.response = []
 
 
-class codeGenerator(object):
+class CodeGenerator(object):
     """
     Apache CloudStack- marvin python classes can be generated from the json
     returned by API discovery or from the xml spec of commands generated by
@@ -454,7 +454,7 @@ if __name__ == "__main__":
             print parser.print_help()
             exit(1)
 
-    cg = codeGenerator(folder)
+    cg = CodeGenerator(folder)
     if options.spec is not None:
         cg.generateCodeFromXML(apiSpecFile)
     elif options.endpoint is not None:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/codes.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py
index 74fb05d..2f606dc 100644
--- a/tools/marvin/marvin/codes.py
+++ b/tools/marvin/marvin/codes.py
@@ -47,3 +47,18 @@ YES = "yes"
 FAILED = "FAILED"
 UNKNOWN_ERROR = "Unknown Error"
 EXCEPTION = "EXCEPTION"
+INVALID_RESPONSE = "Invalid Response"
+'''
+Async Job Related Codes
+'''
+JOB_INPROGRESS = 0
+JOB_SUCCEEDED = 1
+JOB_FAILED = 2
+JOB_CANCELLED = 3
+'''
+User Related Codes
+'''
+ADMIN = 1
+DOMAIN_ADMIN = 2
+USER = 0
+XEN_SERVER = "XenServer"

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93932756/tools/marvin/marvin/config/__init__.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/__init__.py b/tools/marvin/marvin/config/__init__.py
new file mode 100644
index 0000000..e69de29


Mime
View raw message