Skip to content
Snippets Groups Projects
Unverified Commit e4d594fc authored by drebs's avatar drebs
Browse files

[test] always use a tempdir for server fixture config file

When starting up a Soledad Server through the use of a fixture in tests,
a config file is created with the options needed for that test. As the
config file was being created in /etc and not being removed, this was
influencing servers started by other tests that don't use that fixture.

By always using a temporary directory in the server fixture, we make
sure that the config file is used only for that test and is removed
after the test is finished.

Closes: #8995
parent 4f860fb9
Branches
Tags
1 merge request!161Fixes for server test fixture and startup
......@@ -205,16 +205,7 @@ class SoledadServer(object):
])
def _create_conf_file(self):
# come up with name of the configuration file
fname = '/etc/soledad/soledad-server.conf'
if not os.access('/etc', os.W_OK):
fname = os.path.join(self.tmpdir.strpath, 'soledad-server.conf')
# create the configuration file
dirname = os.path.dirname(fname)
if not os.path.isdir(dirname):
os.mkdir(dirname)
with open(fname, 'w') as f:
blobs_path = os.path.join(str(self.tmpdir), 'blobs')
content = '''[soledad-server]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment