Skip to content

Commit 5b6d17f

Browse files
committed
TestBasicUserBasedGroupManipulation: test that the user ~ endpoint gives correct groups
1 parent 5519c78 commit 5b6d17f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/integration/groups_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ func TestBasicUserBasedGroupManipulation(t *testing.T) {
6868
t.Errorf("unexpected error: %v", err)
6969
}
7070

71+
// make sure that user/~ returns system groups for backed users when it merges
72+
expectedValerieGroups := []string{"system:authenticated", "system:authenticated:oauth"}
73+
secondValerie, err := userclient.NewForConfigOrDie(valerieConfig).Users().Get("~", metav1.GetOptions{})
74+
if err != nil {
75+
t.Fatalf("unexpected error: %v", err)
76+
}
77+
if !reflect.DeepEqual(secondValerie.Groups, expectedValerieGroups) {
78+
t.Errorf("expected %v, got %v", expectedValerieGroups, secondValerie.Groups)
79+
}
80+
7181
_, err = valerieProjectClient.Projects().Get("empty", metav1.GetOptions{})
7282
if err == nil {
7383
t.Fatalf("expected error")

0 commit comments

Comments
 (0)