Install cryptography.io just for unittests

This commit is contained in:
Lauri Võsandi 2017-08-16 21:08:20 +00:00
parent c45a5df773
commit d32ec224d7
1 changed files with 4 additions and 6 deletions

View File

@ -4,6 +4,7 @@ from datetime import datetime, timedelta
from time import sleep
import pytest
import shutil
import sys
import os
UA_FEDORA_FIREFOX = "Mozilla/5.0 (X11; Fedora; Linux x86_64) " \
@ -138,12 +139,11 @@ def clean_server():
shutil.copyfile("/etc/resolv.conf.orig", "/etc/resolv.conf")
def test_cli_setup_authority():
# apt install nano git build-essential python-dev libkrb5-dev
import os
import sys
assert os.getuid() == 0, "Run tests as root in a clean VM or container"
os.system("apt-get install -y git build-essential python-dev libkrb5-dev")
os.system("pip install cryptography")
assert not os.environ.get("KRB5CCNAME"), "Environment contaminated"
assert not os.environ.get("KRB5_KTNAME"), "Environment contaminated"
@ -737,8 +737,6 @@ def test_cli_setup_authority():
result = runner.invoke(cli, ["setup", "nginx", "-cn", "www.example.lan", "ca.example.lan"])
assert not result.exception, result.output # client conf already exists, remove to regenerate
import os
with open("/etc/certidude/client.conf", "a") as fh:
fh.write("insecure = true\n")