From 803bb9595c043afaa68de529d424352308ab0ece Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Mon, 4 May 2015 13:48:18 +0000 Subject: [PATCH] Fix test dirs chmods errors. Stragely, when run on digitalocean jessie x64 droplet (as root), the following error were produced before this fix: ====================================================================== ERROR: test_add_name_vhost (letsencrypt.client.plugins.apache.tests.configurator_test.TwoVhost80Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/lets-encrypt-preview/letsencrypt/client/plugins/apache/tests/configurator_test.py", line 35, in setUp self.ssl_options) File "/root/lets-encrypt-preview/letsencrypt/client/plugins/apache/tests/util.py", line 76, in get_apache_configurator version) File "/root/lets-encrypt-preview/letsencrypt/client/plugins/apache/configurator.py", line 96, in __init__ self.verify_setup() File "/root/lets-encrypt-preview/letsencrypt/client/plugins/apache/configurator.py", line 938, in verify_setup self.config.config_dir, constants.CONFIG_DIRS_MODE, uid) File "/root/lets-encrypt-preview/letsencrypt/client/le_util.py", line 37, in make_or_verify_dir "permissions or owner" % directory) LetsEncryptClientError: /tmp/tmp1wYWIMconfig exists, but does not have the proper permissions or owner --- letsencrypt/client/plugins/apache/tests/util.py | 4 ++++ letsencrypt/client/plugins/nginx/tests/util.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/letsencrypt/client/plugins/apache/tests/util.py b/letsencrypt/client/plugins/apache/tests/util.py index 488ecffea..5a1cf85a2 100644 --- a/letsencrypt/client/plugins/apache/tests/util.py +++ b/letsencrypt/client/plugins/apache/tests/util.py @@ -37,6 +37,10 @@ def dir_setup(test_dir="debian_apache_2_4/two_vhost_80"): config_dir = tempfile.mkdtemp("config") work_dir = tempfile.mkdtemp("work") + os.chmod(temp_dir, constants.CONFIG_DIRS_MODE) + os.chmod(config_dir, constants.CONFIG_DIRS_MODE) + os.chmod(work_dir, constants.CONFIG_DIRS_MODE) + test_configs = pkg_resources.resource_filename( "letsencrypt.client.plugins.apache.tests", "testdata/%s" % test_dir) diff --git a/letsencrypt/client/plugins/nginx/tests/util.py b/letsencrypt/client/plugins/nginx/tests/util.py index 58c5730cf..2a0b904fb 100644 --- a/letsencrypt/client/plugins/nginx/tests/util.py +++ b/letsencrypt/client/plugins/nginx/tests/util.py @@ -42,6 +42,10 @@ def dir_setup(test_dir="debian_nginx/two_vhost_80"): config_dir = tempfile.mkdtemp("config") work_dir = tempfile.mkdtemp("work") + os.chmod(temp_dir, constants.CONFIG_DIRS_MODE) + os.chmod(config_dir, constants.CONFIG_DIRS_MODE) + os.chmod(work_dir, constants.CONFIG_DIRS_MODE) + test_configs = pkg_resources.resource_filename( "letsencrypt.client.plugins.nginx.tests", test_dir)