示例#1
0
 def test_setup_haproxy_config(self):
     setup_haproxy_config(self.ssl_cert_path)
     haproxy_conf = self.files['haproxy.cfg']
     self.assertIn('ca-base {}'.format(self.ssl_cert_path), haproxy_conf)
     self.assertIn('crt-base {}'.format(self.ssl_cert_path), haproxy_conf)
     self.assertIn('ws1 127.0.0.1:{}'.format(API_PORT), haproxy_conf)
     self.assertIn('web1 127.0.0.1:{}'.format(WEB_PORT), haproxy_conf)
     self.assertIn('ca-file {}'.format(JUJU_PEM), haproxy_conf)
     self.assertIn('crt {}'.format(JUJU_PEM), haproxy_conf)
     self.assertIn('redirect scheme https', haproxy_conf)
示例#2
0
 def test_setup_haproxy_config_insecure(self):
     setup_haproxy_config(self.ssl_cert_path, secure=False)
     # The insecure approach eliminates the https redirect.
     self.assertNotIn('redirect scheme https', self.files['haproxy.cfg'])