From c428be48ff2da1cf2b6ee6fae3972c440de1f8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Mon, 1 May 2017 17:10:11 +0000 Subject: [PATCH] tests: Modifying /etc/hosts need sudo --- .travis.yml | 3 +++ tests/test_cli.py | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c2a092d..c2b141f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ after_success: virtualenv: system_site_packages: true install: + - echo "127.0.0.1 localhost" | sudo tee /etc/hosts + - echo "127.0.0.1 ca.example.lan ca" | sudo tee -a /etc/hosts + - echo "127.0.0.1 vpn.koodur.lan | sudo tee -a /etc/hosts - pip install -r requirements.txt - pip install codecov pytest-cov - pip install --editable . diff --git a/tests/test_cli.py b/tests/test_cli.py index 7c9732c..47aa7b3 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -35,10 +35,6 @@ def generate_csr(cn=None): def test_cli_setup_authority(): import shutil import os - with open("/etc/hosts", "w") as fh: - fh.write("127.0.0.1 localhost\n") - fh.write("127.0.0.1 ca.example.lan ca\n") - fh.write("127.0.0.1 vpn.example.lan\n") if os.path.exists("/run/certidude/signer.pid"): with open("/run/certidude/signer.pid") as fh: try: