Beispiel #1
0
 def test_redirect_protocol(self):
     result = [
         site for site in apache.extract_sites(self.redirect_example)
         if site["name"] == "www.portal.ddsc.nl"
     ][0]
     pprint(result)
     self.assertEqual(result["redirect_to_protocol"], "https")
Beispiel #2
0
 def test_protocol_https_without_portnumber(self):
     # A servername can be 'portal.ddsc.nl:443', the port number must be
     # stripped from the servername in this case.
     result = list(apache.extract_sites(self.multiple_example))
     pprint(result)
     https_sites = [i for i in result if i["protocol"] == "https"]
     site_names = [i["name"] for i in https_sites]
     self.assertTrue("portal.ddsc.nl" in site_names)
Beispiel #3
0
 def test_proxy_remote(self):
     result = list(apache.extract_sites(self.multiple_example))
     pprint(result)
     specific_site = [
         site for site in result
         if site["name"] == "fewsvecht.controlnext.org"
     ][0]
     self.assertEqual(specific_site["proxy_to_other_server"],
                      "p-fews-mc-v2-d1.ourdomain")
Beispiel #4
0
 def test_redirects3(self):
     result = list(apache.extract_sites(self.redirect_example))
     pprint(result)
     redirects = [i["redirect_to"] for i in result]
     self.assertTrue("waterschappenlimburg.lizard.net" in redirects)
Beispiel #5
0
 def test_redirects2(self):
     result = list(apache.extract_sites(self.redirect_example))
     pprint(result)
     redirects = [i["redirect_to"] for i in result]
     self.assertTrue("GONE" in redirects)
Beispiel #6
0
 def test_redirect_count2(self):
     result = list(apache.extract_sites(self.redirect_example))
     pprint(result)
     redirects = [i["redirect_to"] for i in result]
     self.assertEqual(len(redirects), 4)
Beispiel #7
0
 def test_redirect_count1(self):
     result = list(apache.extract_sites(self.redirect_example))
     pprint(result)
     self.assertEqual(len(result), 4)
Beispiel #8
0
 def test_protocol_https(self):
     result = list(apache.extract_sites(self.multiple_example))
     pprint(result)
     self.assertEqual(2,
                      len([i for i in result if i["protocol"] == "https"]))
Beispiel #9
0
 def test_protocol_http(self):
     result = list(apache.extract_sites(self.single_example))
     pprint(result)
     self.assertEqual(result[0]["protocol"], "http")
Beispiel #10
0
 def test_srv_extraction_docroot(self):
     result = list(apache.extract_sites(self.single_example))
     pprint(result)
     self.assertEqual("serverinfo.lizard.net",
                      result[0]["related_checkout"])
Beispiel #11
0
 def test_srv_extraction_customlog(self):
     result = list(apache.extract_sites(self.customlog_example))
     pprint(result)
     self.assertEqual("somewhere", result[0]["related_checkout"])
Beispiel #12
0
 def test_count_with_alias(self):
     result = list(apache.extract_sites(self.customlog_example))
     pprint(result)
     self.assertEqual(len(result), 2)
Beispiel #13
0
 def test_multiple_count(self):
     # Four virtualhosts
     result = list(apache.extract_sites(self.multiple_example))
     pprint(result)
     self.assertEqual(len(result), 4)
Beispiel #14
0
 def test_single_count(self):
     result = list(apache.extract_sites(self.single_example))
     pprint(result)
     self.assertEqual(len(result), 1)