Fix a few nits, coverage

This commit is contained in:
Liam Marshall 2015-11-18 21:12:53 -06:00
parent e5e7cef6d6
commit b19c9d858c
2 changed files with 15 additions and 0 deletions

View file

@ -225,6 +225,8 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
"SSLCertificateChainFile", chain_path)
else:
self.aug.set(path["chain_path"][-1], chain_path)
else:
raise errors.PluginError("--chain-path is required for your version of Apache")
else:
if not fullchain_path:
raise errors.PluginError("Please provide the --fullchain-path\

View file

@ -306,6 +306,19 @@ class TwoVhost80Test(util.ApacheTest):
lambda: self.config.deploy_cert(
"random.demo", "example/cert.pem", "example/key.pem"))
def test_deploy_cert_old_apache_no_chain(self):
self.config = util.get_apache_configurator(
self.config_path, self.config_dir, self.work_dir, version=(2, 4, 7))
self.config.parser.modules.add("ssl_module")
self.config.parser.modules.add("mod_ssl.c")
# Get the default 443 vhost
self.config.assoc["random.demo"] = self.vh_truth[1]
self.assertRaises(errors.PluginError,
lambda: self.config.deploy_cert(
"random.demo", "example/cert.pem", "example/key.pem"))
def test_deploy_cert(self):
self.config.parser.modules.add("ssl_module")
self.config.parser.modules.add("mod_ssl.c")