mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-17 10:46:57 +01:00
Bind sshd, dns and stats listeners in the reload so a bind failure fails it
This commit is contained in:
7 files changed
+184
-51
No files matched your search
@@ -279,3 +279,15 @@ func TestSSHExecExitStatusReflectsTheCommand(t *testing.T) {
|
||||
assert.Equal(t, 1, exit.ExitStatus())
|
||||
assert.True(t, strings.HasPrefix(string(out), "did not understand: nope\nAvailable commands:\n"), string(out))
|
||||
}
|
||||
|
||||
// A reload that can't bind the new address says so, rather than finding out in the background
|
||||
func TestSSHDReload_BusyPortFails(t *testing.T) {
|
||||
h := newSSHDReloadHarness(t)
|
||||
busy, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { _ = busy.Close() })
|
||||
|
||||
res := h.c.ReloadConfigString(strings.Replace(h.config(), "127.0.0.1:0", busy.Addr().String(), 1))
|
||||
require.NoError(t, res.Err)
|
||||
assert.True(t, res.Failed)
|
||||
}
|
||||
Reference in new issue
Block a user