Merge branch 'master' of github.com:nats-io/gnatsd into fix_comment

This commit is contained in:
Tyler Treat
2017-07-10 19:00:49 -05:00
24 changed files with 35 additions and 37 deletions

View File

@@ -21,7 +21,6 @@ before_script:
- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]]; then ./scripts/cross_compile.sh $TRAVIS_TAG; fi
script:
- go test -i -race $EXCLUDE_VENDOR
- go test -v -race $EXCLUDE_VENDOR
- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]]; then ./scripts/cov.sh TRAVIS; else go test -v -race $EXCLUDE_VENDOR; fi
after_success:
- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]]; then ./scripts/cov.sh TRAVIS; fi
- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]] && [ "$TRAVIS_TAG" != "" ]; ghr --owner nats-io --token $GITHUB_TOKEN --draft --replace $TRAVIS_TAG pkg/; fi
- if [[ "$TRAVIS_GO_VERSION" == 1.7.* ]] && [ "$TRAVIS_TAG" != "" ]; then ghr --owner nats-io --token $GITHUB_TOKEN --draft --replace $TRAVIS_TAG pkg/; fi

View File

@@ -6,7 +6,7 @@ go get github.com/tcnksm/ghr
export APPNAME="gnatsd"
export OSARCH="linux/386 linux/amd64 darwin/amd64 windows/386 windows/amd64"
export DIRS="linux-386 linux-amd64 linux-arm5 linux-arm7 darwin-amd64 windows-386 windows-amd64"
export DIRS="linux-386 linux-amd64 linux-arm6 linux-arm7 darwin-amd64 windows-386 windows-amd64"
export OUTDIR="pkg"
# If we have an arg, assume its a version tag and rename as appropriate.
@@ -18,8 +18,8 @@ fi
env CGO_ENABLED=0 gox -osarch="$OSARCH" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-{{.OS}}-{{.Arch}}/gnatsd"
# Be explicit about the ARM builds
# ARMv5
env CGO_ENABLED=0 GOARM=5 gox -osarch="linux/arm" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-linux-arm5/gnatsd"
# ARMv6
env CGO_ENABLED=0 GOARM=6 gox -osarch="linux/arm" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-linux-arm6/gnatsd"
# ARMv7
env CGO_ENABLED=0 GOARM=7 gox -osarch="linux/arm" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-linux-arm7/gnatsd"

View File

@@ -11,7 +11,6 @@ authorization {
}
pid_file: '/tmp/nats_cluster_test.pid'
log_file: '/tmp/nats_cluster_test.log'
cluster {
host: 127.0.0.1

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
# Our role based permissions.

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
# Our role based permissions.

View File

@@ -1,4 +1,3 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"

View File

@@ -1,6 +1,5 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
max_connections: 1

View File

@@ -1,6 +1,5 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
max_payload: 1

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
users = [

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
users = [

View File

@@ -1,12 +1,12 @@
# Copyright 2017 Apcera Inc. All rights reserved.
include 'platform.conf'
# logging options
debug: true # enable on reload
trace: true # enable on reload
logtime: true # enable on reload
syslog: true # enable on reload
remote_syslog: "udp://localhost:514" # change on reload
log_file: "/tmp/gnatsd-2.log" # change on reload
pid_file: "/tmp/gnatsd.pid" # change on reload
max_control_line: 512 # change on reload

View File

@@ -4,6 +4,5 @@
debug: false
trace: true
logtime: true
log_file: "/tmp/gnatsd.log"
# Removes cluster host, which is unsupported.

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
user: tyler

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
user: derek

View File

@@ -4,7 +4,6 @@
debug: false
trace: false
logtime: false
log_file: "/tmp/gnatsd.log"
cluster {
listen: localhost:-1

View File

@@ -3,7 +3,6 @@
# Simple TLS config file
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
tls {
cert_file: "./configs/certs/server.pem"

View File

@@ -3,7 +3,6 @@
# Simple TLS config file
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
tls {
cert_file: "./configs/certs/cert.new.pem"

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
token: T0pS3cr3t

View File

@@ -1,7 +1,6 @@
# Copyright 2017 Apcera Inc. All rights reserved.
listen: localhost:-1
log_file: "/tmp/gnatsd.log"
authorization {
token: passw0rd

View File

@@ -16,7 +16,6 @@ authorization {
debug: false
trace: true
logtime: false
log_file: "/tmp/gnatsd.log"
syslog: true
remote_syslog: "udp://foo.com:33"

View File

@@ -64,7 +64,6 @@ func TestConfigFile(t *testing.T) {
Trace: true,
Logtime: false,
HTTPPort: 8222,
LogFile: "/tmp/gnatsd.log",
PidFile: "/tmp/gnatsd.pid",
ProfPort: 6543,
Syslog: true,
@@ -220,7 +219,6 @@ func TestMergeOverrides(t *testing.T) {
Trace: true,
Logtime: false,
HTTPPort: DEFAULT_HTTP_PORT,
LogFile: "/tmp/gnatsd.log",
PidFile: "/tmp/gnatsd.pid",
ProfPort: 6789,
Syslog: true,
@@ -714,7 +712,6 @@ func TestOptionsClone(t *testing.T) {
Trace: true,
Logtime: false,
HTTPPort: DEFAULT_HTTP_PORT,
LogFile: "/tmp/gnatsd.log",
PidFile: "/tmp/gnatsd.pid",
ProfPort: 6789,
Syslog: true,

View File

@@ -4,10 +4,12 @@ package server
import (
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
"time"
@@ -33,6 +35,7 @@ func TestConfigReloadNoConfigFile(t *testing.T) {
func TestConfigReloadUnsupported(t *testing.T) {
server, opts, config := newServerWithSymlinkConfig(t, "tmp.conf", "./configs/reload/test.conf")
defer os.Remove(config)
defer server.Shutdown()
loaded := server.ConfigTime()
@@ -44,7 +47,6 @@ func TestConfigReloadUnsupported(t *testing.T) {
Debug: false,
Trace: false,
Logtime: false,
LogFile: "/tmp/gnatsd.log",
MaxControlLine: 1024,
MaxPayload: 1048576,
MaxConn: 65536,
@@ -91,6 +93,7 @@ func TestConfigReloadUnsupported(t *testing.T) {
func TestConfigReloadInvalidConfig(t *testing.T) {
server, opts, config := newServerWithSymlinkConfig(t, "tmp.conf", "./configs/reload/test.conf")
defer os.Remove(config)
defer server.Shutdown()
loaded := server.ConfigTime()
@@ -102,7 +105,6 @@ func TestConfigReloadInvalidConfig(t *testing.T) {
Debug: false,
Trace: false,
Logtime: false,
LogFile: "/tmp/gnatsd.log",
MaxControlLine: 1024,
MaxPayload: 1048576,
MaxConn: 65536,
@@ -147,8 +149,21 @@ func TestConfigReloadInvalidConfig(t *testing.T) {
// Ensure Reload returns nil and the config is changed on success.
func TestConfigReload(t *testing.T) {
var content []byte
if runtime.GOOS != "windows" {
content = []byte(`
remote_syslog: "udp://localhost:514" # change on reload
log_file: "/tmp/gnatsd-2.log" # change on reload
`)
}
platformConf := "platform.conf"
defer os.Remove(platformConf)
if err := ioutil.WriteFile(platformConf, content, 0666); err != nil {
t.Fatalf("Unable to write config file: %v", err)
}
server, opts, config := newServerWithSymlinkConfig(t, "tmp.conf", "./configs/reload/test.conf")
defer os.Remove(config)
defer server.Shutdown()
loaded := server.ConfigTime()
@@ -160,7 +175,6 @@ func TestConfigReload(t *testing.T) {
Debug: false,
Trace: false,
Logtime: false,
LogFile: "/tmp/gnatsd.log",
MaxControlLine: 1024,
MaxPayload: 1048576,
MaxConn: 65536,
@@ -202,14 +216,16 @@ func TestConfigReload(t *testing.T) {
if !updated.Logtime {
t.Fatal("Expected Logtime to be true")
}
if updated.LogFile != "/tmp/gnatsd-2.log" {
t.Fatalf("LogFile is incorrect.\nexpected: /tmp/gnatsd-2.log\ngot: %s", updated.LogFile)
}
if !updated.Syslog {
t.Fatal("Expected Syslog to be true")
}
if updated.RemoteSyslog != "udp://localhost:514" {
t.Fatalf("RemoteSyslog is incorrect.\nexpected: udp://localhost:514\ngot: %s", updated.RemoteSyslog)
if runtime.GOOS != "windows" {
if updated.RemoteSyslog != "udp://localhost:514" {
t.Fatalf("RemoteSyslog is incorrect.\nexpected: udp://localhost:514\ngot: %s", updated.RemoteSyslog)
}
if updated.LogFile != "/tmp/gnatsd-2.log" {
t.Fatalf("LogFile is incorrect.\nexpected: /tmp/gnatsd-2.log\ngot: %s", updated.LogFile)
}
}
if updated.TLSConfig == nil {
t.Fatal("Expected TLSConfig to be non-nil")
@@ -1092,6 +1108,7 @@ func TestConfigReloadChangePermissions(t *testing.T) {
func TestConfigReloadClusterHostUnsupported(t *testing.T) {
server, _, config := newServerWithSymlinkConfig(t, "tmp.conf", "./configs/reload/srv_a_1.conf")
defer os.Remove(config)
defer server.Shutdown()
// Attempt to change cluster listen host.
if err := os.Remove(config); err != nil {
@@ -1112,6 +1129,7 @@ func TestConfigReloadClusterHostUnsupported(t *testing.T) {
func TestConfigReloadClusterPortUnsupported(t *testing.T) {
server, _, config := newServerWithSymlinkConfig(t, "tmp.conf", "./configs/reload/srv_a_1.conf")
defer os.Remove(config)
defer server.Shutdown()
// Attempt to change cluster listen port.
if err := os.Remove(config); err != nil {
@@ -1325,6 +1343,7 @@ func TestConfigReloadDisableClusterAuthorization(t *testing.T) {
func TestConfigReloadClusterRoutes(t *testing.T) {
srvb, srvbOpts, srvbConfig := runServerWithSymlinkConfig(t, "tmp_b.conf", "./configs/reload/srv_b_1.conf")
defer os.Remove(srvbConfig)
defer srvb.Shutdown()
srva, srvaOpts, srvaConfig := runServerWithSymlinkConfig(t, "tmp_a.conf", "./configs/reload/srv_a_1.conf")
defer os.Remove(srvaConfig)

View File

@@ -36,7 +36,6 @@ func TestRouteConfig(t *testing.T) {
NoAdvertise: true,
ConnectRetries: 2,
},
LogFile: "/tmp/nats_cluster_test.log",
PidFile: "/tmp/nats_cluster_test.pid",
}

View File

@@ -67,6 +67,7 @@ func TestSignalToReloadConfig(t *testing.T) {
if err != nil {
t.Fatalf("Error processing config file: %v", err)
}
opts.NoLog = true
s := RunServer(opts)
defer s.Shutdown()