mirror of https://github.com/status-im/consul.git
agent: fix tests
This commit is contained in:
parent
bae6334c60
commit
99d4e7831e
|
@ -589,15 +589,15 @@ func TestDecodeConfig(t *testing.T) {
|
|||
}
|
||||
|
||||
// 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)))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(config.UnixSockets, map[string]string{
|
||||
"uid": "500",
|
||||
"gid": "500",
|
||||
"user": "500",
|
||||
"group": "500",
|
||||
"mode": "0700",
|
||||
}) {
|
||||
t.Fatalf("bad: %v", config.UnixSockets)
|
||||
|
@ -1014,8 +1014,8 @@ func TestMergeConfig(t *testing.T) {
|
|||
"Access-Control-Allow-Origin": "*",
|
||||
},
|
||||
UnixSockets: map[string]string{
|
||||
"uid": "500",
|
||||
"gid": "500",
|
||||
"user": "500",
|
||||
"group": "500",
|
||||
"mode": "0700",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -51,12 +51,12 @@ func TestSetFilePermissions(t *testing.T) {
|
|||
defer os.Remove(path)
|
||||
|
||||
// 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")
|
||||
}
|
||||
|
||||
// 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")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue