예제 #1
0
 def requirements(self):
     # We're replacing super()'s requirements deliberately here. Without a Host header they can't work.
     yield ("url", Query(self.url("ambassador/v0/check_ready"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True))
     yield ("url", Query(self.url("ambassador/v0/check_alive"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True))
     yield ("url", Query(self.url("ambassador/v0/check_ready"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True))
     yield ("url", Query(self.url("ambassador/v0/check_alive"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True))
예제 #2
0
    def queries(self):
        for i in range(100):
            yield Query(self.parent.url("%s/mark/%d" % (self.name, i % 10)))

        yield Query(self.parent.url("%s/check/" % self.name), phase=2)
예제 #3
0
 def queries(self):
     for q in self.parent.queries():
         yield Query(q.url)  # redundant with parent
         yield Query(q.url, headers={"Origin": "https://www.test-cors.org"})
예제 #4
0
 def queries(self):
     yield Query(self.url("server-name/"), expected=301)
예제 #5
0
 def queries(self):
     yield Query(self.url("findme/"))
     yield Query(self.url("findme-array/"))
     yield Query(self.url("findme-array2/"))
     yield Query(self.url("missme/"), expected=404)
     yield Query(self.url("missme-array/"), expected=404)
예제 #6
0
 def requirements(self):
     yield ("url", Query("http://%s" % self.path.fqdn))
     yield ("url", Query("https://%s" % self.path.fqdn))
예제 #7
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"))
     yield Query(self.parent.url(self.name + "/"),
                 headers={"X-Route": "target2"})
예제 #8
0
 def queries(self):
     yield Query(self.parent.url("edge_stack/admin/"), expected=200)
     yield Query(self.parent.url(self.name + "/"), expected=200)
예제 #9
0
 def requirements(self):
     yield from super().requirements()
     yield ("url", Query("http://shadow.plain-namespace/clear/"))
예제 #10
0
 def queries(self):
     # Expect that requests with escaped slashes are rejected by Envoy. We know this is rejected
     # by envoy because in a previous test, without the reject_requests_with_escaped_slashes,
     # this same request got status 404.
     yield Query(self.url(self.name + "/status/%2F200"), expected=400)
예제 #11
0
    def queries(self):
        yield Query(self.parent.url(self.name + "/"), expected=404)

        yield Query(self.parent.url(self.name + "/", scheme="ws"),
                    messages=["one", "two", "three"])
예제 #12
0
 def queries(self):
     # Sanity test that escaped slashes are not rejected by default. The upstream
     # httpbin server doesn't know what to do with this request, though, so expect
     # a 404. In another test, we'll expect HTTP 400 with reject_requests_with_escaped_slashes
     yield Query(self.url(self.name + "/status/%2F200"), expected=404)
예제 #13
0
 def queries(self):
     yield Query(self.url("ambassador/v0/diag/?json=true"))
예제 #14
0
 def queries(self):
     yield Query(self.url("target/"), insecure=True)
     yield Query(self.url("target/", scheme="http"), expected=301)
예제 #15
0
 def requirements(self):
     yield ("url", Query(self.url("ambassador/v0/check_ready")))
     yield ("url", Query(self.url("ambassador/v0/check_alive")))
예제 #16
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"))
     yield Query(self.parent.url(f'need-normalization/../{self.name}/'))
     yield Query(self.parent.url(self.name + "-nested/"))
     yield Query(self.parent.url(self.name + "-non-existent/"),
                 expected=404)
예제 #17
0
    def requirements(self):
        if self.use_superpod:
            yield from ()

        yield ("url", Query("http://%s" % self.path.fqdn))
        yield ("url", Query("https://%s" % self.path.fqdn))
예제 #18
0
 def queries(self):
     yield Query(self.url(self.name + "-1/"))
     yield Query(self.url(self.name + "-2/"))
예제 #19
0
    def queries(self):
        # [0]
        yield Query(self.url("target/"), headers={"Requested-Status": "200"}, expected=200)

        # [1]
        yield Query(self.url("target/"), headers={"Requested-Status": "503"}, expected=503)
예제 #20
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"))
예제 #21
0
 def requirements(self):
     yield ("url", Query("http://%s/ambassador/check/" % self.path.fqdn))
예제 #22
0
 def queries(self):
     for i in range(100):
         yield Query(self.parent.url(self.name + "/"))
예제 #23
0
 def queries(self):
     yield Query(self.url("ambassador/v0/diag/?json=true&filter=errors"),
                 phase=2)
예제 #24
0
 def queries(self):
     yield Query(
         self.parent.url(self.name) +
         "/response-headers?zoo=Zoo&test=Test&koo=Koot")
예제 #25
0
 def requirements(self):
     yield from super().requirements()
     yield ("url", Query("http://shadow/clear/"))
예제 #26
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"))
     yield Query(self.parent.url(f'need-normalization/../{self.name}/'))
예제 #27
0
 def queries(self):
     yield Query(self.url(""), expected=404)
     yield Query(self.url(""), headers={'Host': 'random.host.whatever'}, expected=404)
     yield Query(self.url(""), headers={'Host': 'helloworld-go.default.example.com'}, expected=200)
예제 #28
0
 def queries(self):
     yield Query(self.url("config_dump"), phase=2)
예제 #29
0
 def queries(self):
     for q in self.parent.queries():
         idx = q.url.find("/", q.url.find("://") + 3)
         upped = q.url[:idx] + q.url[idx:].upper()
         assert upped != q.url
         yield Query(upped)
예제 #30
0
    def queries(self):
        # 0: Get some info from diagd for self.check() to inspect
        yield Query(self.url("ambassador/v0/diag/?json=true&filter=errors"),
                    headers={"Host": "tls-context-host-1" },
                    insecure=True,
                    sni=True)

        # 1-5: Host #1 - TLS
        yield Query(self.url("target-1/", scheme="https"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True,
                    expected=200)
        yield Query(self.url("target-2/", scheme="https"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True,
                    expected=404)
        yield Query(self.url("target-3/", scheme="https"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True,
                    expected=404)
        yield Query(self.url("target-shared/", scheme="https"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True,
                    expected=200)
        yield Query(self.url(".well-known/acme-challenge/foo", scheme="https"), headers={"Host": "tls-context-host-1"}, insecure=True, sni=True,
                    expected=404)
        # 6-10: Host #1 - cleartext (action: Route)
        yield Query(self.url("target-1/", scheme="http"), headers={"Host": "tls-context-host-1"},
                    expected=200)
        yield Query(self.url("target-2/", scheme="http"), headers={"Host": "tls-context-host-1"},
                    expected=404)
        yield Query(self.url("target-3/", scheme="http"), headers={"Host": "tls-context-host-1"},
                    expected=404)
        yield Query(self.url("target-shared/", scheme="http"), headers={"Host": "tls-context-host-1"},
                    expected=200)
        yield Query(self.url(".well-known/acme-challenge/foo", scheme="http"), headers={"Host": "tls-context-host-1"},
                    expected=404)

        # 11-15: Host #2 - TLS
        yield Query(self.url("target-1/", scheme="https"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True,
                    expected=404)
        yield Query(self.url("target-2/", scheme="https"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True,
                    expected=200)
        yield Query(self.url("target-3/", scheme="https"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True,
                    expected=404)
        yield Query(self.url("target-shared/", scheme="https"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True,
                    expected=200)
        yield Query(self.url(".well-known/acme-challenge/foo", scheme="https"), headers={"Host": "tls-context-host-2"}, insecure=True, sni=True,
                    expected=404)
        # 16-20: Host #2 - cleartext (action: Redirect)
        yield Query(self.url("target-1/", scheme="http"), headers={"Host": "tls-context-host-2"},
                    expected=(404 if bug_single_insecure_action else 301))
        yield Query(self.url("target-2/", scheme="http"), headers={"Host": "tls-context-host-2"},
                    expected=(200 if bug_single_insecure_action else 301))
        yield Query(self.url("target-3/", scheme="http"), headers={"Host": "tls-context-host-2"},
                    expected=(404 if bug_single_insecure_action else 301))
        yield Query(self.url("target-shared/", scheme="http"), headers={"Host": "tls-context-host-2"},
                    expected=(200 if bug_single_insecure_action else 301))
        yield Query(self.url(".well-known/acme-challenge/foo", scheme="http"), headers={"Host": "tls-context-host-2"},
                    expected=404)

        # 21-25: Host #3 - TLS
        yield Query(self.url("target-1/", scheme="https"), headers={"Host": "ambassador.example.com"}, insecure=True, sni=True,
                    expected=404)
        yield Query(self.url("target-2/", scheme="https"), headers={"Host": "ambassador.example.com"}, insecure=True, sni=True,
                    expected=404)
        yield Query(self.url("target-3/", scheme="https"), headers={"Host": "ambassador.example.com"}, insecure=True, sni=True,
                    expected=200)
        yield Query(self.url("target-shared/", scheme="https"), headers={"Host": "ambassador.example.com"}, insecure=True, sni=True,
                    expected=200)
        yield Query(self.url(".well-known/acme-challenge/foo", scheme="https"), headers={"Host": "ambassador.example.com"}, insecure=True, sni=True,
                    expected=200)
        # 26-30: Host #3 - cleartext (action: Reject)
        yield Query(self.url("target-1/", scheme="http"), headers={"Host": "ambassador.example.com"},
                    expected=404)
        yield Query(self.url("target-2/", scheme="http"), headers={"Host": "ambassador.example.com"},
                    expected=404)
        yield Query(self.url("target-3/", scheme="http"), headers={"Host": "ambassador.example.com"},
                    expected=(200 if bug_single_insecure_action else 404))
        yield Query(self.url("target-shared/", scheme="http"), headers={"Host": "ambassador.example.com"},
                    expected=(200 if bug_single_insecure_action else 404))
        yield Query(self.url(".well-known/acme-challenge/foo", scheme="http"), headers={"Host": "ambassador.example.com"},
                    expected=200)