コード例 #1
0
    def setUp(self):
        glideinwms.frontend.glideinFrontendLib.logSupport.log = FakeLogger()
        # Only condor cliens are mocked, not the python bindings
        condorMonitor.USE_HTCONDOR_PYTHON_BINDINGS = False
        with mock.patch('glideinwms.lib.condorExe.exe_cmd') as m_exe_cmd:
            f = open('cs.fixture')
            m_exe_cmd.return_value = f.readlines()
            self.status_dict = glideinFrontendLib.getCondorStatus(['coll1'])

        self.frontend_name = 'fe_name'
        self.group_name = 'group_name'
        self.request_name = 'request_name'
        self.cred_id = 1234
        self.default_format = [('JobStatus', 'i'), ('EnteredCurrentStatus', 'i'),
                               ('ServerTime', 'i'), ('RemoteHost', 's')]

        self.prepare_condorq_dict()

        self.glidein_dict_k1 = (
            'submit.local',
            'Site_Name1@v3_0@factory1',
            'frontend@factory1')
        self.glidein_dict_k2 = (
            'submit.local',
            'Site_Name2@v3_0@factory1',
            'frontend@factory1')
        self.glidein_dict_k3 = (
            'submit.local',
            'Site_Name3@v3_0@factory1',
            'frontend@factory1')
        self.glidein_dict = {self.glidein_dict_k1: {'attrs': {'GLIDEIN_Site': 'Site_Name1', 'GLIDEIN_CPUS': 1}, 'monitor': {}, 'params': {}},
                             self.glidein_dict_k2: {'attrs': {'GLIDEIN_Site': 'Site_Name2', 'GLIDEIN_CPUS': 4}, 'monitor': {}, 'params': {}},
                             self.glidein_dict_k3: {'attrs': {'GLIDEIN_Site': 'Site_Name3', 'GLIDEIN_CPUS': 'aUtO'}, 'monitor': {}, 'params': {}}
                             }
コード例 #2
0
    def setUp(self):
        glideinwms.frontend.glideinFrontendLib.logSupport.log = FakeLogger()
        # Only condor cliens are mocked, not the python bindings
        condorMonitor.USE_HTCONDOR_PYTHON_BINDINGS = False
        with mock.patch('glideinwms.lib.condorExe.exe_cmd') as m_exe_cmd:
            f = open('cs.fixture')
            m_exe_cmd.return_value = f.readlines()
            self.status_dict = glideinFrontendLib.getCondorStatus(['coll1'])

        self.frontend_name = 'fe_name'
        self.group_name = 'group_name'
        self.request_name = 'request_name'
        self.cred_id = 1234
        self.default_format = [('JobStatus', 'i'), ('EnteredCurrentStatus', 'i'),
                               ('ServerTime', 'i'), ('RemoteHost', 's')]

        self.prepare_condorq_dict()

        self.glidein_dict_k1 = (
            'submit.local',
            'Site_Name1@v3_0@factory1',
            'frontend@factory1')
        self.glidein_dict_k2 = (
            'submit.local',
            'Site_Name2@v3_0@factory1',
            'frontend@factory1')
        self.glidein_dict_k3 = (
            'submit.local',
            'Site_Name3@v3_0@factory1',
            'frontend@factory1')
        self.glidein_dict = {self.glidein_dict_k1: {'attrs': {'GLIDEIN_Site': 'Site_Name1', 'GLIDEIN_CPUS': 1}, 'monitor': {}, 'params': {}},
                             self.glidein_dict_k2: {'attrs': {'GLIDEIN_Site': 'Site_Name2', 'GLIDEIN_CPUS': 4}, 'monitor': {}, 'params': {}},
                             self.glidein_dict_k3: {'attrs': {'GLIDEIN_Site': 'Site_Name3', 'GLIDEIN_CPUS': 'aUtO'}, 'monitor': {}, 'params': {}}
                             }
コード例 #3
0
ファイル: test_frontend.py プロジェクト: efajardo/glideinWMS
    def test_getCondorStatus(self):
        with mock.patch('glideinwms.lib.condorExe.exe_cmd') as m_exe_cmd:
            f = open('cs.fixture')
            m_exe_cmd.return_value = f.readlines()
            condorStatus = glideinFrontendLib.getCondorStatus(['coll1'],
                                                              format_list=[('State', 's'), ('Activity', 's')],
                                                              want_format_completion=True)

        machines = condorStatus['coll1'].stored_data.keys()
        self.assertItemsEqual(machines, ['*****@*****.**', '*****@*****.**',
                                         '*****@*****.**', '*****@*****.**',
                                         '*****@*****.**', '*****@*****.**'])
コード例 #4
0
    def test_getCondorStatus(self):
        with mock.patch('glideinwms.lib.condorExe.exe_cmd') as m_exe_cmd:
            f = open('cs.fixture')
            m_exe_cmd.return_value = f.readlines()
            condorStatus = glideinFrontendLib.getCondorStatus(['coll1'],
                                                              format_list=[
                                                                  ('State', 's'), ('Activity', 's')],
                                                              want_format_completion=True)

        machines = condorStatus['coll1'].stored_data.keys()
        self.assertItemsEqual(machines, ['*****@*****.**', '*****@*****.**',
                                         '*****@*****.**', '*****@*****.**',
                                         '*****@*****.**', '*****@*****.**'])
コード例 #5
0
        pipe_ids['jobs']={'r':r,'pid':pid} 

    ## resource
    r,w=os.pipe()
    pid=os.fork()
    if pid==0:
        # this is the child... return output as a pickled object via the pipe
        os.close(r)
        try:
            status_format_list=[]
            if x509_proxy_plugin is not None:
                status_format_list=list(status_format_list)+list(x509_proxy_plugin.get_required_classad_attributes())

            # use the main collector... all adds must go there
            status_dict=glideinFrontendLib.getCondorStatus([None],
                                                           'GLIDECLIENT_Name=?="%s.%s"'%(frontend_name,group_name),
                                                           status_format_list)

            os.write(w,cPickle.dumps(status_dict))

        except Exception, ex:
            tb = traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],
                                            sys.exc_info()[2])
            logSupport.log.debug("Error in talking to the user pool (condor_status): %s" % tb)

        os.close(w)
        # hard kill myself... don't want any cleanup, since i was created just for this calculation
        os.kill(os.getpid(),signal.SIGKILL) 

    else:
        # this is the original