From cad0cb2f5c1107c2332f90590141470cbbad6e76 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 12 Apr 2026 21:39:27 +0000 Subject: [PATCH] ci,lint: fix lint issues and add TestSubnetToSubnetACL to workflow Updates #3157 --- .github/workflows/test-integration.yaml | 1 + hscontrol/types/testcapture/header.go | 6 +++--- integration/route_test.go | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 7ad16ba0..2af3bc6f 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -249,6 +249,7 @@ jobs: - TestAutoApproveMultiNetwork/webauth-group.* - TestSubnetRouteACLFiltering - TestGrantViaSubnetSteering + - TestSubnetToSubnetACL - TestHeadscale - TestTailscaleNodesJoiningHeadcale - TestSSHOneUserToAll diff --git a/hscontrol/types/testcapture/header.go b/hscontrol/types/testcapture/header.go index e102ca65..ffc63fc1 100644 --- a/hscontrol/types/testcapture/header.go +++ b/hscontrol/types/testcapture/header.go @@ -49,15 +49,15 @@ func CommentHeader(c *Capture) string { } if !c.CapturedAt.IsZero() { - b.WriteString(fmt.Sprintf("Captured at: %s\n", c.CapturedAt.UTC().Format("2006-01-02T15:04:05Z"))) + fmt.Fprintf(&b, "Captured at: %s\n", c.CapturedAt.UTC().Format("2006-01-02T15:04:05Z")) } if c.ToolVersion != "" { - b.WriteString(fmt.Sprintf("tscap version: %s\n", c.ToolVersion)) + fmt.Fprintf(&b, "tscap version: %s\n", c.ToolVersion) } if c.SchemaVersion != 0 { - b.WriteString(fmt.Sprintf("schema version: %d\n", c.SchemaVersion)) + fmt.Fprintf(&b, "schema version: %d\n", c.SchemaVersion) } return strings.TrimRight(b.String(), "\n") diff --git a/integration/route_test.go b/integration/route_test.go index 0ce30573..14f2ca59 100644 --- a/integration/route_test.go +++ b/integration/route_test.go @@ -3495,8 +3495,8 @@ func TestGrantViaSubnetSteering(t *testing.T) { } // TestSubnetToSubnetACL verifies that when ACL rules reference only subnet -// CIDRs as source and destination, the subnet routers for those subnets -// see each other as peers and exchange routes, enabling end-to-end +// CIDRs as source and destination, the subnet routers for those subnets see +// each other as peers and exchange routes, enabling end-to-end // connectivity between the two physical subnets. // // This is a regression test for https://github.com/juanfont/headscale/issues/3157 @@ -3522,6 +3522,7 @@ func TestSubnetToSubnetACL(t *testing.T) { scenario, err := NewScenario(spec) require.NoErrorf(t, err, "failed to create scenario: %s", err) + defer scenario.ShutdownAssertNoPanics(t) prefA, err := scenario.SubnetOfNetwork("usernet1") @@ -3592,6 +3593,7 @@ func TestSubnetToSubnetACL(t *testing.T) { // Wait for advertisements to propagate. var nodes []*v1.Node + assert.EventuallyWithT(t, func(c *assert.CollectT) { nodes, err = headscale.ListNodes() assert.NoError(c, err)