Skip to content

migrate TestAPISwarmCAHash to Integration Test#51837

Merged
robmry merged 1 commit intomoby:masterfrom
2003Aditya:TestSwarmCAHash
Feb 15, 2026
Merged

migrate TestAPISwarmCAHash to Integration Test#51837
robmry merged 1 commit intomoby:masterfrom
2003Aditya:TestSwarmCAHash

Conversation

@2003Aditya
Copy link
Contributor

- What I did

Migrated the TestSwarmCAHash test from integration-cli/docker_api_swarm_test.go to the new integration test framework under integration/service/swarm_test.go.

@2003Aditya 2003Aditya force-pushed the TestSwarmCAHash branch 3 times, most recently from a4c21e4 to 05d1c78 Compare January 11, 2026 09:32
@robmry robmry changed the title migrate TestSwarmCAHash to Integration Test migrate TestAPISwarmCAHash to Integration Test Jan 12, 2026
@robmry
Copy link
Contributor

robmry commented Jan 12, 2026

The new test is failing with this, all Swarm tests will need to be skipped for-now when the daemon's using nftables ...

=== FAIL: amd64.docker.docker.integration.service TestSwarmCAHash (1.93s)
    swarm_test.go:33: assertion failed: expected error to contain "remote CA does not match fingerprint", got "Error response from daemon: --firewall-backend=nftables is incompatible with swarm mode"

@robmry
Copy link
Contributor

robmry commented Jan 12, 2026

Oh, I see - the test's starting two daemons ... but only one of them's started with NewSwarm - which adds an --iptables=false argument, so it doesn't matter that the tests are configured to use nftables because all firewalling is disabled. The error will be from the other daemon.

I think it'd be best to skip the test if the main daemon's using nftables. So, it'll be something like:

	skip.If(t, strings.HasPrefix(testEnv.FirewallBackendDriver(), "nftables"), "swarm cannot be used with nftables")

@2003Aditya 2003Aditya force-pushed the TestSwarmCAHash branch 2 times, most recently from 39a154c to 8669d9c Compare January 29, 2026 22:54
Comment on lines +15 to +16
ctx := setupTest(t)
skip.If(t, strings.HasPrefix(testEnv.FirewallBackendDriver(), "nftables"), "swarm cannot be used with nftables")
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no need to setupTest if the test is going to be skipped - best to swap these lines?

Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
@robmry robmry merged commit 1f71f22 into moby:master Feb 15, 2026
212 of 215 checks passed
@vvoland vvoland added this to the 29.3.0 milestone Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants