mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
add test to make sure ipv6only=on is not erroneously removed
This commit is contained in:
parent
83c5a0f665
commit
6c168d4e7e
1 changed files with 15 additions and 3 deletions
|
|
@ -452,12 +452,24 @@ class NginxParserTest(util.NginxTest): #pylint: disable=too-many-public-methods
|
|||
nparser = parser.NginxParser(self.config_path)
|
||||
|
||||
vhosts = nparser.get_vhosts()
|
||||
default = [x for x in vhosts if 'ipv6ssl' in x.filep][0]
|
||||
new_vhost = nparser.duplicate_vhost(default, remove_singleton_listen_params=True)
|
||||
ipv6ssl = [x for x in vhosts if 'ipv6ssl' in x.filep][0]
|
||||
new_vhost = nparser.duplicate_vhost(ipv6ssl, remove_singleton_listen_params=True)
|
||||
nparser.filedump(ext='')
|
||||
|
||||
for addr in new_vhost.addrs:
|
||||
self.assertFalse(addr.ipv6only)
|
||||
self.assertFalse(addr.ipv6only)
|
||||
|
||||
identical_vhost = nparser.duplicate_vhost(ipv6ssl, remove_singleton_listen_params=False)
|
||||
nparser.filedump(ext='')
|
||||
|
||||
called = False
|
||||
for addr in identical_vhost.addrs:
|
||||
if addr.ipv6:
|
||||
self.assertTrue(addr.ipv6only)
|
||||
called = True
|
||||
self.assertTrue(called)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main() # pragma: no cover
|
||||
|
|
|
|||
Loading…
Reference in a new issue