agent: fix tests

This commit is contained in:
Ryan Uber 2015-01-20 16:50:21 -08:00
parent bae6334c60
commit 99d4e7831e
2 changed files with 9 additions and 9 deletions

View File

@ -589,15 +589,15 @@ func TestDecodeConfig(t *testing.T) {
} }
// Domain socket permissions // Domain socket permissions
input = `{"unix_sockets": {"uid": "500", "gid": "500", "mode": "0700"}}` input = `{"unix_sockets": {"user": "500", "group": "500", "mode": "0700"}}`
config, err = DecodeConfig(bytes.NewReader([]byte(input))) config, err = DecodeConfig(bytes.NewReader([]byte(input)))
if err != nil { if err != nil {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }
if !reflect.DeepEqual(config.UnixSockets, map[string]string{ if !reflect.DeepEqual(config.UnixSockets, map[string]string{
"uid": "500", "user": "500",
"gid": "500", "group": "500",
"mode": "0700", "mode": "0700",
}) { }) {
t.Fatalf("bad: %v", config.UnixSockets) t.Fatalf("bad: %v", config.UnixSockets)
@ -1014,8 +1014,8 @@ func TestMergeConfig(t *testing.T) {
"Access-Control-Allow-Origin": "*", "Access-Control-Allow-Origin": "*",
}, },
UnixSockets: map[string]string{ UnixSockets: map[string]string{
"uid": "500", "user": "500",
"gid": "500", "group": "500",
"mode": "0700", "mode": "0700",
}, },
} }

View File

@ -51,12 +51,12 @@ func TestSetFilePermissions(t *testing.T) {
defer os.Remove(path) defer os.Remove(path)
// Bad UID fails // Bad UID fails
if err := setFilePermissions(path, map[string]string{"uid": "%"}); err == nil { if err := setFilePermissions(path, map[string]string{"user": "%"}); err == nil {
t.Fatalf("should fail") t.Fatalf("should fail")
} }
// Bad GID fails // Bad GID fails
if err := setFilePermissions(path, map[string]string{"gid": "%"}); err == nil { if err := setFilePermissions(path, map[string]string{"group": "%"}); err == nil {
t.Fatalf("should fail") t.Fatalf("should fail")
} }