Ejemplo n.º 1
0
 def testLoadingFiles(self):
     """
     Initialize a RucioInjectorPoller object and load uninjected files
     """
     self.stuffDatabase()
     poller = RucioInjectorPoller(self.createConfig())
     poller.setup(parameters=None)
     uninjectedFiles = poller.getUninjected.execute()
     self.assertItemsEqual(list(uninjectedFiles), self.locations)
     self.assertEquals(list(uninjectedFiles["T2_CH_CERN"]), [self.testDatasetA])
     self.assertEquals(list(uninjectedFiles["T1_US_FNAL_Disk"]), [self.testDatasetB])
Ejemplo n.º 2
0
    def preInitialization(self):
        pollInterval = self.config.RucioInjector.pollInterval
        logging.info("Setting poll interval to %s seconds for inject",
                     pollInterval)

        myThread = threading.currentThread()
        myThread.workerThreadManager.addWorker(
            RucioInjectorPoller(self.config), pollInterval)
Ejemplo n.º 3
0
    def testBadConfig(self):
        """
        Test wrong component configuration
        """
        config = self.createConfig()
        config.RucioInjector.metaDIDProject = "Very invalid project name"

        with self.assertRaises(RucioInjectorException):
            RucioInjectorPoller(config)
Ejemplo n.º 4
0
    def testActivityMap(self):
        """
        Initialize a RucioInjectorPoller object and test `_activityMap` method
        """
        poller = RucioInjectorPoller(self.createConfig())
        # test production agent and non-Tape endpoint
        activity = poller._activityMap("T1_US_FNAL_Disk")
        self.assertEquals(activity, "Production Output")
        activity = poller._activityMap("T1_US_FNAL_Test")
        self.assertEquals(activity, "Production Output")
        # test production agent and Tape endpoint (which is forbidden at the moment)
        with self.assertRaises(WMRucioException):
            poller._activityMap("T1_US_FNAL_Tape")

        # now pretend it to be a T0 agent/component
        poller.isT0agent = True
        # test T0 agent and non-Tape endpoint
        activity = poller._activityMap("T1_US_FNAL_Disk")
        self.assertEquals(activity, "T0 Export")
        activity = poller._activityMap("T1_US_FNAL_Test")
        self.assertEquals(activity, "T0 Export")
        # test T0 agent and Tape endpoint
        activity = poller._activityMap("T1_US_FNAL_Tape")
        self.assertEquals(activity, "T0 Tape")