mirror of
https://github.com/juanfont/headscale.git
synced 2025-07-30 02:53:43 +00:00

The integration tests were failing with timeout errors when running route-related operations like ApproveRoutes. The issue was that the CLI timeout was set to 5 seconds by default, but the containerized test environment with network latency and startup delays required more time for CLI operations to complete. This fix increases the CLI timeout to 30 seconds specifically for integration tests through the HEADSCALE_CLI_TIMEOUT environment variable. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.9 KiB
Go
44 lines
1.9 KiB
Go
package hsic
|
|
|
|
import "github.com/juanfont/headscale/hscontrol/types"
|
|
|
|
func MinimumConfigYAML() string {
|
|
return `
|
|
private_key_path: /tmp/private.key
|
|
noise:
|
|
private_key_path: /tmp/noise_private.key
|
|
`
|
|
}
|
|
|
|
func DefaultConfigEnv() map[string]string {
|
|
return map[string]string{
|
|
"HEADSCALE_LOG_LEVEL": "trace",
|
|
"HEADSCALE_POLICY_PATH": "",
|
|
"HEADSCALE_DATABASE_TYPE": "sqlite",
|
|
"HEADSCALE_DATABASE_SQLITE_PATH": "/tmp/integration_test_db.sqlite3",
|
|
"HEADSCALE_DATABASE_DEBUG": "0",
|
|
"HEADSCALE_DATABASE_GORM_SLOW_THRESHOLD": "1",
|
|
"HEADSCALE_EPHEMERAL_NODE_INACTIVITY_TIMEOUT": "30m",
|
|
"HEADSCALE_PREFIXES_V4": "100.64.0.0/10",
|
|
"HEADSCALE_PREFIXES_V6": "fd7a:115c:a1e0::/48",
|
|
"HEADSCALE_DNS_BASE_DOMAIN": "headscale.net",
|
|
"HEADSCALE_DNS_MAGIC_DNS": "true",
|
|
"HEADSCALE_DNS_OVERRIDE_LOCAL_DNS": "false",
|
|
"HEADSCALE_DNS_NAMESERVERS_GLOBAL": "127.0.0.11 1.1.1.1",
|
|
"HEADSCALE_PRIVATE_KEY_PATH": "/tmp/private.key",
|
|
"HEADSCALE_NOISE_PRIVATE_KEY_PATH": "/tmp/noise_private.key",
|
|
"HEADSCALE_METRICS_LISTEN_ADDR": "0.0.0.0:9090",
|
|
"HEADSCALE_DERP_URLS": "https://controlplane.tailscale.com/derpmap/default",
|
|
"HEADSCALE_DERP_AUTO_UPDATE_ENABLED": "false",
|
|
"HEADSCALE_DERP_UPDATE_FREQUENCY": "1m",
|
|
|
|
// CLI timeout for integration tests - needs to be longer than the default 5s
|
|
// to account for container startup delays and network latency
|
|
"HEADSCALE_CLI_TIMEOUT": "30s",
|
|
|
|
// a bunch of tests (ACL/Policy) rely on predictable IP alloc,
|
|
// so ensure the sequential alloc is used by default.
|
|
"HEADSCALE_PREFIXES_ALLOCATION": string(types.IPAllocationStrategySequential),
|
|
}
|
|
}
|