Skip to content

Commit

Permalink
Update golden files
Browse files Browse the repository at this point in the history
  • Loading branch information
adombeck committed Dec 3, 2024
1 parent 958bebc commit 163a95e
Show file tree
Hide file tree
Showing 335 changed files with 72 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wait: ""
entry: ""
content: ""
code: ""
rendersqrcode: null
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wait: ""
entry: entry_type
content: ""
code: ""
rendersqrcode: null
54 changes: 54 additions & 0 deletions internal/services/testdata/golden/TestRegisterGRPCServices
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
authd.NSS:
methods:
- name: GetGroupByGID
isclientstream: false
isserverstream: false
- name: GetGroupByName
isclientstream: false
isserverstream: false
- name: GetGroupEntries
isclientstream: false
isserverstream: false
- name: GetPasswdByName
isclientstream: false
isserverstream: false
- name: GetPasswdByUID
isclientstream: false
isserverstream: false
- name: GetPasswdEntries
isclientstream: false
isserverstream: false
- name: GetShadowByName
isclientstream: false
isserverstream: false
- name: GetShadowEntries
isclientstream: false
isserverstream: false
metadata: authd.proto
authd.PAM:
methods:
- name: AvailableBrokers
isclientstream: false
isserverstream: false
- name: EndSession
isclientstream: false
isserverstream: false
- name: GetAuthenticationModes
isclientstream: false
isserverstream: false
- name: GetPreviousBroker
isclientstream: false
isserverstream: false
- name: IsAuthenticated
isclientstream: false
isserverstream: false
- name: SelectAuthenticationMode
isclientstream: false
isserverstream: false
- name: SelectBroker
isclientstream: false
isserverstream: false
- name: SetDefaultBrokerForUser
isclientstream: false
isserverstream: false
metadata: authd.proto
8 changes: 4 additions & 4 deletions internal/users/cache/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ func TestUpdateUserEntry(t *testing.T) {
"Remove user from a group still part from another user": {userCase: "user3", groupCases: []string{"group3"}, dbFile: "multiple_users_and_groups"},

// Allowed inconsistent cases
"Invalid value entry in groupByName recreates entries": {dbFile: "invalid_entry_in_groupByName"},
"Invalid value entry in userByName recreates entries": {dbFile: "invalid_entry_in_userByName"},
"Invalid value entries in other user and groups don't impact current request": {dbFile: "invalid_entries_but_user_and_group1"},
"Invalid value entry in groupByName recreates entries": {dbFile: "invalid_entry_in_groupByName"},
"Invalid value entry in userByName recreates entries": {dbFile: "invalid_entry_in_userByName"},
"Invalid value entries in other user and groups do not impact current request": {dbFile: "invalid_entries_but_user_and_group1"},

// Renaming errors
"Error when user has conflicting uid": {userCase: "user1-new-name", dbFile: "one_user_and_group", wantErr: true},
Expand Down Expand Up @@ -380,7 +380,7 @@ func TestAllGroups(t *testing.T) {
"Get one group": {dbFile: "one_user_and_group"},
"Get multiple groups": {dbFile: "multiple_users_and_groups"},

"Get groups rely on groupByID, groupToUsers, UserByID": {dbFile: "partially_valid_multiple_users_and_groups_groupByID_groupToUsers_UserByID"},
"Get groups rely on groupByID groupToUsers UserByID": {dbFile: "partially_valid_multiple_users_and_groups_groupByID_groupToUsers_UserByID"},

"Error on some invalid groups entry": {dbFile: "invalid_entries_but_user_and_group1", wantErr: true},
"Error as not only relying on groupByID": {dbFile: "partially_valid_multiple_users_and_groups_only_groupByID", wantErr: true},
Expand Down
1 change: 1 addition & 0 deletions internal/users/cache/testdata/golden/TestBrokerForUser
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
broker-id
8 changes: 4 additions & 4 deletions internal/users/localgroups/localgroups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func TestUpdateLocalGroups(t *testing.T) {
"No-Op for user is already present in both local groups": {groupFilePath: "user_in_both_groups.group"},
"Insert user in the only local group when not present": {groupFilePath: "user_in_one_group.group"},
"Insert user in the only local group when not present even with multiple": {groupFilePath: "user_and_others_in_one_groups.group"},
"Remove user from an additional group, being alone": {groupFilePath: "user_in_second_local_group.group"},
"Remove user from an additional group, multiple users in group": {groupFilePath: "user_in_second_local_group_with_others.group"},
"Add and remove user from multiple groups, one remaining": {groupFilePath: "user_in_many_groups.group"},
"Remove user from an additional group without other users": {groupFilePath: "user_in_second_local_group.group"},
"Remove user from an additional group with other users": {groupFilePath: "user_in_second_local_group_with_others.group"},
"Add and remove user from multiple groups with one remaining": {groupFilePath: "user_in_many_groups.group"},

// Flexible accepted cases
"Missing group is ignored": {groupFilePath: "missing_group.group"},
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestCleanLocalGroups(t *testing.T) {
"Cleans up multiple users from group": {groupFilePath: "inactive_users_in_one_group.group"},
"Cleans up multiple users from multiple groups": {groupFilePath: "inactive_users_in_many_groups.group"},

"Error if there's no active user": {groupFilePath: "user_in_many_groups.group", getUsersReturn: []string{}, wantErr: true},
"Error if there is no active user": {groupFilePath: "user_in_many_groups.group", getUsersReturn: []string{}, wantErr: true},
"Error on missing groups file": {groupFilePath: "does_not_exists.group", wantErr: true},
"Error when groups file is malformed": {groupFilePath: "malformed_file.group", wantErr: true},
"Error on any unignored delete gpasswd error": {groupFilePath: "gpasswdfail_in_deleted_group.group", wantErr: true},
Expand Down
3 changes: 2 additions & 1 deletion pam/integration-tests/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/msteinert/pam/v2"
"github.com/stretchr/testify/require"
"github.com/ubuntu/authd"
"github.com/ubuntu/authd/internal/golden"
"github.com/ubuntu/authd/internal/testutils"
localgroupstestutils "github.com/ubuntu/authd/internal/users/localgroups/testutils"
Expand Down Expand Up @@ -231,7 +232,7 @@ func TestCLIChangeAuthTok(t *testing.T) {
"Prevent change password if user does not exist": {
tape: "passwd_unexistent_user",
},
"Prevent change password if current user is not root as can't authenticate": {
"Prevent change password if current user is not root as can not authenticate": {
tape: "passwd_not_root",
currentUserNotRoot: true,
},
Expand Down
2 changes: 1 addition & 1 deletion pam/integration-tests/native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func TestNativeChangeAuthTok(t *testing.T) {
"Prevent change password if user does not exist": {
tape: "passwd_unexistent_user",
},
"Prevent change password if current user is not root as can't authenticate": {
"Prevent change password if current user is not root as can not authenticate": {
tape: "passwd_not_root", currentUserNotRoot: true,
},

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ Enter 'r' to cancel the request and go back to select the authentication method
Or enter 'r' to go back to choose the provider
(user-can-reset@localhost) Choose action:
> 2
SSHD: Connected to ssh via authd module! [TestSSHAuthenticate]
HOME=${AUTHD_TEST_HOME}
LOGNAME=user-can-reset
PATH=${AUTHD_TEST_PATH}
PWD=${AUTHD_TEST_PWD}
SHELL=/bin/sh
SSH_CLIENT=${AUTHD_TEST_SSH_CLIENT}
SSH_CONNECTION=${AUTHD_TEST_SSH_CONNECTION}
SSH_TTY=${AUTHD_TEST_SSH_TTY}
TERM=xterm-256color
USER=user-can-reset
Connection to localhost closed.
>
────────────────────────────────────────────────────────────────────────────────
> ssh ${AUTHD_PAM_SSH_USER}@localhost ${AUTHD_PAM_SSH_ARGS}
== Provider selection ==
Expand Down
Loading

0 comments on commit 163a95e

Please sign in to comment.