Changeset 2783
- Timestamp:
- 01/29/2009 12:19:17 PM (10 months ago)
- Files:
-
- gip/trunk/test/test_gip_common.py (modified) (2 diffs)
- gip/trunk/test/test_topology.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gip/trunk/test/test_gip_common.py
r2676 r2783 3 3 import os 4 4 import sys 5 import gip_sets as sets6 5 import unittest 7 6 import tempfile 8 7 import ConfigParser 9 from gip_sets import Set10 8 11 9 sys.path.append(os.path.expandvars("$GIP_LOCATION/lib/python")) 10 from gip_sets import Set 11 import gip_sets as sets 12 12 from gip_common import config, cp_getBoolean, voList 13 13 from gip_cluster import getOSGVersion, getApplications 14 14 from gip_testing import runTest, streamHandler 15 15 import gip_testing 16 import gip_osg 16 17 17 18 fermigrid_vos = sets.Set(['osg', 'cdms', 'lqcd', 'auger', 'i2u2', 'cdf', 'des', … … 63 64 os.environ['GIP_LOCATION'] = old_gip_location 64 65 66 def test_osg_check(self): 67 """ 68 Make sure that the checkOsgConfigured function operates as desired. 69 """ 70 cp = config() 71 try: 72 import tempfile 73 file = tempfile.NamedTemporaryFile() 74 filename = file.name 75 except: 76 filename = '/tmp/osg_check' 77 file = open(filename, 'w') 78 if not cp.has_section("gip"): 79 cp.add_section("gip") 80 cp.set("gip", "osg_attributes", filename) 81 try: 82 file.write('hello world!\n') 83 didFail = False 84 try: 85 gip_osg.checkOsgConfigured(cp) 86 except: 87 didFail = True 88 self.failIf(didFail, "Failed on a 'valid' osg-attributes.conf") 89 os.unlink(filename) 90 didFail = False 91 try: 92 gip_osg.checkOsgConfigured(cp) 93 except: 94 didFail = True 95 self.failUnless(didFail, "Did not fail on missing file.") 96 finally: 97 pass 65 98 def test_voList(self): 66 99 """ gip/trunk/test/test_topology.py
r2135 r2783 12 12 13 13 def setUp(self): 14 self.cp = config("test/test_configs/red.conf") 14 filename = 'test/test_configs/red.conf' 15 if not os.path.exists(filename): 16 filename = 'test_configs/red.conf' 17 self.filename = filename 18 self.cp = config(filename) 15 19 16 20 def setUpLDAP(self, multi=False): 17 command = "$GIP_LOCATION/providers/site_topology.py" 21 command = "$GIP_LOCATION/providers/site_topology.py --config=%s" % \ 22 self.filename 18 23 stdout = os.popen(command) 19 24 entries = read_ldap(stdout, multi=multi) … … 21 26 22 27 def test_exitcode(self): 23 command = "$GIP_LOCATION/providers/site_topology.py" 28 command = "$GIP_LOCATION/providers/site_topology.py --config=%s" % \ 29 self.filename 24 30 stdout = os.popen(command) 25 31 stdout.read()
