Ejemplo n.º 1
0
    def __init__(self, tests, apis=None):
        """ Constructor

    examples:
      >>> tests = { 'WMS-Test' : { 'module' : 'WMSTest',
                                                           'args' : { 'executable' : [ '/usr/bin/python',
                                                                           'wms_test.py' ], 'timeout' : 1800 } } }
      >>> elements = { 'ComputingElement' : [ 'chenj01.ihep.ac.cn' ],
                                       'StorageElement', [ 'IHEPD-USER' ],
                                       'CLOUD' : [ 'CLOUD.IHEP-OPENSTACK.cn' ] }
      >>> executor = TestExecutor( tests, elements )
      >>> executor1 = TestExecutor( tests, elements, { 'ResourceManagementClient' :
                                                                                                     ResourceManagementClient() } )

    :Parameters:
      **tests** - `dict`
        dictionary with tests to be executed. The test class is loaded according to the
        'module' key and instantiated with 'args' key.
      **elements** - `dict`
        the elements need to be tested. The elements is grouped by type.
      **apis** - 'dict'
        dictionary with clients to be used in the commands issued by the policies.
        If not defined, the commands will import them.
    """

        self.apis = apis or {}
        self.__tests = tests
        self.log = gLogger.getSubLogger('TestExecutor')

        if 'ResourceManagementIHEPClient' in self.apis:
            self.rmClient = self.apis['ResourceManagementIHEPClient']
        else:
            self.rmClient = ResourceManagementIHEPClient()
Ejemplo n.º 2
0
    def initialize(self):
        """
      specify the tests which need to be executed.
    """

        self.apis['DataManager'] = DataManager()
        self.apis[
            'ResourceManagementIHEPClient'] = ResourceManagementIHEPClient()

        return S_OK()
Ejemplo n.º 3
0
    def __init__(self, args=None, clients=None):
        super(WorkNodeIHEPCommand, self).__init__(args, clients)

        if 'JobDB' in self.apis:
            self.jobDB = self.apis['JobDB']
        else:
            self.jobDB = JobDB()

        if 'ResourceManagementIHEPClient' in self.apis:
            self.rmIHEPClient = self.apis['ResourceManagementIHEPClient']
        else:
            self.rmIHEPClient = ResourceManagementIHEPClient()
Ejemplo n.º 4
0
    def __init__(self, args=None, clients=None):
        super(StorageIHEPCommand, self).__init__(args, clients)

        if 'ResourceManagementIHEPClient' in self.apis:
            self.rmIHEPClient = self.apis['ResourceManagementIHEPClient']
        else:
            self.rmIHEPClient = ResourceManagementIHEPClient()

        if 'FileCatalogDB' in self.apis:
            self.fcDB = self.apis['FileCatalogDB']
        else:
            self.fcDB = FileCatalogDB()
Ejemplo n.º 5
0
def initializePublisherIHEPHandler(_serviceInfo):
    """
  Handler initialization in the usual horrible way.
  """

    global rsClient
    rsClient = ResourceStatusClient()

    global rmClient
    rmClient = ResourceManagementIHEPClient()

    return S_OK()
Ejemplo n.º 6
0
    def __init__(self, args=None, clients=None):

        super(JobIHEPCommand, self).__init__(args, clients)

        if 'WMSAdministrator' in self.apis:
            self.wmsAdmin = self.apis['WMSAdministrator']
        else:
            self.wmsAdmin = RPCClient('WorkloadManagement/WMSAdministrator')

        if 'ResourceManagementIHEPClient' in self.apis:
            self.rmIHEPClient = self.apis['ResourceManagementIHEPClient']
        else:
            self.rmIHEPClient = ResourceManagementIHEPClient()
Ejemplo n.º 7
0
    def __init__(self, apis):
        """ Constructor

    examples:
      >>> sites = { 'CLUSTER' : [ 'CLUSTER.USTC.cn' ],
                              'GRID' : [ 'GRID.JINR.ru' ],
                              'CLOUD' : [ ''CLOUD.IHEP-OPENSTACK.cn' ] }
      >>> evaluator = StatusEvaluator( sites )

    :Parameters:
       **sites** - `dict`
         the sites to evaluate SAM status. The sites is grouped by domain.
    """

        if "ResourceManagementIHEPClient" in apis:
            self.rmClient = apis["ResourceManagementIHEPClient"]
        else:
            self.rmClient = ResourceManagementIHEPClient()