Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2018-06-28 13:14:18 -07:00
parent a573a5da36
commit 719deacc3d
5 changed files with 17 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
include 'platform.conf'
port: 2233
# logging options
debug: true # enable on reload
trace: true # enable on reload

View File

@@ -1,3 +1,5 @@
port: 2233
# logging options
debug: false
trace: false

View File

@@ -25,6 +25,6 @@ tls {
authorization {
user: derek
password: buckley
password: monkey
timeout: 1
}

View File

@@ -54,7 +54,7 @@ func TestConfigReloadUnsupported(t *testing.T) {
golden := &Options{
ConfigFile: config,
Host: "0.0.0.0",
Port: 4222,
Port: 2233,
AuthTimeout: 1.0,
Debug: false,
Trace: false,
@@ -144,7 +144,7 @@ func TestConfigReloadInvalidConfig(t *testing.T) {
golden := &Options{
ConfigFile: config,
Host: "0.0.0.0",
Port: 4222,
Port: 2233,
AuthTimeout: 1.0,
Debug: false,
Trace: false,
@@ -210,7 +210,7 @@ func TestConfigReload(t *testing.T) {
golden := &Options{
ConfigFile: config,
Host: "0.0.0.0",
Port: 4222,
Port: 2233,
AuthTimeout: 1.0,
Debug: false,
Trace: false,

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"syscall"
"testing"
@@ -102,6 +103,14 @@ func TestSignalToReloadConfig(t *testing.T) {
}
func TestProcessSignalNoProcesses(t *testing.T) {
pgrepBefore := pgrep
pgrep = func() ([]byte, error) {
return nil, &exec.ExitError{}
}
defer func() {
pgrep = pgrepBefore
}()
err := ProcessSignal(CommandStop, "")
if err == nil {
t.Fatal("Expected error")