def setUp(self):
     """ test set up """
     self.req = Request()
     self.req.RequestName = "testRequest"
     self.op = Operation({"Type": "ForwardDISET", "Arguments": "foobar"})
     self.req.addOperation(self.op)
     self.baseOp = OperationHandlerBase()
class OperationHandlerBaseTests( unittest.TestCase ):
  """
  .. class:: OperationHandlerBaseTests

  """

  def setUp( self ):
    """ test set up """
    self.req = Request()
    self.req.RequestName = "testRequest"
    self.op = Operation( {"Type" : "ForwardDISET", "Arguments" : "foobar" } )
    self.req.addOperation( self.op )
    self.baseOp = OperationHandlerBase()

  def tearDown( self ):
    """ test tear down """
    del self.baseOp
    del self.op
    del self.req

  def testOperationHandlerBase( self ):
    """ base op test """
    self.baseOp.setOperation( self.op )

    # # log is there
    self.assertEqual( "log" in dir( self.baseOp ), True, "log missing" )
    # # operation is there
    self.assertEqual( "operation" in dir( self.baseOp ), True, "operation is missing" )
    # # request is there
    self.assertEqual( "request" in dir( self.baseOp ), True, "request is missing" )
    # # __call__ not implemented
    self.assertRaises( NotImplementedError, self.baseOp )
    # # replica manager
    self.assertEqual( isinstance( self.baseOp.dm, DataManager ), True, "DataManager is missing" )
Esempio n. 3
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: cs config path
    """
        OperationHandlerBase.__init__(self, operation, csPath)
        # # gMonitor stuff
        gMonitor.registerActivity("PhysicalRemovalAtt",
                                  "Physical file removals attempted",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("PhysicalRemovalOK",
                                  "Successful file physical removals",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("PhysicalRemovalFail",
                                  "Failed file physical removals",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("PhysicalRemovalSize",
                                  "Physically removed size",
                                  "RequestExecutingAgent", "Bytes",
                                  gMonitor.OP_ACUM)
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: CS path for this handler
    """
    OperationHandlerBase.__init__( self, operation, csPath )
    # # own gMonitor stuff for files
    gMonitor.registerActivity( "ReplicateAndRegisterAtt", "Replicate and register attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "ReplicateOK", "Replications successful",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "ReplicateFail", "Replications failed",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterOK", "Registrations successful",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterFail", "Registrations failed",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    # # for FTS
    gMonitor.registerActivity( "FTSScheduleAtt", "Files schedule attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "FTSScheduleOK", "File schedule successful",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "FTSScheduleFail", "File schedule failed",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    # # SE cache
    self.seCache = {}
Esempio n. 5
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: CS path for this handler
    """
        # # base class ctor
        OperationHandlerBase.__init__(self, operation, csPath)
        # # gMonitor stuff
        gMonitor.registerActivity("PutAtt", "File put attempts",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("PutFail", "Failed file puts",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("PutOK", "Successful file puts",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RegisterOK",
                                  "Successful file registrations",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RegisterFail", "Failed file registrations",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
Esempio n. 6
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

        :param self: self reference
        :param Operation operation: Operation instance
        :param str csPath: CS path for this handler
        """
        OperationHandlerBase.__init__(self, operation, csPath)
Esempio n. 7
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: CS path for this handler
    """
    OperationHandlerBase.__init__( self, operation, csPath )
Esempio n. 8
0
  def __init__( self, operation = None, csPath = None ):
    """ c'tor

    :param Operation operation: an Operation instance
    :param str csPath: CS path for this handler
    """
    # # call base class c'tor
    OperationHandlerBase.__init__( self, operation, csPath )
Esempio n. 9
0
    def __init__(self, operation=None, csPath=None):
        """Initialize the ArchifeFiles handler.

        :param self: self reference
        :param Operation operation: Operation instance
        :param string csPath: CS path for this handler
        """
        OperationHandlerBase.__init__(self, operation, csPath)
        self.waitingFiles = []
Esempio n. 10
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    """
    OperationHandlerBase.__init__( self, operation, csPath )
    # # RegisterFile specific monitor info
    gMonitor.registerActivity( "RegisterAtt", "Attempted file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterOK", "Successful file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterFail", "Failed file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
Esempio n. 11
0
    def __init__(self, operation=None, csPath=None):
        """Initialize the ArchifeFiles handler.

        :param self: self reference
        :param Operation operation: Operation instance
        :param string csPath: CS path for this handler
        """
        OperationHandlerBase.__init__(self, operation, csPath)
        self.cacheFolder = os.environ.get("AGENT_WORKDIRECTORY")
        self.parameterDict = {}
        self.waitingFiles = []
        self.lfns = []
Esempio n. 12
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: CS path for this handler
    """
    OperationHandlerBase.__init__( self, operation, csPath )
    # # RegisterFile specific monitor info
    gMonitor.registerActivity( "RegisterAtt", "Attempted file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterOK", "Successful file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterFail", "Failed file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
 def setUp( self ):
   """ test set up """
   self.req = Request()
   self.req.RequestName = "testRequest"
   self.op = Operation( {"Type" : "ForwardDISET", "Arguments" : "foobar" } )
   self.req.addOperation( self.op )
   self.baseOp = OperationHandlerBase()
Esempio n. 14
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: operation to execute
    :param str csPath: CS path for this handler
    """
    # # base class ctor
    OperationHandlerBase.__init__( self, operation, csPath )
    # # gMonitor stuff
    gMonitor.registerActivity( "RemoveReplicaAtt", "Replica removals attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RemoveReplicaeOK", "Successful replica removals",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RemoveReplicaFail", "Failed replica removals",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
Esempio n. 15
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: operation to execute
    :param str csPath: CS path for this handler
    """
    # # base class ctor
    OperationHandlerBase.__init__( self, operation, csPath )
    # # gMonitor stuff
    gMonitor.registerActivity( "FileReTransferAtt", "File retransfers attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "FileReTransferOK", "File retransfers successful",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "FileReTransferFail", "File retransfers failed",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
Esempio n. 16
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    """
        OperationHandlerBase.__init__(self, operation, csPath)
        # # RegisterFile specific monitor info
        gMonitor.registerActivity("RegisterAtt",
                                  "Attempted file registrations",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RegisterOK",
                                  "Successful file registrations",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RegisterFail", "Failed file registrations",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
Esempio n. 17
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param string csPath: CS path for this handler
    """
    # # base class ctor
    OperationHandlerBase.__init__( self, operation, csPath )
    # # gMonitor stuff
    gMonitor.registerActivity( "LogUploadAtt", "Log upload attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "LogUploadOK", "Replications successful",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "LogUploadFail", "Replications failed",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    self.workDirectory = os.environ.get( 'LOGUPLOAD_CACHE', os.environ.get( 'AGENT_WORKDIRECTORY', '/tmp/LogUpload' ) )
Esempio n. 18
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: cs config path
    """
    OperationHandlerBase.__init__( self, operation, csPath )
    # # gMonitor stuff
    gMonitor.registerActivity( "PhysicalRemovalAtt", "Physical file removals attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "PhysicalRemovalOK", "Successful file physical removals",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "PhysicalRemovalFail", "Failed file physical removals",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "PhysicalRemovalSize", "Physically removed size",
                               "RequestExecutingAgent", "Bytes", gMonitor.OP_ACUM )
Esempio n. 19
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation to execute
    :param str csPath: CS path for this handler
    """
    # # call base class ctor
    OperationHandlerBase.__init__( self, operation, csPath )
    # # gMOnitor stuff goes here
    gMonitor.registerActivity( "RemoveFileAtt", "File removals attempted",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RemoveFileOK", "Successful file removals",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RemoveFileFail", "Failed file removals",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    # # re pattern for not existing files
    self.reNotExisting = re.compile( "(no|not) such file or directory", re.IGNORECASE )
Esempio n. 20
0
  def __init__(self, operation=None, csPath=None):
    """Initialize the ArchifeFiles handler.

    :param self: self reference
    :param Operation operation: Operation instance
    :param string csPath: CS path for this handler
    """
    OperationHandlerBase.__init__(self, operation, csPath)
    gMonitor.registerActivity('ArchiveFilesAtt', 'Request attempt',
                              'RequestExecutingAgent', 'Files/min', gMonitor.OP_SUM)
    gMonitor.registerActivity('ArchiveFilesOK', 'Requests successful',
                              'RequestExecutingAgent', 'Files/min', gMonitor.OP_SUM)
    gMonitor.registerActivity('ArchiveFilesFail', 'Requests failed',
                              'RequestExecutingAgent', 'Files/min', gMonitor.OP_SUM)
    self.cacheFolder = os.environ.get('AGENT_WORKDIRECTORY')
    self.parameterDict = {}
    self.waitingFiles = []
    self.lfns = []
Esempio n. 21
0
  def __init__( self, operation = None, csPath = None ):
    """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: CS path for this handler
    """
    # # base class ctor
    OperationHandlerBase.__init__( self, operation, csPath )
    # # gMonitor stuff
    gMonitor.registerActivity( "PutAtt", "File put attempts",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "PutFail", "Failed file puts",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "PutOK", "Successful file puts",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterOK", "Successful file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
    gMonitor.registerActivity( "RegisterFail", "Failed file registrations",
                               "RequestExecutingAgent", "Files/min", gMonitor.OP_SUM )
Esempio n. 22
0
class OperationHandlerBaseTests(unittest.TestCase):
    """
  .. class:: OperationHandlerBaseTests

  """
    def setUp(self):
        """ test set up """
        self.req = Request()
        self.req.RequestName = "testRequest"
        self.op = Operation({"Type": "ForwardDISET", "Arguments": "foobar"})
        self.req.addOperation(self.op)
        self.baseOp = OperationHandlerBase()

    def tearDown(self):
        """ test tear down """
        del self.baseOp
        del self.op
        del self.req

    def testOperationHandlerBase(self):
        """ base op test """
        self.baseOp.setOperation(self.op)

        # # log is there
        self.assertEqual("log" in dir(self.baseOp), True, "log missing")
        # # operation is there
        self.assertEqual("operation" in dir(self.baseOp), True,
                         "operation is missing")
        # # request is there
        self.assertEqual("request" in dir(self.baseOp), True,
                         "request is missing")
        # # __call__ not implemented
        self.assertRaises(NotImplementedError, self.baseOp)
        # # replica manager
        self.assertEqual(
            isinstance(self.baseOp.replicaManager(), ReplicaManager), True,
            "ReplicaManger is missing")
        # # DataLoggingClient
        self.assertEqual(
            isinstance(self.baseOp.dataLoggingClient(), DataLoggingClient),
            True, "DataLoggingClient is missing")
Esempio n. 23
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param string csPath: CS path for this handler
    """
        # # base class ctor
        OperationHandlerBase.__init__(self, operation, csPath)
        # # gMonitor stuff
        gMonitor.registerActivity("LogUploadAtt", "Log upload attempted",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("LogUploadOK", "Replications successful",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("LogUploadFail", "Replications failed",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        self.workDirectory = os.environ.get(
            'LOGUPLOAD_CACHE',
            os.environ.get('AGENT_WORKDIRECTORY', '/tmp/LogUpload'))
Esempio n. 24
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    :param self: self reference
    :param Operation operation: operation to execute
    :param str csPath: CS path for this handler
    """
        # # base class ctor
        OperationHandlerBase.__init__(self, operation, csPath)
        # # gMonitor stuff
        gMonitor.registerActivity("RemoveReplicaAtt",
                                  "Replica removals attempted",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RemoveReplicaeOK",
                                  "Successful replica removals",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RemoveReplicaFail",
                                  "Failed replica removals",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
Esempio n. 25
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    :param self: self reference
    :param Operation operation: operation to execute
    :param str csPath: CS path for this handler
    """
        # # base class ctor
        OperationHandlerBase.__init__(self, operation, csPath)
        # # gMonitor stuff
        gMonitor.registerActivity("FileReTransferAtt",
                                  "File retransfers attempted",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("FileReTransferOK",
                                  "File retransfers successful",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("FileReTransferFail",
                                  "File retransfers failed",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
Esempio n. 26
0
    def __init__(self, operation=None, csPath=None):
        """c'tor

    :param self: self reference
    :param Operation operation: Operation instance
    :param str csPath: CS path for this handler
    """
        OperationHandlerBase.__init__(self, operation, csPath)
        # # own gMonitor stuff for files
        gMonitor.registerActivity("ReplicateAndRegisterAtt",
                                  "Replicate and register attempted",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("ReplicateOK", "Replications successful",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("ReplicateFail", "Replications failed",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RegisterOK", "Registrations successful",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("RegisterFail", "Registrations failed",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        # # for FTS
        gMonitor.registerActivity("FTSScheduleAtt", "Files schedule attempted",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("FTSScheduleOK", "File schedule successful",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        gMonitor.registerActivity("FTSScheduleFail", "File schedule failed",
                                  "RequestExecutingAgent", "Files/min",
                                  gMonitor.OP_SUM)
        # # SE cache
        self.seCache = {}
Esempio n. 27
0
 def __init__( self, operation = None, csPath = None ):
   OperationHandlerBase.__init__( self, operation, csPath )
   self.registrationProtocols = DMSHelpers().getRegistrationProtocols()
 def __init__( self, operation = None, csPath = None ):
   OperationHandlerBase.__init__( self, operation, csPath )
Esempio n. 29
0
 def __init__(self, operation=None, csPath=None):
     OperationHandlerBase.__init__(self, operation, csPath)
     self.registrationProtocols = DMSHelpers().getRegistrationProtocols()
Esempio n. 30
0
 def __init__(self, operation=None, csPath=None):
     OperationHandlerBase.__init__(self, operation, csPath)