Coverage for tests / test_condorConfig.py: 21%
78 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-20 01:51 -0800
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-20 01:51 -0800
1#
2# LSST Data Management System
3# Copyright 2008-2012 LSST Corporation.
4#
5# This product includes software developed by the
6# LSST Project (http://www.lsst.org/).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the LSST License Statement and
19# the GNU General Public License along with this program. If not,
20# see <http://www.lsstcorp.org/LegalNotices/>.
21#
22import os.path
23import unittest
25import lsst.utils.tests
26from lsst.ctrl.execute.condorConfig import CondorConfig
29def setup_module(module):
30 lsst.utils.tests.init()
33class TestCondorConfig(lsst.utils.tests.TestCase):
34 def setUp(self):
35 self.config = CondorConfig()
37 def test1(self):
38 self.assertIsNone(self.config.platform.defaultRoot)
39 self.assertIsNone(self.config.platform.localScratch)
40 self.assertIsNone(self.config.platform.dataDirectory)
41 self.assertIsNone(self.config.platform.fileSystemDomain)
42 self.assertIsNone(self.config.platform.eupsPath)
43 self.assertIsNone(self.config.platform.defaultRoot)
44 self.assertIsNone(self.config.platform.setup_using)
45 self.assertIsNone(self.config.platform.scheduler)
47 def test2(self):
48 path = os.path.join("tests", "testfiles", "config_condor.py")
49 self.config.load(path)
51 self.assertEqual(self.config.platform.defaultRoot, "/usr")
52 self.assertEqual(self.config.platform.localScratch, "./tests/condor_scratch_condor")
53 self.assertEqual(self.config.platform.dataDirectory, "/tmp/data_condor")
54 self.assertEqual(self.config.platform.fileSystemDomain, "lsstcorp.org")
55 self.assertEqual(self.config.platform.eupsPath, "/var/tmp")
56 self.assertEqual(self.config.platform.scheduler, "pbs")
57 self.assertEqual(self.config.platform.manager, "dagman")
58 self.assertIsNone(self.config.platform.setup_using)
60 def test3(self):
61 path = os.path.join("tests", "testfiles", "config_condor_getenv.py")
62 self.config.load(path)
64 self.assertEqual(self.config.platform.defaultRoot, "/usr")
65 self.assertEqual(self.config.platform.localScratch, "./tests/condor_scratch")
66 self.assertEqual(self.config.platform.dataDirectory, "/tmp/data")
67 self.assertEqual(self.config.platform.fileSystemDomain, "lsstcorp.org")
68 self.assertEqual(self.config.platform.eupsPath, "/var/tmp")
69 self.assertEqual(self.config.platform.scheduler, "pbs")
70 self.assertEqual(self.config.platform.setup_using, "getenv")
71 self.assertEqual(self.config.platform.manager, "dagman")
73 def test4(self):
74 path = os.path.join("tests", "testfiles", "config_condor_setups.py")
75 self.config.load(path)
77 self.assertEqual(self.config.platform.defaultRoot, "/usr")
78 self.assertEqual(self.config.platform.localScratch, "./tests/condor_scratch")
79 self.assertEqual(self.config.platform.dataDirectory, "/tmp/data")
80 self.assertEqual(self.config.platform.fileSystemDomain, "lsstcorp.org")
81 self.assertEqual(self.config.platform.eupsPath, "/var/tmp")
82 self.assertEqual(self.config.platform.scheduler, "pbs")
83 self.assertEqual(self.config.platform.setup_using, "setups")
84 self.assertEqual(self.config.platform.manager, "dagman")
86 def test5(self):
87 path = os.path.join("tests", "testfiles", "config_condor_slurm.py")
88 self.config.load(path)
90 self.assertEqual(self.config.platform.defaultRoot, "/usr")
91 self.assertEqual(self.config.platform.localScratch, "./tests/condor_scratch_slurm")
92 self.assertEqual(self.config.platform.dataDirectory, "/tmp/data_slurm")
93 self.assertEqual(self.config.platform.fileSystemDomain, "lsstcorp.org")
94 self.assertEqual(self.config.platform.eupsPath, "/var/tmp")
95 self.assertEqual(self.config.platform.scheduler, "slurm")
96 self.assertEqual(self.config.platform.setup_using, "getenv")
97 self.assertEqual(self.config.platform.manager, "dagman")
99 def test6(self):
100 path = os.path.join("tests", "testfiles", "config_pegasus.py")
101 self.config.load(path)
103 self.assertEqual(self.config.platform.defaultRoot, "/mount2/condor_work")
104 self.assertEqual(self.config.platform.localScratch, "/mount1/scratch")
105 self.assertEqual(self.config.platform.dataDirectory, "/datasets")
106 self.assertEqual(self.config.platform.fileSystemDomain, "lsstcorp.org")
107 self.assertEqual(self.config.platform.eupsPath, "/var/tmp")
108 self.assertEqual(self.config.platform.scheduler, "slurm")
109 self.assertEqual(self.config.platform.setup_using, "getenv")
110 self.assertEqual(self.config.platform.manager, "pegasus")
113class CondorConfigMemoryTest(lsst.utils.tests.MemoryTestCase):
114 pass
117if __name__ == "__main__": 117 ↛ 118line 117 didn't jump to line 118 because the condition on line 117 was never true
118 lsst.utils.tests.init()
119 unittest.main()