summaryrefslogtreecommitdiffstats
path: root/tests/tests.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-05-05 11:13:16 -0400
committerJim Meyering <jim@meyering.net>2006-05-05 11:13:16 -0400
commit9aef401e5787d9c00424dbdfceb577aa9ce1f012 (patch)
treefcc122acbccbe42a5a1d7ea79eec8e3c24e178c2 /tests/tests.py
parenta5ffe9dda2488240d3fa440a11b2a88267110031 (diff)
downloadthird_party-cobbler-9aef401e5787d9c00424dbdfceb577aa9ce1f012.tar.gz
third_party-cobbler-9aef401e5787d9c00424dbdfceb577aa9ce1f012.tar.xz
third_party-cobbler-9aef401e5787d9c00424dbdfceb577aa9ce1f012.zip
Make /etc/cobbler.conf be packaged instead of being created, proper handling of parse errors on config files, tweaking unit tests tempfile stuff since sync() test is currently broken by the tempfile changes (why??)
Diffstat (limited to 'tests/tests.py')
-rw-r--r--tests/tests.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/tests.py b/tests/tests.py
index 2673cdd..cfe1081 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -24,11 +24,14 @@ FAKE_KERNEL2="vmlinuz-2.5.16-2.2055_FAKE"
FAKE_KERNEL3="vmlinuz-1.8.18-3.9999_FAKE"
FAKE_KICKSTART="http://127.0.0.1/fake.ks"
+cleanup_dirs = []
+
class BootTest(unittest.TestCase):
def setUp(self):
# Create temp dir
- self.topdir = tempfile.mkdtemp(prefix="_cobbler-")
+ self.topdir = tempfile.mkdtemp(prefix="_cobbler-",dir="/tmp")
+ print "using dir = %s" % self.topdir
self.fk_initrd = os.path.join(self.topdir, FAKE_INITRD)
self.fk_initrd2 = os.path.join(self.topdir, FAKE_INITRD2)
self.fk_initrd3 = os.path.join(self.topdir, FAKE_INITRD3)
@@ -37,11 +40,6 @@ class BootTest(unittest.TestCase):
self.fk_kernel2 = os.path.join(self.topdir, FAKE_KERNEL2)
self.fk_kernel3 = os.path.join(self.topdir, FAKE_KERNEL3)
- try:
- # it will interfere with results...
- os.remove("/etc/cobbler.conf")
- except:
- pass
self.api = api.BootAPI()
self.hostname = os.uname()[1]
create = [ self.fk_initrd, self.fk_initrd2, self.fk_initrd3,
@@ -51,7 +49,8 @@ class BootTest(unittest.TestCase):
self.make_basic_config()
def tearDown(self):
- shutil.rmtree(self.topdir, ignore_errors=1)
+ # this is causing problems with the sync() test
+ # shutil.rmtree(self.topdir,ignore_errors=True)
self.api = None
def make_basic_config(self):
@@ -297,4 +296,3 @@ if __name__ == "__main__":
print "tests: must invoke from top level directory"
sys.exit(1)
unittest.main()
-