1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-12-22 08:15:18 +00:00

tests: Fix /run/certidude permissions

This commit is contained in:
Lauri Võsandi 2017-05-01 23:06:45 +00:00
parent 60ff382d74
commit 9a7b806ff6
2 changed files with 5 additions and 2 deletions

View File

@ -1162,6 +1162,9 @@ def certidude_serve(port, listen, fork):
if not os.path.exists(const.RUN_DIR):
click.echo("Creating: %s" % const.RUN_DIR)
os.makedirs(const.RUN_DIR)
os.chmod(const.RUN_DIR, 0755)
# TODO: umask!
import pwd
_, _, uid, gid, gecos, root, shell = pwd.getpwnam("certidude")

View File

@ -41,14 +41,12 @@ def test_cli_setup_authority():
os.kill(int(fh.read()), 15)
except OSError:
pass
os.unlink("/run/certidude/signer.pid")
if os.path.exists("/run/certidude/server.pid"):
with open("/run/certidude/server.pid") as fh:
try:
os.kill(int(fh.read()), 15)
except OSError:
pass
os.unlink("/run/certidude/server.pid")
if os.path.exists("/var/lib/certidude/ca.example.lan"):
shutil.rmtree("/var/lib/certidude/ca.example.lan")
@ -56,6 +54,8 @@ def test_cli_setup_authority():
os.unlink("/etc/certidude/server.conf")
if os.path.exists("/etc/certidude/client.conf"):
os.unlink("/etc/certidude/client.conf")
if os.path.exists("/run/certidude"):
shutil.rmtree("/run/certidude")
# Remove OpenVPN stuff
if os.path.exists("/etc/openvpn"):