mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: fail server startup on invalid DERP map (#10536)
This commit is contained in:
@ -1755,3 +1755,22 @@ func TestConnectToPostgres(t *testing.T) {
|
||||
})
|
||||
require.NoError(t, sqlDB.PingContext(ctx))
|
||||
}
|
||||
|
||||
func TestServer_InvalidDERP(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// Try to start a server with the built-in DERP server disabled and no
|
||||
// external DERP map.
|
||||
inv, _ := clitest.New(t,
|
||||
"server",
|
||||
"--in-memory",
|
||||
"--http-address", ":0",
|
||||
"--access-url", "http://example.com",
|
||||
"--derp-server-enable=false",
|
||||
"--derp-server-stun-addresses", "disable",
|
||||
"--block-direct-connections",
|
||||
)
|
||||
err := inv.Run()
|
||||
require.Error(t, err)
|
||||
require.ErrorContains(t, err, "A valid DERP map is required for networking to work")
|
||||
}
|
||||
|
Reference in New Issue
Block a user