2020-05-19 18:00:00 +00:00
|
|
|
// +build integration
|
|
|
|
|
|
|
|
package envoy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestEnvoy(t *testing.T) {
|
|
|
|
var testcases = []string{
|
|
|
|
"case-badauthz",
|
|
|
|
"case-basic",
|
|
|
|
"case-centralconf",
|
|
|
|
"case-cfg-resolver-dc-failover-gateways-none",
|
|
|
|
"case-cfg-resolver-dc-failover-gateways-remote",
|
|
|
|
"case-cfg-resolver-defaultsubset",
|
2020-07-09 22:04:51 +00:00
|
|
|
"case-cfg-resolver-features",
|
2020-05-19 18:00:00 +00:00
|
|
|
"case-cfg-resolver-subset-onlypassing",
|
|
|
|
"case-cfg-resolver-subset-redirect",
|
|
|
|
"case-cfg-resolver-svc-failover",
|
|
|
|
"case-cfg-resolver-svc-redirect-http",
|
|
|
|
"case-cfg-resolver-svc-redirect-tcp",
|
2020-07-09 22:04:51 +00:00
|
|
|
"case-cfg-router-features",
|
|
|
|
"case-cfg-splitter-features",
|
2020-05-19 18:00:00 +00:00
|
|
|
"case-consul-exec",
|
|
|
|
"case-dogstatsd-udp",
|
|
|
|
"case-gateways-local",
|
|
|
|
"case-gateways-remote",
|
|
|
|
"case-gateway-without-services",
|
|
|
|
"case-grpc",
|
|
|
|
"case-http",
|
|
|
|
"case-http-badauthz",
|
|
|
|
"case-ingress-gateway-http",
|
|
|
|
"case-ingress-gateway-multiple-services",
|
|
|
|
"case-ingress-gateway-simple",
|
2020-07-07 15:43:04 +00:00
|
|
|
"case-ingress-gateway-tls",
|
2020-05-19 18:00:00 +00:00
|
|
|
"case-ingress-mesh-gateways-resolver",
|
|
|
|
"case-multidc-rsa-ca",
|
|
|
|
"case-prometheus",
|
|
|
|
"case-statsd-udp",
|
|
|
|
"case-stats-proxy",
|
2020-06-03 21:28:45 +00:00
|
|
|
"case-terminating-gateway-hostnames",
|
2020-05-19 18:00:00 +00:00
|
|
|
"case-terminating-gateway-simple",
|
|
|
|
"case-terminating-gateway-subsets",
|
|
|
|
"case-terminating-gateway-without-services",
|
|
|
|
"case-upstream-config",
|
|
|
|
"case-wanfed-gw",
|
|
|
|
"case-zipkin",
|
|
|
|
}
|
|
|
|
|
|
|
|
runCmd(t, "suite_setup")
|
|
|
|
defer runCmd(t, "suite_teardown")
|
|
|
|
|
|
|
|
for _, tc := range testcases {
|
|
|
|
t.Run(tc, func(t *testing.T) {
|
2020-06-02 23:24:52 +00:00
|
|
|
caseDir := "CASE_DIR=" + tc
|
|
|
|
|
|
|
|
t.Cleanup(func() {
|
|
|
|
if t.Failed() {
|
|
|
|
runCmd(t, "capture_logs", caseDir)
|
|
|
|
}
|
|
|
|
|
|
|
|
runCmd(t, "test_teardown", caseDir)
|
|
|
|
})
|
|
|
|
|
|
|
|
runCmd(t, "run_tests", caseDir)
|
2020-05-19 18:00:00 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func runCmd(t *testing.T, c string, env ...string) {
|
|
|
|
t.Helper()
|
|
|
|
|
|
|
|
cmd := exec.Command("./run-tests.sh", c)
|
|
|
|
cmd.Env = append(os.Environ(), env...)
|
|
|
|
cmd.Stdout = os.Stdout
|
|
|
|
cmd.Stderr = os.Stderr
|
|
|
|
if err := cmd.Run(); err != nil {
|
|
|
|
t.Fatalf("command failed: %v", err)
|
|
|
|
}
|
|
|
|
}
|