cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tall...@apache.org
Subject git commit: updated refs/heads/marvin to 65e8f2d
Date Fri, 04 Apr 2014 13:01:10 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/marvin 4779e575b -> 65e8f2dc5


Fixed issues related to CLOUDSTACK-5674

Fixed issues mentioned for CLOUDSTACK-5674.
More changes in the bug

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>


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

Branch: refs/heads/marvin
Commit: 65e8f2dc537427f28d43d90f3fb175a24c34ae02
Parents: 4779e57
Author: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
Authored: Wed Apr 2 20:34:09 2014 +0530
Committer: SrikanteswaraRao Talluri <talluri@apache.org>
Committed: Fri Apr 4 18:30:45 2014 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_nic.py          |  5 +-
 test/integration/smoke/test_ssvm.py         |  2 -
 tools/marvin/marvin/cloudstackConnection.py | 18 ++++----
 tools/marvin/marvin/cloudstackTestClient.py |  8 ++--
 tools/marvin/marvin/config/test_data.py     | 23 +++++++++-
 tools/marvin/marvin/marvinLog.py            |  5 +-
 tools/marvin/marvin/marvinPlugin.py         | 18 ++++++--
 tools/marvin/setup.py                       | 58 ++++++++++++------------
 8 files changed, 82 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/test/integration/smoke/test_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py
index afff95d..de027ee 100644
--- a/test/integration/smoke/test_nic.py
+++ b/test/integration/smoke/test_nic.py
@@ -65,10 +65,7 @@ class TestNic(cloudstackTestCase):
                                 zone.id,
                                 self.services["ostype"]
                                 )
-            if self.template == FAILED:
-                self.fail("get_template() failed to return template with description %s"
% self.services["ostype"])
-
-              # Set Zones and disk offerings
+            # Set Zones and disk offerings
             self.services["small"]["zoneid"] = zone.id
             self.services["small"]["template"] = template.id
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/test/integration/smoke/test_ssvm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py
index b03f8cc..63cdbff 100644
--- a/test/integration/smoke/test_ssvm.py
+++ b/test/integration/smoke/test_ssvm.py
@@ -34,8 +34,6 @@ _multiprocess_shared_ = True
 class TestSSVMs(cloudstackTestCase):
 
     def setUp(self):
-
-	self.testClient = super(TestSSVMs, cls).getClsTestClient()
         self.apiclient = self.testClient.getApiClient()
         self.hypervisor = self.testClient.getHypervisorInfo()
         self.cleanup = []

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/tools/marvin/marvin/cloudstackConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py
index c4a4b0d..e3c5590 100644
--- a/tools/marvin/marvin/cloudstackConnection.py
+++ b/tools/marvin/marvin/cloudstackConnection.py
@@ -21,9 +21,9 @@ import base64
 import hmac
 import hashlib
 import time
-from .cloudstackAPI import *
-from . import jsonHelper
-from .codes import (
+from cloudstackAPI import *
+import jsonHelper
+from marvin.codes import (
     FAILED,
     INVALID_RESPONSE,
     INVALID_INPUT,
@@ -110,8 +110,8 @@ class CSConnection(object):
                         break
                 time.sleep(5)
                 timeout -= 5
-                self.logger.debug("JobId:%s is Still Processing, "
-                                  "Will TimeOut in:%s" % (str(jobid),
+                self.logger.debug("=== JobId:%s is Still Processing, "
+                                  "Will TimeOut in:%s ====" % (str(jobid),
                                                           str(timeout)))
             end_time = time.time()
             tot_time = int(start_time - end_time)
@@ -122,9 +122,9 @@ class CSConnection(object):
                  str(time.ctime(end_time)), str(tot_time)))
             return async_response
         except Exception as e:
-            self.__lastError = GetDetailExceptionInfo(e)
-            self.logger.exception("__poll: Exception Occurred :%s" %
-                                  self.__lastError)
+            self.__lastError = e
+            self.logger.exception("==== __poll: Exception Occurred :%s ====" %
+                                  str(self.__lastError))
             return FAILED
 
     def getLastError(self):
@@ -353,7 +353,7 @@ class CSConnection(object):
                                               payload=payload,
                                               method=method)
             if cmd_response == FAILED:
-                return FAILED
+                raise self.__lastError
 
             '''
             4. Check if the Command Response received above is valid or Not.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/tools/marvin/marvin/cloudstackTestClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py
index b3a0622..25dfcc7 100644
--- a/tools/marvin/marvin/cloudstackTestClient.py
+++ b/tools/marvin/marvin/cloudstackTestClient.py
@@ -141,16 +141,14 @@ class CSTestClient(object):
                 list_user = listUsers.listUsersCmd()
                 list_user.account = "admin"
                 list_user_res = self.__apiClient.listUsers(list_user)
-                if list_user_res == FAILED or list_user_res is None or\
+                if list_user_res is None or\
                         (validateList(list_user_res)[0] != PASS):
                     self.__logger.error("__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:
@@ -162,6 +160,10 @@ class CSTestClient(object):
                                             "Creation Failed while "
                                             "Registering User")
                         return FAILED
+                else:
+                    self.__mgmtDetails.port = 8080
+                    self.__mgmtDetails.apiKey = api_key
+                    self.__mgmtDetails.securityKey = security_key
                 '''
                 Now Create the Connection objects and Api Client using
                 new details

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index 3c1d4af..55e90d4 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -295,7 +295,6 @@ test_data = {
                 "Lb": {"lbSchemes": "internal", "SupportedLbIsolation": "dedicated"}
             }
         },
-
         "natrule": {
             "privateport": 22,
             "publicport": 2222,
@@ -350,6 +349,12 @@ test_data = {
         },
         "templatefilter": 'self',
 
+        "templates": {
+           "displaytext": 'Template',
+           "name": 'Template',
+           "ostype": "CentOS 5.3 (64-bit)",
+           "templatefilter": 'self',
+        },
         "security_group" : { "name": "custom_Sec_Grp" },
         "ingress_rule": {
             "protocol": "TCP",
@@ -414,5 +419,19 @@ test_data = {
             "displaytext": "vpc-tier2",
             "gateway" : "10.2.1.1",
             "netmask" : "255.255.255.192"
-        }
+        },
+        "server": {
+                "displayname": "TestVM",
+                "username": "root",
+                "password": "password",
+                "ssh_port": 22,
+                "hypervisor": 'XenServer',
+                "privateport": 22,
+                "publicport": 22,
+                "protocol": 'TCP'
+        },
+        "privateport": 22,
+        "publicport": 22,
+        "protocol": 'TCP',
+        "forvirtualnetwork": "true"
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/tools/marvin/marvin/marvinLog.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/marvinLog.py b/tools/marvin/marvin/marvinLog.py
index 075f33a..9b4dd19 100644
--- a/tools/marvin/marvin/marvinLog.py
+++ b/tools/marvin/marvin/marvinLog.py
@@ -25,6 +25,7 @@ from marvin.codes import (SUCCESS,
                           FAILED
                           )
 from marvin.cloudstackException import GetDetailExceptionInfo
+from marvin.lib.utils import random_gen
 
 
 class MarvinLog:
@@ -140,9 +141,9 @@ class MarvinLog:
             temp_ts = time.strftime("%b_%d_%Y_%H_%M_%S",
                                     time.localtime())
             if test_module_name is None:
-                temp_path = temp_ts
+                temp_path = temp_ts + "_" + random_gen()
             else:
-                temp_path = str(test_module_name) + "__" + str(temp_ts)
+                temp_path = str(test_module_name) + "__" + str(temp_ts) + "_" + random_gen()
 
             temp_dir = "MarvinLogs"
             if ((log_cfg is not None) and

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/tools/marvin/marvin/marvinPlugin.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py
index 4fee27a..1425006 100644
--- a/tools/marvin/marvin/marvinPlugin.py
+++ b/tools/marvin/marvin/marvinPlugin.py
@@ -26,6 +26,7 @@ from nose.plugins.base import Plugin
 from marvin.codes import (SUCCESS,
                           FAILED,
                           EXCEPTION)
+from marvin.lib.utils import random_gen
 from marvin.cloudstackException import GetDetailExceptionInfo
 
 
@@ -230,7 +231,8 @@ class MarvinPlugin(Plugin):
                 self.__testRunner = nose.core.\
                     TextTestRunner(stream=self.__resultStream,
                                    descriptions=True,
-                                   verbosity=2)
+                                   verbosity=2,
+                                   config=self.conf)
                 return SUCCESS
             return FAILED
         except Exception as e:
@@ -272,7 +274,13 @@ class MarvinPlugin(Plugin):
                                                test.AcctType)
 
     def finalize(self, result):
-        src = self.__logFolderPath.strip("//")
-        dst = os.path.split(src)[0] + "/" + self.__testModName
-        os.system("mv " + src + " " + dst)
-        print "===Final Results: %s===" % str(dst)
+        try:
+            src = self.__logFolderPath
+            log_cfg = self.__parsedConfig.logger
+            tmp = log_cfg.__dict__.get('LogFolderPath') + "/MarvinLogs"
+            dst = tmp + "/" + self.__testName + "_" + random_gen()
+            cmd = "mv " + src + " " + dst
+            os.system(cmd)
+            print "===Final Results: %s===" % str(dst)
+        except Exception, e:
+            print "=== Exception occurred under finalize :%s"%str(GetDetailExceptionInfo(e))

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65e8f2dc/tools/marvin/setup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py
index 1216426..9160642 100644
--- a/tools/marvin/setup.py
+++ b/tools/marvin/setup.py
@@ -6,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,33 +30,35 @@ except ImportError:
 VERSION = '0.1.0'
 
 import os
+
+
 def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read().strip()
 
 setup(name="Marvin",
-    version=VERSION,
-    description="Marvin - Python client for Apache CloudStack",
-    author="Edison Su",
-    author_email="Edison.Su@citrix.com",
-    maintainer="Prasanna Santhanam",
-    maintainer_email="tsp@apache.org",
-    long_description="Marvin is the Apache CloudStack python client written around the unittest
framework",
-    platforms=("Any",),
-    url="https://builds.apache.org/job/cloudstack-marvin/",
-    packages=["marvin", "marvin.cloudstackAPI",
-              "marvin.lib", "marvin.config","marvin.sandbox",
-              "marvin.sandbox.advanced", "marvin.sandbox.advancedsg", "marvin.sandbox.basic"],
-    license="LICENSE.txt",
-    install_requires=[
-        "mysql-connector-python",
-        "requests",
-        "paramiko",
-        "nose",
-        "ddt >= 0.4.0"
-    ],
-    py_modules=['marvin.marvinPlugin'],
-    zip_safe=False,
-    entry_points={
-        'nose.plugins': ['marvinPlugin = marvin.marvinPlugin:MarvinPlugin']
-    },
-)
+      version=VERSION,
+      description="Marvin - Python client for Apache CloudStack",
+      author="Edison Su",
+      author_email="Edison.Su@citrix.com",
+      maintainer="Prasanna Santhanam",
+      maintainer_email="tsp@apache.org",
+      long_description="Marvin is the Apache CloudStack python client written around the
unittest framework",
+      platforms=("Any",),
+      url="https://builds.apache.org/job/cloudstack-marvin/",
+      packages=["marvin", "marvin.cloudstackAPI",
+                "marvin.lib", "marvin.config", "marvin.sandbox",
+                "marvin.sandbox.advanced", "marvin.sandbox.advancedsg", "marvin.sandbox.basic"],
+      license="LICENSE.txt",
+      install_requires=[
+          "mysql-connector-python",
+          "requests",
+          "paramiko",
+          "nose",
+          "ddt >= 0.4.0"
+      ],
+      py_modules=['marvin.marvinPlugin'],
+      zip_safe=False,
+      entry_points={
+          'nose.plugins': ['marvinPlugin = marvin.marvinPlugin:MarvinPlugin']
+      },
+      )


Mime
View raw message