diff --git a/group/description_test.go b/group/description_test.go index 0812e72..4335713 100644 --- a/group/description_test.go +++ b/group/description_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "os" + "path/filepath" "reflect" "testing" ) @@ -204,6 +205,14 @@ func TestWritableGroups(t *testing.T) { t.Errorf("GetDescription: got %v", err) } + fi, err := os.Stat(filepath.Join(Directory, "test.json")) + if err != nil { + t.Errorf("Stat: %v", err) + } + if mode := fi.Mode(); mode != 0o600 { + t.Errorf("Mode is 0o%03o (expected 0o600)\n", mode) + } + desc, token, err := GetSanitisedDescription("test") if err != nil || token == "" { t.Errorf("GetSanitisedDescription: got %v", err)