mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-12 19:09:14 +09:00
ci,lint: fix lint issues and add TestSubnetToSubnetACL to workflow
Updates #3157
This commit is contained in:
@@ -249,6 +249,7 @@ jobs:
|
||||
- TestAutoApproveMultiNetwork/webauth-group.*
|
||||
- TestSubnetRouteACLFiltering
|
||||
- TestGrantViaSubnetSteering
|
||||
- TestSubnetToSubnetACL
|
||||
- TestHeadscale
|
||||
- TestTailscaleNodesJoiningHeadcale
|
||||
- TestSSHOneUserToAll
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user