Esempio n. 1
0
 def requirements(self):
     yield ("url",
            Query(self.url("ambassador/v0/check_ready"),
                  insecure=True,
                  sni=True))
Esempio n. 2
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))
Esempio n. 3
0
 def requirements(self):
     yield ("url", Query(self.url("ambassador/v0/check_ready")))
     yield ("url", Query(self.url("ambassador/v0/check_alive")))
Esempio n. 4
0
 def requirements(self):
     yield from super().requirements()
     yield ("url", Query("http://zipkin:9411/api/v2/services"))
Esempio n. 5
0
 def requirements(self):
     yield from super().requirements()
     yield ("url",
            Query(self.format("http://{self.path.k8s}-consul:8500/ui/")))
Esempio n. 6
0
 def queries(self):
     h1 = 'i' * (31 * 1024)
     yield Query(self.url("target/"), expected=431, headers={'big': h1})
     h2 = 'i' * (29 * 1024)
     yield Query(self.url("target/"), expected=200, headers={'small': h2})
Esempio n. 7
0
 def requirements(self):
     yield from super().requirements()
     yield ("url", Query("http://shadow.plain-namespace/clear/"))
Esempio n. 8
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)
Esempio n. 9
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"), expected=404)
     yield Query(self.parent.url(self.name + "/"), headers={"Host": "inspector.internal"}, expected=404)
     yield Query(self.parent.url(self.name + "/"), headers={"Host": "inspector.external"})
Esempio n. 10
0
    def queries(self):
        # 0
        yield Query(self.url("ambassador/v0/diag/?json=true&filter=errors"),
                    headers={"Host": "tls-context-host-2"},
                    insecure=True,
                    sni=True)

        # 1 - Correct host #1
        yield Query(self.url("tls-context-same/"),
                    headers={"Host": "tls-context-host-1"},
                    expected=200,
                    insecure=True,
                    sni=True)
        # 2 - Correct host #2
        yield Query(self.url("tls-context-same/"),
                    headers={"Host": "tls-context-host-2"},
                    expected=200,
                    insecure=True,
                    sni=True)

        # 3 - Incorrect host
        yield Query(
            self.url("tls-context-same/"),
            headers={"Host": "tls-context-host-3"},
            # error=self._go_close_connection_error(self.url("tls-context-same/")),
            expected=404,
            insecure=True)

        # 4 - Incorrect path, correct host
        yield Query(self.url("tls-context-different/"),
                    headers={"Host": "tls-context-host-1"},
                    expected=404,
                    insecure=True,
                    sni=True)

        # Other mappings with no host will respond with the fallbock cert.
        # 5 - no Host header, fallback cert from the TLS module
        yield Query(
            self.url(self.name + "/"),
            # error=self._go_close_connection_error(self.url(self.name + "/")),
            insecure=True)

        # 6 - explicit Host header, fallback cert
        yield Query(
            self.url(self.name + "/"),
            # error=self._go_close_connection_error(self.url(self.name + "/")),
            # sni=True,
            headers={"Host": "tls-context-host-3"},
            insecure=True)

        # 7 - explicit Host header 1 wins, we'll get the SNI cert for this overlapping path
        yield Query(self.url(self.name + "/"),
                    headers={"Host": "tls-context-host-1"},
                    expected=200,
                    insecure=True,
                    sni=True)

        # 7 - explicit Host header 2 wins, we'll get the SNI cert for this overlapping path
        yield Query(self.url(self.name + "/"),
                    headers={"Host": "tls-context-host-2"},
                    expected=200,
                    insecure=True,
                    sni=True)
Esempio n. 11
0
 def queries(self):
     yield Query(self.url("server-name/"), expected=301)
Esempio n. 12
0
 def queries(self):
     yield Query(self.url(self.name + "/"),
                 error=[
                     'connection refused', 'connection reset by peer',
                     'EOF', 'request canceled'
                 ])
Esempio n. 13
0
 def queries(self):
     yield Query(self.url("tls-target/"), insecure=True)
Esempio n. 14
0
 def queries(self):
     yield Query(self.url(self.name + "/"))
     yield Query(self.url(self.name + "-files/"))
 def queries(self):
     yield Query(self.url("config_dump"), phase=2)
Esempio n. 16
0
 def queries(self):
     yield Query(self.parent.url("ambassador/v0/diag/?json=true&filter=errors"))
Esempio n. 17
0
 def queries(self):
     # Speak through each Ambassador to the traced service...
     yield Query(self.url("target-64/"), phase=1)
     # ...then ask the Zipkin for services and spans. Including debug=True in these queries
     # is particularly helpful.
     yield Query("http://zipkin-64:9411/api/v2/traces", phase=2)
Esempio n. 18
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"))
Esempio n. 19
0
 def queries(self):
     yield Query(self.url("ambassador/v0/diag/?json=true"))
Esempio n. 20
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/anything?itworked=true"), expected=301)
     yield Query(self.parent.url(self.name.upper() + "/anything?itworked=true"), expected=404)
     yield Query(self.parent.url(self.name + "-2/anything?itworked=true"), expected=301)
     yield Query(self.parent.url(self.name.upper() + "-2/anything?itworked=true"), expected=301)
Esempio n. 21
0
 def queries(self):
     yield Query(self.url("target/"),
                 headers={"Requested-Status": "200"},
                 expected=200)
Esempio n. 22
0
 def queries(self):
     for i in range(100):
         yield Query(self.parent.url(self.name + "/"))
Esempio n. 23
0
 def queries(self):
     yield Query(self.url("target/"),
                 headers={"Accept-Encoding": "gzip"},
                 expected=200)
Esempio n. 24
0
 def queries(self):
     yield Query(self.parent.url(self.name)+"/response-headers?zoo=Zoo&test=Test&koo=Koot")
Esempio n. 25
0
    def queries(self):
        # Deregister the Consul services in phase 0.
        yield Query(self.format(
            "http://{self.path.k8s}-consul:8500/v1/catalog/deregister"),
                    method="PUT",
                    body={
                        "Datacenter": "dc1",
                        "Node": self.format("{self.path.k8s}-consul-service")
                    },
                    phase=0)
        yield Query(self.format(
            "http://{self.path.k8s}-consul:8500/v1/catalog/deregister"),
                    method="PUT",
                    body={
                        "Datacenter": "dc1",
                        "Node":
                        self.format("{self.path.k8s}-consul-ns-service")
                    },
                    phase=0)
        yield Query(self.format(
            "http://{self.path.k8s}-consul:8500/v1/catalog/deregister"),
                    method="PUT",
                    body={
                        "Datacenter": "dc1",
                        "Node": self.format("{self.path.k8s}-consul-node")
                    },
                    phase=0)

        # The K8s service should be OK. The Consul services should 503 since they have no upstreams
        # in phase 1.
        yield Query(self.url(self.format("{self.path.k8s}_k8s/")),
                    expected=200,
                    phase=1)
        yield Query(self.url(self.format("{self.path.k8s}_consul/")),
                    expected=503,
                    phase=1)
        yield Query(self.url(self.format("{self.path.k8s}_consul_ns/")),
                    expected=503,
                    phase=1)
        yield Query(self.url(self.format("{self.path.k8s}_consul_node/")),
                    expected=503,
                    phase=1)

        # Register the Consul services in phase 2.
        yield Query(self.format(
            "http://{self.path.k8s}-consul:8500/v1/catalog/register"),
                    method="PUT",
                    body={
                        "Datacenter": "dc1",
                        "Node": self.format("{self.path.k8s}-consul-service"),
                        "Address": self.k8s_target.path.k8s,
                        "Service": {
                            "Service":
                            self.format("{self.path.k8s}-consul-service"),
                            "Address":
                            self.k8s_target.path.k8s,
                            "Port":
                            80
                        }
                    },
                    phase=2)
        yield Query(
            self.format(
                "http://{self.path.k8s}-consul:8500/v1/catalog/register"),
            method="PUT",
            body={
                "Datacenter":
                "dc1",
                "Node":
                self.format("{self.path.k8s}-consul-ns-service"),
                "Address":
                self.format(
                    "{self.k8s_ns_target.path.k8s}.consul-test-namespace"),
                "Service": {
                    "Service":
                    self.format("{self.path.k8s}-consul-ns-service"),
                    "Address":
                    self.format(
                        "{self.k8s_ns_target.path.k8s}.consul-test-namespace"),
                    "Port":
                    80
                }
            },
            phase=2)
        yield Query(self.format(
            "http://{self.path.k8s}-consul:8500/v1/catalog/register"),
                    method="PUT",
                    body={
                        "Datacenter": "dc1",
                        "Node": self.format("{self.path.k8s}-consul-node"),
                        "Address": self.k8s_target.path.k8s,
                        "Service": {
                            "Service":
                            self.format("{self.path.k8s}-consul-node"),
                            "Port": 80
                        }
                    },
                    phase=2)

        # All services should work in phase 3.
        yield Query(self.url(self.format("{self.path.k8s}_k8s/")),
                    expected=200,
                    phase=3)
        yield Query(self.url(self.format("{self.path.k8s}_consul/")),
                    expected=200,
                    phase=3)
        yield Query(self.url(self.format("{self.path.k8s}_consul_ns/")),
                    expected=200,
                    phase=3)
        yield Query(self.url(self.format("{self.path.k8s}_consul_node/")),
                    expected=200,
                    phase=3)
Esempio n. 26
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/headers"), headers={
         "zoo": "ZooZ",
         "aoo": "AooA",
         "foo": "FooF"
     })
Esempio n. 27
0
 def queries(self):
     # [0]
     yield Query(self.url("tls-target/"), expected=301)
Esempio n. 28
0
 def queries(self):
     yield Query(self.parent.url(self.name + "/"))
     yield Query(self.parent.url(f'need-normalization/../{self.name}/'))
Esempio n. 29
0
 def requirements(self):
     yield ("url", Query("http://%s" % self.path.fqdn))
     yield ("url", Query("https://%s" % self.path.fqdn))
Esempio n. 30
0
 def requirements(self):
     yield from super().requirements()
     yield ("url", Query(self.url("config_dump")))