예제 #1
0
 def test_get_sni_addr(self):
     from letsencrypt_apache.obj import Addr
     self.assertEqual(
         self.addr.get_sni_addr("443"), Addr.fromstring("*:443"))
     self.assertEqual(
         self.addr.get_sni_addr("225"), Addr.fromstring("*:225"))
     self.assertEqual(
         self.addr1.get_sni_addr("443"), Addr.fromstring("127.0.0.1"))
예제 #2
0
    def test_set_inclusion(self):
        from letsencrypt_apache.obj import Addr
        set_a = set([self.addr1, self.addr2])
        addr1b = Addr.fromstring("192.168.1.1")
        addr2b = Addr.fromstring("192.168.1.1:*")
        set_b = set([addr1b, addr2b])

        self.assertEqual(set_a, set_b)
    def test_set_inclusion(self):
        from letsencrypt_apache.obj import Addr
        set_a = set([self.addr1, self.addr2])
        addr1b = Addr.fromstring("192.168.1.1")
        addr2b = Addr.fromstring("192.168.1.1:*")
        set_b = set([addr1b, addr2b])

        self.assertEqual(set_a, set_b)
예제 #4
0
    def setUp(self):
        from letsencrypt_apache.obj import Addr
        self.addr = Addr.fromstring("*:443")

        self.addr1 = Addr.fromstring("127.0.0.1")
        self.addr2 = Addr.fromstring("127.0.0.1:*")

        self.addr_defined = Addr.fromstring("127.0.0.1:443")
        self.addr_default = Addr.fromstring("_default_:443")
예제 #5
0
    def setUp(self):
        from letsencrypt_apache.obj import Addr
        from letsencrypt_apache.obj import VirtualHost

        self.addr1 = Addr.fromstring("127.0.0.1")
        self.addr2 = Addr.fromstring("127.0.0.1:443")
        self.addr_default = Addr.fromstring("_default_:443")

        self.vhost1 = VirtualHost(
            "filep", "vh_path", set([self.addr1]), False, False, "localhost")

        self.vhost1b = VirtualHost(
            "filep", "vh_path", set([self.addr1]), False, False, "localhost")

        self.vhost2 = VirtualHost(
            "fp", "vhp", set([self.addr2]), False, False, "localhost")
예제 #6
0
    def test_conflicts(self):
        from letsencrypt_apache.obj import Addr
        from letsencrypt_apache.obj import VirtualHost

        complex_vh = VirtualHost(
            "fp", "vhp",
            set([Addr.fromstring("*:443"), Addr.fromstring("1.2.3.4:443")]),
            False, False)
        self.assertTrue(complex_vh.conflicts([self.addr1]))
        self.assertTrue(complex_vh.conflicts([self.addr2]))
        self.assertFalse(complex_vh.conflicts([self.addr_default]))

        self.assertTrue(self.vhost1.conflicts([self.addr2]))
        self.assertFalse(self.vhost1.conflicts([self.addr_default]))

        self.assertFalse(self.vhost2.conflicts([self.addr1, self.addr_default]))
예제 #7
0
    def test_eq(self):
        from letsencrypt_apache.obj import Addr
        from letsencrypt_apache.obj import VirtualHost
        vhost1b = VirtualHost(
            "filep", "vh_path",
            set([Addr.fromstring("localhost")]), False, False)

        self.assertEqual(vhost1b, self.vhost1)
        self.assertEqual(str(vhost1b), str(self.vhost1))
        self.assertFalse(vhost1b == 1234)
    def test_eq(self):
        from letsencrypt_apache.obj import Addr
        from letsencrypt_apache.obj import VirtualHost
        vhost1b = VirtualHost("filep", "vh_path",
                              set([Addr.fromstring("localhost")]), False,
                              False)

        self.assertEqual(vhost1b, self.vhost1)
        self.assertEqual(str(vhost1b), str(self.vhost1))
        self.assertFalse(vhost1b == 1234)
예제 #9
0
 def setUp(self):
     from letsencrypt_apache.obj import Addr
     self.addr1 = Addr.fromstring("192.168.1.1")
     self.addr2 = Addr.fromstring("192.168.1.1:*")
     self.addr3 = Addr.fromstring("192.168.1.1:80")
예제 #10
0
 def setUp(self):
     from letsencrypt_apache.obj import VirtualHost
     from letsencrypt_apache.obj import Addr
     self.vhost1 = VirtualHost(
         "filep", "vh_path",
         set([Addr.fromstring("localhost")]), False, False)
 def setUp(self):
     from letsencrypt_apache.obj import Addr
     self.addr1 = Addr.fromstring("192.168.1.1")
     self.addr2 = Addr.fromstring("192.168.1.1:*")
     self.addr3 = Addr.fromstring("192.168.1.1:80")
 def setUp(self):
     from letsencrypt_apache.obj import VirtualHost
     from letsencrypt_apache.obj import Addr
     self.vhost1 = VirtualHost("filep", "vh_path",
                               set([Addr.fromstring("localhost")]), False,
                               False)