From a5c776621b9909c528ecc79d3af9d891fa281b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Tue, 25 Apr 2017 22:01:18 +0300 Subject: [PATCH] Attempt to create test users via Travis --- .travis.yml | 2 ++ tests/test_cli.py | 15 --------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 46085b2..02ec647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,8 @@ install: - pip install --editable . - pip install codecov pytest-cov click ipaddress humanize falcon simplepam script: + - useradd adminbot -G sudo -p '$1$PBkf5waA$n9EV6WJ7PS6lyGWkgeTPf1' + - useradd userbot -G users -p '$1$PBkf5waA$n9EV6WJ7PS6lyGWkgeTPf1' - py.test --cov-report xml --cov=certidude tests/ cache: directories: diff --git a/tests/test_cli.py b/tests/test_cli.py index 50bce54..f7c6e08 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -45,21 +45,6 @@ def test_cli_setup_authority(): assert authority.ca_cert.not_valid_before < datetime.now() assert authority.ca_cert.not_valid_after > datetime.now() + timedelta(days=7000) - try: - pwd.getpwnam("userbot") - except KeyError: - # useradd userbot -G users -p '$1$PBkf5waA$n9EV6WJ7PS6lyGWkgeTPf1' - cmd = "useradd", "userbot", "-G", "users", "-p", "$1$PBkf5waA$n9EV6WJ7PS6lyGWkgeTPf1" # bot - subprocess.call(cmd) - - try: - pwd.getpwnam("adminbot") - except KeyError: - # Note: on Fedora use group 'wheel' instead of 'sudo' - # useradd adminbot -G sudo -p '$1$PBkf5waA$n9EV6WJ7PS6lyGWkgeTPf1' - cmd = "useradd", "adminbot", "-G", "sudo", "-p", "$1$PBkf5waA$n9EV6WJ7PS6lyGWkgeTPf1" # bot - subprocess.call(cmd) - usertoken = "Basic dXNlcmJvdDpib3Q=" admintoken = "Basic YWRtaW5ib3Q6Ym90"