mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 15:26:40 +00:00
- Add debug endpoint for monitoring netbird clients - Add types package with AccountID type - Refactor netbird roundtrip to key clients by AccountID - Multiple domains can share the same client per account - Add status notifier for tunnel connection updates - Add OIDC flags to CLI - Add tests for netbird client management
49 lines
958 B
Go
49 lines
958 B
Go
package proxy
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestDebugEndpointDisabledByDefault(t *testing.T) {
|
|
s := &Server{}
|
|
assert.False(t, s.DebugEndpointEnabled, "debug endpoint should be disabled by default")
|
|
}
|
|
|
|
func TestDebugEndpointAddr(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
input string
|
|
expected string
|
|
}{
|
|
{
|
|
name: "empty defaults to localhost",
|
|
input: "",
|
|
expected: "localhost:8444",
|
|
},
|
|
{
|
|
name: "explicit localhost preserved",
|
|
input: "localhost:9999",
|
|
expected: "localhost:9999",
|
|
},
|
|
{
|
|
name: "explicit address preserved",
|
|
input: "0.0.0.0:8444",
|
|
expected: "0.0.0.0:8444",
|
|
},
|
|
{
|
|
name: "127.0.0.1 preserved",
|
|
input: "127.0.0.1:8444",
|
|
expected: "127.0.0.1:8444",
|
|
},
|
|
}
|
|
|
|
for _, tc := range tests {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
result := debugEndpointAddr(tc.input)
|
|
assert.Equal(t, tc.expected, result)
|
|
})
|
|
}
|
|
}
|