TestUserValidate_NameInGroups asserts that the user's own name (which is the conventional primary-group name on most distros) is rejected from the supplemental Groups list.
(t *testing.T)
| 599 | // conventional primary-group name on most distros) is rejected from the |
| 600 | // supplemental Groups list. |
| 601 | func TestUserValidate_NameInGroups(t *testing.T) { |
| 602 | res := mkUser("james", "exists", func(r *UserRes) { |
| 603 | r.Groups = []string{"james", "wheel"} |
| 604 | }) |
| 605 | if err := res.Validate(); err == nil { |
| 606 | t.Error("expected error when user name appears in Groups; got nil") |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | // TestUserCheckApply_AbsentSkipsUIDConflict guards against the duplicate-UID |
| 611 | // check firing for users we want absent. If the resource asks for `ghost` to be |