mirror of
https://github.com/certbot/certbot.git
synced 2026-01-21 19:01:07 +03:00
Fix apache/nginx tests.
This commit is contained in:
@@ -54,10 +54,11 @@ def dir_setup(test_dir="debian_apache_2_4/two_vhost_80",
|
||||
|
||||
|
||||
def setup_ssl_options(
|
||||
config_dir, mod_ssl_conf=constants.MOD_SSL_CONF):
|
||||
config_dir, src=constants.MOD_SSL_CONF_SRC,
|
||||
dest=constants.MOD_SSL_CONF_DEST):
|
||||
"""Move the ssl_options into position and return the path."""
|
||||
option_path = os.path.join(config_dir, "options-ssl.conf")
|
||||
shutil.copyfile(mod_ssl_conf, option_path)
|
||||
option_path = os.path.join(config_dir, dest)
|
||||
shutil.copyfile(src, option_path)
|
||||
return option_path
|
||||
|
||||
|
||||
@@ -75,7 +76,10 @@ def get_apache_configurator(
|
||||
config=mock.MagicMock(
|
||||
apache_server_root=config_path,
|
||||
apache_le_vhost_ext=constants.CLI_DEFAULTS["le_vhost_ext"],
|
||||
backup_dir=backups,
|
||||
config_dir=config_dir,
|
||||
temp_checkpoint_dir=os.path.join(work_dir, "temp_checkpoints"),
|
||||
in_progress_dir=os.path.join(backups, "IN_PROGRESS"),
|
||||
work_dir=work_dir),
|
||||
name="apache",
|
||||
version=version)
|
||||
|
||||
@@ -20,7 +20,8 @@ class NginxTest(unittest.TestCase): # pylint: disable=too-few-public-methods
|
||||
"etc_nginx", "letsencrypt_nginx.tests")
|
||||
|
||||
self.ssl_options = apache_util.setup_ssl_options(
|
||||
self.config_dir, constants.MOD_SSL_CONF)
|
||||
self.config_dir, constants.MOD_SSL_CONF_SRC,
|
||||
constants.MOD_SSL_CONF_DEST)
|
||||
|
||||
self.config_path = os.path.join(self.temp_dir, "etc_nginx")
|
||||
|
||||
@@ -44,8 +45,15 @@ def get_nginx_configurator(
|
||||
backups = os.path.join(work_dir, "backups")
|
||||
|
||||
config = configurator.NginxConfigurator(
|
||||
config=mock.MagicMock(nginx_server_root=config_path,
|
||||
config_dir=config_dir, work_dir=work_dir),
|
||||
config=mock.MagicMock(
|
||||
nginx_server_root=config_path,
|
||||
le_vhost_ext="-le-ssl.conf",
|
||||
config_dir=config_dir,
|
||||
work_dir=work_dir,
|
||||
backup_dir=backups,
|
||||
temp_checkpoint_dir=os.path.join(work_dir, "temp_checkpoints"),
|
||||
in_progress_dir=os.path.join(backups, "IN_PROGRESS"),
|
||||
),
|
||||
name="nginx",
|
||||
version=version)
|
||||
config.prepare()
|
||||
|
||||
Reference in New Issue
Block a user