def __init__(self, testContext): """ @param testContext: Komodo test context dictionary @type testContext: C{dict} """ self.log = getLogger(LOGGER_PREFIX) self.testContext = testContext
def getInstance(name, verbose_log=True): """ Retrieves the C{L{RockSpringsEnvironment}} object for a given environment input name. This is done by GETting information from the Latitude Build (GO) interface and the Panda Environment Info web service. @param name: Name of the environment without underscores (e.g. isosys5a or sys4x) @type name: C{str} @return: C{RockSpringsEnvironment} object @rtype: C{L{RockSpringsEnvironment}} @raises EnvironmentRetrievalError: Unable to retrieve the environment information """ logger = getLogger(LOGGER_PREFIX) if not verbose_log: logger.setLevel(logging.ERROR) logger.info(__version__) logger.info("Attempting to retrieve environment information for '%s'" % name) # No underscores, so just remove them clean_name = name.replace("_","") # Retrieve the about page information from Panda logger.debug("Attempting to call Panda with %s on environment %s" % (PANDA_ENV_ROOT_URL, clean_name)) envDict = getJSONResponse(PANDA_ENV_ROOT_URL, params={'envname': clean_name}) # Return the environment object from the dictionary of parameters return RockSpringsEnvironment(envDict, verbose_log=verbose_log)
def __init__(self, tc, user): """ Initialize the clock advance object """ self.log = getLogger(LOGGER_PREFIX) self.tc = tc self.env = self.tc['env'] self.user = user self.currentTime = 'current' self.timeOfDayFormat = "%H:%M" self.log.debug("Initializing ClockAdvance object with testContext: %s, user: %s" % (self.tc, self.user)) self.log.info("Initialization of the ClockAdvance object is complete")
G{packagetree} """ from komodo import __version__ from komodo import environment import perseus.testharness as testharness import perseus.availability import perseus.log as _plog # Remember the minor numbers must be two characters __VERSION = __version__.__version__.split('.') __VERSIONSTR = __version__.__version__ __doc__ = __doc__ % __VERSIONSTR ## modifies the module epydoc to contain version logger = _plog.getLogger('Komodo') logger.info('** Komodo System Evaluation Automation Test Library Version %s **' % __VERSIONSTR) # Available browsers for web testing BROWSER_IE = "InternetExplorer" BROWSER_FIREFOX = "FireFox" BROWSER_HTMLUNIT = "HtmlUnit" BROWSER_DEFAULT = BROWSER_FIREFOX # Show or hide browser during web naviagation BROWSER_DISPLAY_ON = True BROWSER_DISPLAY_OFF = False BROWSER_DISPLAY_DEFAULT = BROWSER_DISPLAY_ON #----------------------------------------------------------------------
# All rights reserved. # # $Archive: CRM:eid=387638:/APM/System/dvt/Tools/komodo/src/komodo/enrollment/hessianProxyWrapper.py $ # $Revision: 14007/1 $ # $Author: Jatin Kapoor; kapoorj $ # $Modtime: 2013-04-26T02:08:46-0500 $ # ============================================================================= __version__ = "$Revision: 14007/1 $" import time from komodo import config from komodo.external.mustaine.client import HessianProxy import perseus.log as _plog conf = config.KomodoConfig() logger = _plog.getLogger('Komodo Enrollment') # http://latmaven.stp.guidant.com/view/?r=snapshots&g=com.bsci.cdt.clinic&a=ClinicTest&v=LATEST&c=site&f=/apidocs/index.html class BaseHessianProxy(object): def __init__(self, hessianProxyUrl, timeout = 60): self.hessianProxy = HessianProxy(hessianProxyUrl, timeout = timeout) def wrapper(self, func): def hessianMethod(*args, **kwargs): start = time.clock() response = func(*args, **kwargs) stop = time.clock() duration = stop-start if duration > 3:
def __init__(self, env): ''' Initialize the Finished Goods message class ''' self._env = env self._logger = getLogger(LOGGER_PREFIX)
""" Komodo Test Automation Library Clock Advance Module This module provides a helper class with the ability to advance system clock. The Panda clock advance web service is used to facilitate this functionality. """ import os, datetime, re from perseus.log import getLogger import komodo.environment from komodo import config LOGGER_PREFIX = "Komodo ClockAdvance" logger = getLogger(LOGGER_PREFIX) conf = config.KomodoConfig() # Time Parameters MAX_ADVANCE_DAYS = conf.getProperty('ENVIRONMENT', 'max_days') def getInstance(testContext, totalNumberOfDaysNeeded): """ Retrieves the C{L{Clock Advance}} object for a given environment. If the totalNumberOfDaysNeeded exceeds the amount of time left on the server, the refresh/redeploy mechanism will be triggered. @param testContext: Komodo testContext dictionary @type testContext: C{dict} @param totalNumberOfDaysNeeded: total # of days needed for test execution, must be greater than zero
def __init__(self, envDict, verbose_log=True): """ @param envDict: Dictionary of the environment parameters @type envDict: C{dict} """ self._inputDict = envDict self._log = getLogger(LOGGER_PREFIX) if not verbose_log: logger.setLevel(logging.ERROR) self.name = envDict['Name'] self._serviceParams = {'envname': envDict['Name']} self._log.info("Successfully retrieved system name: '%s'" % self.name) # Create Application Server information self.app = self.App(poc_server_name=envDict['POC']['Server'], ds_server_name=envDict['COMPOC']['Server']) self._log.info("Successfully retrieved POC server name: '%s'" % self.app.poc_server_name) self._log.info("Successfully retrieved DS server name: '%s'" % self.app.ds_server_name) # Create Build information self.build = self.Build(version=envDict['Build']) self._log.info("Successfully retrieved build version: '%s'" % self.build.version) # Create Database information # TODO: DS DB Port self.db = self.DB(name=envDict['DB']['Sid'], user=envDict['DB']['User'], pwd=envDict['DB']['Password'], hostname=envDict['DB']['Host'], port="1521") self._log.info("Successfully retrieved database name: '%s'" % self.db.name) self._log.info("Successfully retrieved database user: '******'" % self.db.user) self._log.info("Successfully retrieved database password: '******'" % self.db.pwd) self._log.info("Successfully retrieved database hostname: '%s'" % self.db.hostname) self._log.info("Successfully retrieved database port: '%s'" % self.db.port) # Create POC Database information # TODO: POC DB Port # TODO: POC Username # TODO: POC Password self.pocdb = self.DB(name=envDict['DB']['Sid'], user='******', pwd='guidant3', hostname=envDict['DB']['Host'], port='1521') self._log.info("Successfully retrieved POC database name: '%s'" % self.pocdb.name) self._log.info("Successfully retrieved POC database user: '******'" % self.pocdb.user) self._log.info("Successfully retrieved POC database password: '******'" % self.pocdb.pwd) self._log.info("Successfully retrieved POC database hostname: '%s'" % self.pocdb.hostname) self._log.info("Successfully retrieved POC database port: '%s'" % self.pocdb.port) # Set the database information for perseus, otherwise test scripts will have to do this explicitly setProperty(str(self.db.user), "userName", section='DATABASE') setProperty(str(self.db.pwd), "password", section='DATABASE') setProperty(str(self.db.dsn), "dataBase", section='DATABASE') # Create URL information self.url = self.URL(comm_poc_url=envDict['COMPOC']['CtlUrl']+'/upload', poc_url=envDict['POC']['Url'], poc_about=envDict['POC']['Url']+'/about.jsp', ops_url=envDict['POC']['Url']+'/lwr/p/test/ops', ds_url=envDict['POC']['Url']+'/device', login=envDict['POC']['Url']+'/lwr/p/login') self._log.info("Successfully retrieved POC communicator URL: '%s'" % self.url.poc_comm) self._log.info("Successfully retrieved POC URL: '%s'" % self.url.poc) self._log.info("Successfully retrieved POC about URL: '%s'" % self.url.poc_about) self._log.info("Successfully retrieved Operations URL: '%s'" % self.url.ops) self._log.info("Successfully retrieved device service URL: '%s'" % self.url.ds) self._log.info("Successfully retrieved application login URL: '%s'" % self.url.login) # Environment deployed Geography and countries self.geography = envDict['Region'] self._log.info("Successfully retrieved geography: '%s'" % self.geography) # PLE self.ple = envDict['ProductLineModelVersion'] self._log.info("Successfully retrieved PLM Version: '%s'" % self.ple)