From 0707b7e17cb7c739546112c02b91911d93f61757 Mon Sep 17 00:00:00 2001 From: denisonbarbosa Date: Mon, 2 Dec 2024 07:53:54 -0400 Subject: [PATCH] fixup! Add test for new AdminIdentitiesFromRules function --- internal/policies/privilege/internal_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/policies/privilege/internal_test.go b/internal/policies/privilege/internal_test.go index e07280b64..206a7b651 100644 --- a/internal/policies/privilege/internal_test.go +++ b/internal/policies/privilege/internal_test.go @@ -107,29 +107,29 @@ func TestPolkitAdminIdentitiesFromRules(t *testing.T) { emptyReturn bool }{ "Fetch previous admin identities": { - policyKitDirs: []string{"existing-previous-local-admins-one/polkit-1"}, + policyKitDirs: []string{"existing-previous-local-admins-one/etc/polkit-1"}, }, "Fetch previous admin identities from lower ascii file": { - policyKitDirs: []string{"existing-previous-local-admins-multi/polkit-1"}, + policyKitDirs: []string{"existing-previous-local-admins-multi/etc/polkit-1"}, }, "Fetch previous admin identities ignoring adsys": { - policyKitDirs: []string{"existing-previous-local-admins-with-adsys-file/polkit-1"}, + policyKitDirs: []string{"existing-previous-local-admins-with-adsys-file/etc/polkit-1"}, }, // Rules-specific cases "Consider only first returned value": { - policyKitDirs: []string{"existing-previous-local-admins-return-early/polkit-1"}, + policyKitDirs: []string{"existing-previous-local-admins-return-early/etc/polkit-1"}, }, "Prioritize first specified directory if files have same ascii": { - policyKitDirs: []string{"multiple-polkit-dirs-same-file/polkit-1", "multiple-polkit-dirs-same-file/polkit-2"}, + policyKitDirs: []string{"multiple-polkit-dirs-same-file/etc/polkit-1", "multiple-polkit-dirs-same-file/etc/polkit-2"}, }, "Prioritize lower ascii file even if on second directory": { - policyKitDirs: []string{"multiple-polkit-dirs-diff-file/polkit-1", "multiple-polkit-dirs-diff-file/polkit-2"}, + policyKitDirs: []string{"multiple-polkit-dirs-diff-file/etc/polkit-1", "multiple-polkit-dirs-diff-file/etc/polkit-2"}, }, // Edge cases "No previous admin identities but regular directory structure": { - policyKitDirs: []string{"existing-other-files/polkit-1"}, + policyKitDirs: []string{"existing-other-files/etc/polkit-1"}, emptyReturn: true, }, "Returns an empty string if directory does not exists": { @@ -137,7 +137,7 @@ func TestPolkitAdminIdentitiesFromRules(t *testing.T) { emptyReturn: true, }, "Directory instead of a conf file is ignored": { - policyKitDirs: []string{"incorrect-policikit-conf-is-dir/polkit-1"}, + policyKitDirs: []string{"incorrect-policikit-conf-is-dir/etc/polkit-1"}, emptyReturn: true, }, }