Skip to content
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: E2E tests #20296

Merged
merged 3 commits into from
Apr 5, 2024
Merged

tproxy: E2E tests #20296

merged 3 commits into from
Apr 5, 2024

Conversation

tgross
Copy link
Member

@tgross tgross commented Apr 4, 2024

Add the consul-cni plugin to the Linux AMI for E2E, and add a test case that covers the transparent proxy feature.

Ref: #20175


$ go test -v -count=1 ./e2e/connect
=== RUN   TestConnect_LegacyACLs
=== RUN   TestConnect_LegacyACLs/ConnectDemo
=== RUN   TestConnect_LegacyACLs/ConnectDemoNamespaced
=== RUN   TestConnect_LegacyACLs/ConnectNativeDemo
=== RUN   TestConnect_LegacyACLs/ConnectIngressGatewayDemo
=== RUN   TestConnect_LegacyACLs/ConnectTerminatingGateway
--- PASS: TestConnect_LegacyACLs (111.16s)
    --- PASS: TestConnect_LegacyACLs/ConnectDemo (36.82s)
    --- PASS: TestConnect_LegacyACLs/ConnectDemoNamespaced (30.67s)
    --- PASS: TestConnect_LegacyACLs/ConnectNativeDemo (15.45s)
    --- PASS: TestConnect_LegacyACLs/ConnectIngressGatewayDemo (14.45s)
    --- PASS: TestConnect_LegacyACLs/ConnectTerminatingGateway (13.49s)
=== RUN   Test_serviceOfSIToken
--- PASS: Test_serviceOfSIToken (0.00s)
=== RUN   TestConnect_ClientRestart
    client_test.go:17: skipping test that does nomad agent restart
--- SKIP: TestConnect_ClientRestart (0.00s)
=== RUN   TestConnect
=== RUN   TestConnect/ConnectDemo
=== RUN   TestConnect/ConnectCustomSidecarExposed
=== RUN   TestConnect/ConnectNativeDemo
=== RUN   TestConnect/ConnectIngressGatewayDemo
=== RUN   TestConnect/ConnectMultiIngress
=== RUN   TestConnect/ConnectTerminatingGateway
=== RUN   TestConnect/ConnectMultiService
=== RUN   TestConnect/ConnectTransparentProxy
--- PASS: TestConnect (143.11s)
    --- PASS: TestConnect/ConnectDemo (21.42s)
    --- PASS: TestConnect/ConnectCustomSidecarExposed (22.34s)
    --- PASS: TestConnect/ConnectNativeDemo (15.30s)
    --- PASS: TestConnect/ConnectIngressGatewayDemo (15.29s)
    --- PASS: TestConnect/ConnectMultiIngress (15.33s)
    --- PASS: TestConnect/ConnectTerminatingGateway (13.36s)
    --- PASS: TestConnect/ConnectMultiService (16.33s)
    --- PASS: TestConnect/ConnectTransparentProxy (23.45s)
PASS
ok      github.com/hashicorp/nomad/e2e/connect  254.287s

Copy link
Member

@gulducat gulducat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's all coming together! few little nitpicks, and one question about the test assertions.

e2e/connect/connect_test.go Outdated Show resolved Hide resolved
e2e/terraform/packer/ubuntu-jammy-amd64/setup.sh Outdated Show resolved Hide resolved
e2e/terraform/packer/ubuntu-jammy-amd64/setup.sh Outdated Show resolved Hide resolved
Comment on lines +73 to +74
curl -LO https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really didn't already have Go installed on these boxes? I'd put this under its own little heading, even if it's only currently used for "consul-k8s".

unless you're piling these things together to be also removed in bulk after 1.4.2 is shipped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't generally need toolchains on these machines. And yeah, I was putting them all together so they're easy to find and remove once 1.4.2 ships.

e2e/connect/connect_test.go Show resolved Hide resolved
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Add the `consul-cni` plugin to the Linux AMI for E2E, and add a test case that
covers the transparent proxy feature.

Ref: #20175
@tgross
Copy link
Member Author

tgross commented Apr 5, 2024

After addressing code review comments:

$ go test -v -count=1 ./connect
=== RUN   TestConnect_LegacyACLs
=== RUN   TestConnect_LegacyACLs/ConnectDemo
=== RUN   TestConnect_LegacyACLs/ConnectDemoNamespaced
=== RUN   TestConnect_LegacyACLs/ConnectNativeDemo
=== RUN   TestConnect_LegacyACLs/ConnectIngressGatewayDemo
=== RUN   TestConnect_LegacyACLs/ConnectTerminatingGateway
--- PASS: TestConnect_LegacyACLs (93.03s)
    --- PASS: TestConnect_LegacyACLs/ConnectDemo (24.84s)
    --- PASS: TestConnect_LegacyACLs/ConnectDemoNamespaced (25.66s)
    --- PASS: TestConnect_LegacyACLs/ConnectNativeDemo (14.41s)
    --- PASS: TestConnect_LegacyACLs/ConnectIngressGatewayDemo (13.39s)
    --- PASS: TestConnect_LegacyACLs/ConnectTerminatingGateway (14.48s)
=== RUN   Test_serviceOfSIToken
--- PASS: Test_serviceOfSIToken (0.00s)
=== RUN   TestConnect_ClientRestart
    client_test.go:17: skipping test that does nomad agent restart
--- SKIP: TestConnect_ClientRestart (0.00s)
=== RUN   TestConnect
=== RUN   TestConnect/ConnectDemo
=== RUN   TestConnect/ConnectCustomSidecarExposed
=== RUN   TestConnect/ConnectNativeDemo
=== RUN   TestConnect/ConnectIngressGatewayDemo
=== RUN   TestConnect/ConnectMultiIngress
=== RUN   TestConnect/ConnectTerminatingGateway
=== RUN   TestConnect/ConnectMultiService
=== RUN   TestConnect/ConnectTransparentProxy
--- PASS: TestConnect (145.09s)
    --- PASS: TestConnect/ConnectDemo (24.78s)
    --- PASS: TestConnect/ConnectCustomSidecarExposed (16.35s)
    --- PASS: TestConnect/ConnectNativeDemo (14.32s)
    --- PASS: TestConnect/ConnectIngressGatewayDemo (13.29s)
    --- PASS: TestConnect/ConnectMultiIngress (14.36s)
    --- PASS: TestConnect/ConnectTerminatingGateway (14.41s)
    --- PASS: TestConnect/ConnectMultiService (15.43s)
    --- PASS: TestConnect/ConnectTransparentProxy (31.90s)
PASS
ok      github.com/hashicorp/nomad/e2e/connect  238.124s

@tgross tgross merged commit 548adb0 into f-tproxy Apr 5, 2024
19 checks passed
@tgross tgross deleted the f-tproxy-e2e branch April 5, 2024 18:23
tgross added a commit that referenced this pull request Apr 12, 2024
In #20296 we added a Go tool chain to the AMI we use for E2E tests, so that we
can build `consul-cni` for tproxy testing. This is intended to be temporary
until `consul-k8s` 1.4.2 is officially released. But the Go cache from building
`consul-k8s` uses up roughly 1.5GiB of space and the test machines have fairly
small disks. This causes the Nomad clients to aggressively GC client allocations
that stop, which breaks tests that run batch workloads and then read their logs.
tgross added a commit that referenced this pull request Apr 12, 2024
In #20296 we added a Go tool chain to the AMI we use for E2E tests, so that we
can build `consul-cni` for tproxy testing. This is intended to be temporary
until `consul-k8s` 1.4.2 is officially released. But the Go cache from building
`consul-k8s` uses up roughly 1.5GiB of space and the test machines have fairly
small disks. This causes the Nomad clients to aggressively GC client allocations
that stop, which breaks tests that run batch workloads and then read their logs.
philrenaud pushed a commit that referenced this pull request Apr 18, 2024
Add the `consul-cni` plugin to the Linux AMI for E2E, and add a test case that
covers the transparent proxy feature. Add test assertions to the Connect tests
for upstream reachability

Ref: #20175
philrenaud pushed a commit that referenced this pull request Apr 18, 2024
In #20296 we added a Go tool chain to the AMI we use for E2E tests, so that we
can build `consul-cni` for tproxy testing. This is intended to be temporary
until `consul-k8s` 1.4.2 is officially released. But the Go cache from building
`consul-k8s` uses up roughly 1.5GiB of space and the test machines have fairly
small disks. This causes the Nomad clients to aggressively GC client allocations
that stop, which breaks tests that run batch workloads and then read their logs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/consul/connect Consul Connect integration theme/e2e theme/testing Test related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants