From de668600079fb8c9b624b347f33d65aeed759f1c Mon Sep 17 00:00:00 2001 From: Shiv Tyagi Date: Sat, 30 Nov 2024 23:45:15 +0530 Subject: [PATCH] update golen test files --- ...t_groups_rely_on_groupbyid,_grouptousers,_userbyid | 4 ++++ .../testdata/TestAllGroups/golden/get_multiple_groups | 5 +++++ .../cache/testdata/TestAllGroups/golden/get_one_group | 1 + .../TestDeleteUser/golden/delete_existing_user | 1 + .../delete_existing_user_keeping_other_users_intact | 1 + .../testdata/TestGroupByID/golden/get_existing_group | 1 + .../TestGroupByName/golden/get_existing_group | 1 + ..._recreates_any_missing_buckets_and_delete_unknowns | 1 + ...removes_orphaned_user_records_from_userbyid_bucket | 1 + .../TestNew/golden/new_with_already_existing_database | 1 + .../golden/new_without_any_initialized_database | 1 + .../golden/add_user_to_group_from_another_user | 11 +++++++---- .../TestUpdateUserEntry/golden/insert_new_user | 6 ++++-- .../insert_new_user_without_optional_gecos_field | 6 ++++-- ...other_user_and_groups_don't_impact_current_request | 10 ++++++---- ...valid_value_entry_in_groupbyname_recreates_entries | 6 ++++-- ...nvalid_value_entry_in_userbyname_recreates_entries | 6 ++++-- .../TestUpdateUserEntry/golden/remove_group_from_user | 6 ++++-- ...ove_user_from_a_group_still_part_from_another_user | 6 ++++-- .../golden/update_last_login_time_for_user | 6 ++++-- .../update_only_user_even_if_we_have_multiple_of_them | 6 ++++-- .../golden/update_user_by_adding_a_new_default_group | 11 +++++++---- .../golden/update_user_by_adding_a_new_group | 11 +++++++---- .../golden/update_user_by_changing_attributes | 6 ++++-- ...e_user_by_removing_optional_gecos_field_if_not_set | 6 ++++-- .../update_user_does_not_change_homedir_if_it_exists | 6 ++++-- ..._recreates_any_missing_buckets_and_delete_unknowns | 1 + .../golden/successfully_create_a_new_manager | 1 + 28 files changed, 91 insertions(+), 38 deletions(-) diff --git a/internal/users/cache/testdata/TestAllGroups/golden/get_groups_rely_on_groupbyid,_grouptousers,_userbyid b/internal/users/cache/testdata/TestAllGroups/golden/get_groups_rely_on_groupbyid,_grouptousers,_userbyid index e7c4a3ee2..75fc35088 100644 --- a/internal/users/cache/testdata/TestAllGroups/golden/get_groups_rely_on_groupbyid,_grouptousers,_userbyid +++ b/internal/users/cache/testdata/TestAllGroups/golden/get_groups_rely_on_groupbyid,_grouptousers,_userbyid @@ -1,17 +1,21 @@ - name: group1 gid: 11111 + ugid: "" users: - user1 - name: group2 gid: 22222 + ugid: "" users: - user2 - name: group3 gid: 33333 + ugid: "" users: - user3 - name: commongroup gid: 99999 + ugid: "" users: - user2 - user3 diff --git a/internal/users/cache/testdata/TestAllGroups/golden/get_multiple_groups b/internal/users/cache/testdata/TestAllGroups/golden/get_multiple_groups index e9e8c1a25..e10193b53 100644 --- a/internal/users/cache/testdata/TestAllGroups/golden/get_multiple_groups +++ b/internal/users/cache/testdata/TestAllGroups/golden/get_multiple_groups @@ -1,21 +1,26 @@ - name: group1 gid: 11111 + ugid: "" users: - user1 - name: group2 gid: 22222 + ugid: "" users: - user2 - name: group3 gid: 33333 + ugid: "" users: - user3 - name: group4 gid: 44444 + ugid: "" users: - userwithoutbroker - name: commongroup gid: 99999 + ugid: "" users: - user2 - user3 diff --git a/internal/users/cache/testdata/TestAllGroups/golden/get_one_group b/internal/users/cache/testdata/TestAllGroups/golden/get_one_group index 949a41218..9c9a4788f 100644 --- a/internal/users/cache/testdata/TestAllGroups/golden/get_one_group +++ b/internal/users/cache/testdata/TestAllGroups/golden/get_one_group @@ -1,4 +1,5 @@ - name: group1 gid: 11111 + ugid: "" users: - user1 diff --git a/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user b/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user index 0f4b4f51b..c5b976915 100644 --- a/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user +++ b/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user @@ -1,5 +1,6 @@ GroupByID: {} GroupByName: {} +GroupByUGID: {} GroupToUsers: {} UserByID: {} UserByName: {} diff --git a/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user_keeping_other_users_intact b/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user_keeping_other_users_intact index 0c1996e7e..e122eac4b 100644 --- a/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user_keeping_other_users_intact +++ b/internal/users/cache/testdata/TestDeleteUser/golden/delete_existing_user_keeping_other_users_intact @@ -8,6 +8,7 @@ GroupByName: group2: '{"Name":"group2","GID":22222}' group3: '{"Name":"group3","GID":33333}' group4: '{"Name":"group4","GID":44444}' +GroupByUGID: {} GroupToUsers: "22222": '{"GID":22222,"UIDs":[2222]}' "33333": '{"GID":33333,"UIDs":[3333]}' diff --git a/internal/users/cache/testdata/TestGroupByID/golden/get_existing_group b/internal/users/cache/testdata/TestGroupByID/golden/get_existing_group index 6af5b8288..cbb6472a3 100644 --- a/internal/users/cache/testdata/TestGroupByID/golden/get_existing_group +++ b/internal/users/cache/testdata/TestGroupByID/golden/get_existing_group @@ -1,4 +1,5 @@ name: group1 gid: 11111 +ugid: "" users: - user1 diff --git a/internal/users/cache/testdata/TestGroupByName/golden/get_existing_group b/internal/users/cache/testdata/TestGroupByName/golden/get_existing_group index 6af5b8288..cbb6472a3 100644 --- a/internal/users/cache/testdata/TestGroupByName/golden/get_existing_group +++ b/internal/users/cache/testdata/TestGroupByName/golden/get_existing_group @@ -1,4 +1,5 @@ name: group1 gid: 11111 +ugid: "" users: - user1 diff --git a/internal/users/cache/testdata/TestNew/golden/new_recreates_any_missing_buckets_and_delete_unknowns b/internal/users/cache/testdata/TestNew/golden/new_recreates_any_missing_buckets_and_delete_unknowns index 9eba84f32..dc39350c4 100644 --- a/internal/users/cache/testdata/TestNew/golden/new_recreates_any_missing_buckets_and_delete_unknowns +++ b/internal/users/cache/testdata/TestNew/golden/new_recreates_any_missing_buckets_and_delete_unknowns @@ -1,5 +1,6 @@ GroupByID: {} GroupByName: {} +GroupByUGID: {} GroupToUsers: {} UserByID: "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}' diff --git a/internal/users/cache/testdata/TestNew/golden/new_removes_orphaned_user_records_from_userbyid_bucket b/internal/users/cache/testdata/TestNew/golden/new_removes_orphaned_user_records_from_userbyid_bucket index 0f4b4f51b..c5b976915 100644 --- a/internal/users/cache/testdata/TestNew/golden/new_removes_orphaned_user_records_from_userbyid_bucket +++ b/internal/users/cache/testdata/TestNew/golden/new_removes_orphaned_user_records_from_userbyid_bucket @@ -1,5 +1,6 @@ GroupByID: {} GroupByName: {} +GroupByUGID: {} GroupToUsers: {} UserByID: {} UserByName: {} diff --git a/internal/users/cache/testdata/TestNew/golden/new_with_already_existing_database b/internal/users/cache/testdata/TestNew/golden/new_with_already_existing_database index f44565cd6..7b53eb238 100644 --- a/internal/users/cache/testdata/TestNew/golden/new_with_already_existing_database +++ b/internal/users/cache/testdata/TestNew/golden/new_with_already_existing_database @@ -10,6 +10,7 @@ GroupByName: group2: '{"Name":"group2","GID":22222}' group3: '{"Name":"group3","GID":33333}' group4: '{"Name":"group4","GID":44444}' +GroupByUGID: {} GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[2222]}' diff --git a/internal/users/cache/testdata/TestNew/golden/new_without_any_initialized_database b/internal/users/cache/testdata/TestNew/golden/new_without_any_initialized_database index 0f4b4f51b..c5b976915 100644 --- a/internal/users/cache/testdata/TestNew/golden/new_without_any_initialized_database +++ b/internal/users/cache/testdata/TestNew/golden/new_without_any_initialized_database @@ -1,5 +1,6 @@ GroupByID: {} GroupByName: {} +GroupByUGID: {} GroupToUsers: {} UserByID: {} UserByName: {} diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/add_user_to_group_from_another_user b/internal/users/cache/testdata/TestUpdateUserEntry/golden/add_user_to_group_from_another_user index 055fff3f4..0124379c8 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/add_user_to_group_from_another_user +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/add_user_to_group_from_another_user @@ -1,15 +1,18 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' - "22222": '{"Name":"group2","GID":22222}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' + "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' "33333": '{"Name":"group3","GID":33333}' "44444": '{"Name":"group4","GID":44444}' "99999": '{"Name":"commongroup","GID":99999}' GroupByName: commongroup: '{"Name":"commongroup","GID":99999}' - group1: '{"Name":"group1","GID":11111}' - group2: '{"Name":"group2","GID":22222}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' + group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' group3: '{"Name":"group3","GID":33333}' group4: '{"Name":"group4","GID":44444}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' + "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[2222,1111]}' diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user b/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user index 65695498d..7798c390f 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user_without_optional_gecos_field b/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user_without_optional_gecos_field index e387eccce..470639c7f 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user_without_optional_gecos_field +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/insert_new_user_without_optional_gecos_field @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entries_in_other_user_and_groups_don't_impact_current_request b/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entries_in_other_user_and_groups_don't_impact_current_request index 488223b19..be4efd50a 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entries_in_other_user_and_groups_don't_impact_current_request +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entries_in_other_user_and_groups_don't_impact_current_request @@ -1,24 +1,26 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' "22222": '"not-a-valid-json"' "33333": '"not-a-valid-json"' "99999": '"not-a-valid-json"' GroupByName: commongroup: '"not-a-valid-json"' - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' group2: '"not-a-valid-json"' group3: '"not-a-valid-json"' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '"not-a-valid-json"' "33333": '"not-a-valid-json"' "99999": '"not-a-valid-json"' UserByID: - "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}' + "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2024-11-30T23:41:46.{{CURRENT_UID}}238+05:30"}' "2222": '"not-a-valid-json"' "3333": '"not-a-valid-json"' UserByName: - user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}' + user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"2024-11-30T23:41:46.{{CURRENT_UID}}238+05:30"}' user2: '"not-a-valid-json"' user3: '"not-a-valid-json"' UserToBroker: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_groupbyname_recreates_entries b/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_groupbyname_recreates_entries index 8982e1874..b9df453b1 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_groupbyname_recreates_entries +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_groupbyname_recreates_entries @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_userbyname_recreates_entries b/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_userbyname_recreates_entries index 8982e1874..b9df453b1 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_userbyname_recreates_entries +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/invalid_value_entry_in_userbyname_recreates_entries @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_group_from_user b/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_group_from_user index 8d2d83820..19df16b1e 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_group_from_user +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_group_from_user @@ -1,7 +1,9 @@ GroupByID: - "22222": '{"Name":"group2","GID":22222}' + "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupByName: - group2: '{"Name":"group2","GID":22222}' + group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' +GroupByUGID: + "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupToUsers: "22222": '{"GID":22222,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_user_from_a_group_still_part_from_another_user b/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_user_from_a_group_still_part_from_another_user index 6ba26b863..aeb0140cf 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_user_from_a_group_still_part_from_another_user +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/remove_user_from_a_group_still_part_from_another_user @@ -1,15 +1,17 @@ GroupByID: "11111": '{"Name":"group1","GID":11111}' "22222": '{"Name":"group2","GID":22222}' - "33333": '{"Name":"group3","GID":33333}' + "33333": '{"Name":"group3","GID":33333,"UGID":"34567812"}' "44444": '{"Name":"group4","GID":44444}' "99999": '{"Name":"commongroup","GID":99999}' GroupByName: commongroup: '{"Name":"commongroup","GID":99999}' group1: '{"Name":"group1","GID":11111}' group2: '{"Name":"group2","GID":22222}' - group3: '{"Name":"group3","GID":33333}' + group3: '{"Name":"group3","GID":33333,"UGID":"34567812"}' group4: '{"Name":"group4","GID":44444}' +GroupByUGID: + "34567812": '{"Name":"group3","GID":33333,"UGID":"34567812"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[2222]}' diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_last_login_time_for_user b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_last_login_time_for_user index 8982e1874..b9df453b1 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_last_login_time_for_user +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_last_login_time_for_user @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_only_user_even_if_we_have_multiple_of_them b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_only_user_even_if_we_have_multiple_of_them index 76b38639a..6fb7bf109 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_only_user_even_if_we_have_multiple_of_them +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_only_user_even_if_we_have_multiple_of_them @@ -1,15 +1,17 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' "22222": '{"Name":"group2","GID":22222}' "33333": '{"Name":"group3","GID":33333}' "44444": '{"Name":"group4","GID":44444}' "99999": '{"Name":"commongroup","GID":99999}' GroupByName: commongroup: '{"Name":"commongroup","GID":99999}' - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' group2: '{"Name":"group2","GID":22222}' group3: '{"Name":"group3","GID":33333}' group4: '{"Name":"group4","GID":44444}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[2222]}' diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_default_group b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_default_group index c583bda67..d3a5846ad 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_default_group +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_default_group @@ -1,9 +1,12 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' - "22222": '{"Name":"group2","GID":22222}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' + "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' - group2: '{"Name":"group2","GID":22222}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' + group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' + "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[1111]}' diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_group b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_group index c83825daa..fa647bf55 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_group +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_adding_a_new_group @@ -1,9 +1,12 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' - "22222": '{"Name":"group2","GID":22222}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' + "22222": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' - group2: '{"Name":"group2","GID":22222}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' + group2: '{"Name":"group2","GID":22222,"UGID":"56781234"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' + "56781234": '{"Name":"group2","GID":22222,"UGID":"56781234"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[1111]}' diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_changing_attributes b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_changing_attributes index 07ed1d635..9ac474ca8 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_changing_attributes +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_changing_attributes @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_removing_optional_gecos_field_if_not_set b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_removing_optional_gecos_field_if_not_set index f922cd4ef..8d2e4edf1 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_removing_optional_gecos_field_if_not_set +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_by_removing_optional_gecos_field_if_not_set @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_does_not_change_homedir_if_it_exists b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_does_not_change_homedir_if_it_exists index 8982e1874..b9df453b1 100644 --- a/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_does_not_change_homedir_if_it_exists +++ b/internal/users/cache/testdata/TestUpdateUserEntry/golden/update_user_does_not_change_homedir_if_it_exists @@ -1,7 +1,9 @@ GroupByID: - "11111": '{"Name":"group1","GID":11111}' + "11111": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupByName: - group1: '{"Name":"group1","GID":11111}' + group1: '{"Name":"group1","GID":11111,"UGID":"12345678"}' +GroupByUGID: + "12345678": '{"Name":"group1","GID":11111,"UGID":"12345678"}' GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' UserByID: diff --git a/internal/users/testdata/TestNewManager/golden/new_recreates_any_missing_buckets_and_delete_unknowns b/internal/users/testdata/TestNewManager/golden/new_recreates_any_missing_buckets_and_delete_unknowns index 9eba84f32..dc39350c4 100644 --- a/internal/users/testdata/TestNewManager/golden/new_recreates_any_missing_buckets_and_delete_unknowns +++ b/internal/users/testdata/TestNewManager/golden/new_recreates_any_missing_buckets_and_delete_unknowns @@ -1,5 +1,6 @@ GroupByID: {} GroupByName: {} +GroupByUGID: {} GroupToUsers: {} UserByID: "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}' diff --git a/internal/users/testdata/TestNewManager/golden/successfully_create_a_new_manager b/internal/users/testdata/TestNewManager/golden/successfully_create_a_new_manager index f44565cd6..7b53eb238 100644 --- a/internal/users/testdata/TestNewManager/golden/successfully_create_a_new_manager +++ b/internal/users/testdata/TestNewManager/golden/successfully_create_a_new_manager @@ -10,6 +10,7 @@ GroupByName: group2: '{"Name":"group2","GID":22222}' group3: '{"Name":"group3","GID":33333}' group4: '{"Name":"group4","GID":44444}' +GroupByUGID: {} GroupToUsers: "11111": '{"GID":11111,"UIDs":[1111]}' "22222": '{"GID":22222,"UIDs":[2222]}'