diff options
author | bmw <bmw@users.noreply.github.com> | 2016-01-15 04:33:27 +0300 |
---|---|---|
committer | bmw <bmw@users.noreply.github.com> | 2016-01-15 04:33:27 +0300 |
commit | b0303414155ffdbad57c05c578460ff42e424856 (patch) | |
tree | b4ad7dde5900c1fe0838c16df38e27e4457b02f1 | |
parent | a401384d6278bdfc397643f640cd19dfb204b079 (diff) | |
parent | 2939b62f242f05e24c5ede23c8dfeed2f1a0535c (diff) |
Merge pull request #2187 from letsencrypt/symlink-problems
Fix tests on letsencrypt-apache packages
-rw-r--r-- | letsencrypt-apache/letsencrypt_apache/tests/util.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/letsencrypt-apache/letsencrypt_apache/tests/util.py b/letsencrypt-apache/letsencrypt_apache/tests/util.py index 798d4814b..782ed6f44 100644 --- a/letsencrypt-apache/letsencrypt_apache/tests/util.py +++ b/letsencrypt-apache/letsencrypt_apache/tests/util.py @@ -42,6 +42,20 @@ class ApacheTest(unittest.TestCase): # pylint: disable=too-few-public-methods self.rsa512jwk = jose.JWKRSA.load(test_util.load_vector( "rsa512_key.pem")) + # Make sure all vhosts in sites-enabled are symlinks (Python packaging + # does not preserve symlinks) + sites_enabled = os.path.join(self.config_path, "sites-enabled") + if not os.path.exists(sites_enabled): + return + + for vhost_basename in os.listdir(sites_enabled): + vhost = os.path.join(sites_enabled, vhost_basename) + if not os.path.islink(vhost): # pragma: no cover + os.remove(vhost) + target = os.path.join( + os.path.pardir, "sites-available", vhost_basename) + os.symlink(target, vhost) + class ParserTest(ApacheTest): # pytlint: disable=too-few-public-methods |