mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-22 16:25:17 +00:00
tests: Fix /run/certidude permissions
This commit is contained in:
parent
60ff382d74
commit
9a7b806ff6
@ -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")
|
||||
|
@ -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"):
|
||||
|
Loading…
Reference in New Issue
Block a user