-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TProxy integration test #17103
TProxy integration test #17103
Conversation
test/integration/consul-container/libs/service/assets/Dockerfile-consul-envoy
Outdated
Show resolved
Hide resolved
test/integration/consul-container/libs/service/assets/Dockerfile-consul-envoy
Show resolved
Hide resolved
"-exclude-inbound-port", "8302", | ||
"-exclude-inbound-port", "8500", | ||
"-exclude-inbound-port", "8502", | ||
"-exclude-inbound-port", "8600", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all the Consul client ports that needed to be excluded from traffic redirection rules because Consul and Envoy share a network namespace.
Mode: mgwMode, | ||
}, | ||
}}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I configured this so that tproxy is a toggle (🤷). If tproxy is enabled, we do not need to include an explicit upstream. If tproxy is not enabled, then include the explicit upstream.
I'll defer to others on how we want to structure these.
ef46c4f
to
4f1373f
Compare
func assertHTTPRequestToVirtualAddress(t *testing.T, clientService libservice.Service) { | ||
timer := &retry.Timer{Timeout: 120 * time.Second, Wait: 500 * time.Millisecond} | ||
|
||
retry.RunWith(timer, t, func(r *retry.R) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a retry loop for this check and moved into a function.
t.Logf("making call to upstream\nerr = %v\nout = %s", err, out) | ||
require.NoError(r, err) | ||
require.Regexp(r, `Virtual IP: 240.0.0.\d+`, out) | ||
require.Contains(r, out, "FORTIO_NAME=static-server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to validate the response is from the upstream static-server (similar to libassert.AssertFortioName
)
ef38f71
to
5334082
Compare
Previously, when test splitting allocated multiple test directories to a runner, the workflow ran `go tests "./test/dir1 ./test/dir2"` which results in a directory not found error. This fixes that.
Description
This is a basic integration test for TProxy:
consul connect redirect-traffic
command to apply iptables rulesThis took some fiddling to setup, so there are some workarounds for the moment:
Testing & Reproduction steps
PR Checklist