Changeset 2784

Show
Ignore:
Timestamp:
01/29/2009 01:09:36 PM (10 months ago)
Author:
brian
Message:

Fix for ticket #25 plus test case.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gip/trunk/gip/lib/python/gip/providers/pbs.py

    r2688 r2784  
    7272        if 'max_queuable' in info: 
    7373            info['max_total'] = info['max_queuable'] 
     74            info['free_slots'] = min(info['free_slots'], info['max_queuable']) 
    7475        else: 
    7576            info['max_total'] = info['max_waiting'] + info['max_running'] 
  • gip/trunk/test/command_output/qstat_Q_f

    r2688 r2784  
    161161    queue_type = Execution 
    162162    Priority = 135 
    163     max_queueable = 2000 
     163    max_queueable = 183 
    164164    total_jobs = 0 
    165165    state_count = Transit:0 Queued:0 Held:0 Waiting:0 Running:0 Exiting:0 Begun 
  • gip/trunk/test/pbs_test.py

    r2705 r2784  
    137137                    entry.glue['CEUniqueID'] == 'red.unl.edu:2119/jobmanager' \ 
    138138                    '-pbs-lcgadmin': 
    139                 print entry 
    140                 self.failUnless(entry.glue['CEPolicyMaxWaitingJobs'] == '2000') 
     139                self.failUnless(entry.glue['CEPolicyMaxWaitingJobs'] == '183') 
    141140                has_lcgadmin_ce = True 
    142141        self.failUnless(has_default_ce, msg="Default queue's CE was not found!") 
    143142        self.failUnless(has_default_ce, msg="lcgadmin queue's CE was not found!") 
     143 
     144    def test_max_queuable_26(self): 
     145        """ 
     146        Regression test for max_queuable.  Ensure that the number of free slots 
     147        reported is never greater than the # of max queuable 
     148        """ 
     149        os.environ['GIP_TESTING'] = '1' 
     150        path = os.path.expandvars("$GIP_LOCATION/libexec/" \ 
     151            "osg-info-provider-pbs.py --config=test_configs/red.conf") 
     152        fd = os.popen(path) 
     153        entries = read_ldap(fd) 
     154        self.failUnless(fd.close() == None) 
     155        has_lcgadmin_ce = False 
     156        for entry in entries: 
     157            if 'GlueCE' in entry.objectClass and \ 
     158                    entry.glue['CEUniqueID'] == 'red.unl.edu:2119/jobmanager' \ 
     159                    '-pbs-lcgadmin': 
     160                self.failUnless(entry.glue['CEPolicyMaxWaitingJobs'] == '183') 
     161                self.failUnless(entry.glue['CEStateFreeCPUs'] == '183') 
     162                self.failUnless(entry.glue['CEStateFreeJobSlots'] == '183') 
     163                has_lcgadmin_ce = True 
     164        self.failUnless(has_lcgadmin_ce, msg="lcgadmin queue's CE was not found!") 
     165 
    144166 
    145167    def make_site_tester(site):