From 1e224d4a9f5e651ff60a9d7288e15e5037ee0e4f Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 18 Dec 2024 16:42:49 +0100 Subject: [PATCH] update cli and oauth tests for users with email Signed-off-by: Kristoffer Dalby --- integration/auth_oidc_test.go | 50 +++++++++++++++++++++-------------- integration/cli_test.go | 15 ++++++----- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/integration/auth_oidc_test.go b/integration/auth_oidc_test.go index 52d28054dc..2245987682 100644 --- a/integration/auth_oidc_test.go +++ b/integration/auth_oidc_test.go @@ -130,8 +130,9 @@ func TestOIDCAuthenticationPingAll(t *testing.T) { want := []v1.User{ { - Id: 1, - Name: "user1", + Id: 1, + Name: "user1", + Email: "user1@test.no", }, { Id: 2, @@ -141,8 +142,9 @@ func TestOIDCAuthenticationPingAll(t *testing.T) { ProviderId: oidcConfig.Issuer + "/user1", }, { - Id: 3, - Name: "user2", + Id: 3, + Name: "user2", + Email: "user2@test.no", }, { Id: 4, @@ -260,8 +262,9 @@ func TestOIDC024UserCreation(t *testing.T) { want: func(iss string) []v1.User { return []v1.User{ { - Id: 1, - Name: "user1", + Id: 1, + Name: "user1", + Email: "user1@test.no", }, { Id: 2, @@ -271,8 +274,9 @@ func TestOIDC024UserCreation(t *testing.T) { ProviderId: iss + "/user1", }, { - Id: 3, - Name: "user2", + Id: 3, + Name: "user2", + Email: "user2@test.no", }, { Id: 4, @@ -295,8 +299,9 @@ func TestOIDC024UserCreation(t *testing.T) { want: func(iss string) []v1.User { return []v1.User{ { - Id: 1, - Name: "user1", + Id: 1, + Name: "user1", + Email: "user1@test.no", }, { Id: 2, @@ -305,8 +310,9 @@ func TestOIDC024UserCreation(t *testing.T) { ProviderId: iss + "/user1", }, { - Id: 3, - Name: "user2", + Id: 3, + Name: "user2", + Email: "user2@test.no", }, { Id: 4, @@ -357,8 +363,9 @@ func TestOIDC024UserCreation(t *testing.T) { want: func(iss string) []v1.User { return []v1.User{ { - Id: 1, - Name: "user1", + Id: 1, + Name: "user1", + Email: "user1@test.no", }, { Id: 2, @@ -367,8 +374,9 @@ func TestOIDC024UserCreation(t *testing.T) { ProviderId: iss + "/user1", }, { - Id: 3, - Name: "user2", + Id: 3, + Name: "user2", + Email: "user2@test.no", }, { Id: 4, @@ -421,8 +429,9 @@ func TestOIDC024UserCreation(t *testing.T) { want: func(iss string) []v1.User { return []v1.User{ { - Id: 1, - Name: "user1.headscale.net", + Id: 1, + Name: "user1.headscale.net", + Email: "user1.headscale.net@test.no", }, { Id: 2, @@ -431,8 +440,9 @@ func TestOIDC024UserCreation(t *testing.T) { ProviderId: iss + "/user1", }, { - Id: 3, - Name: "user2.headscale.net", + Id: 3, + Name: "user2.headscale.net", + Email: "user2.headscale.net@test.no", }, { Id: 4, diff --git a/integration/cli_test.go b/integration/cli_test.go index fa811bdad8..08d5937cfc 100644 --- a/integration/cli_test.go +++ b/integration/cli_test.go @@ -135,8 +135,9 @@ func TestUserCommand(t *testing.T) { slices.SortFunc(listByUsername, sortWithID) want := []*v1.User{ { - Id: 1, - Name: "user1", + Id: 1, + Name: "user1", + Email: "user1@test.no", }, } @@ -161,8 +162,9 @@ func TestUserCommand(t *testing.T) { slices.SortFunc(listByID, sortWithID) want = []*v1.User{ { - Id: 1, - Name: "user1", + Id: 1, + Name: "user1", + Email: "user1@test.no", }, } @@ -199,8 +201,9 @@ func TestUserCommand(t *testing.T) { slices.SortFunc(listAfterIDDelete, sortWithID) want = []*v1.User{ { - Id: 2, - Name: "newname", + Id: 2, + Name: "newname", + Email: "user2@test.no", }, }