diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/machine_empty_state/db/machine.d/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/db/adsystestuser@example.com.d/adsys similarity index 100% rename from internal/policies/dconf/testdata/TestApplyPolicy/golden/machine_empty_state/db/machine.d/adsys rename to cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/db/adsystestuser@example.com.d/adsys diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/machine_empty_state/db/machine.d/locks/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/db/adsystestuser@example.com.d/locks/adsys similarity index 100% rename from internal/policies/dconf/testdata/TestApplyPolicy/golden/machine_empty_state/db/machine.d/locks/adsys rename to cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/db/adsystestuser@example.com.d/locks/adsys diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/profile/adsystestuser@example.com b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/profile/adsystestuser@example.com new file mode 100644 index 000000000..b3af97a26 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_current_user_policies/dconf/profile/adsystestuser@example.com @@ -0,0 +1,3 @@ +user-db:user +system-db:adsystestuser@example.com +system-db:machine \ No newline at end of file diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/db/gdm.d/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/db/gdm.d/locks/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/profile/.empty b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/profile/.empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/profile/gdm b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_machine_policies/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/db/userintegrationtest@example.com.d/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/db/userintegrationtest@example.com.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/db/userintegrationtest@example.com.d/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/db/userintegrationtest@example.com.d/locks/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/db/userintegrationtest@example.com.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/db/userintegrationtest@example.com.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/profile/userintegrationtest@example.com b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/profile/userintegrationtest@example.com new file mode 100644 index 000000000..fe2e829bd --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_other_user_policies/dconf/profile/userintegrationtest@example.com @@ -0,0 +1,3 @@ +user-db:user +system-db:userintegrationtest@example.com +system-db:machine \ No newline at end of file diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/adsystestuser@example.com.d/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/adsystestuser@example.com.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/adsystestuser@example.com.d/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/adsystestuser@example.com.d/locks/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/adsystestuser@example.com.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/adsystestuser@example.com.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/gdm.d/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/gdm.d/locks/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/userintegrationtest@example.com.d/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/userintegrationtest@example.com.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/userintegrationtest@example.com.d/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/userintegrationtest@example.com.d/locks/adsys b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/userintegrationtest@example.com.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/db/userintegrationtest@example.com.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/.empty b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/.empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/adsystestuser@example.com b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/adsystestuser@example.com new file mode 100644 index 000000000..b3af97a26 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/adsystestuser@example.com @@ -0,0 +1,3 @@ +user-db:user +system-db:adsystestuser@example.com +system-db:machine \ No newline at end of file diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/gdm b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git a/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/userintegrationtest@example.com b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/userintegrationtest@example.com new file mode 100644 index 000000000..fe2e829bd --- /dev/null +++ b/cmd/adsysd/integration_tests/testdata/TestPolicyUpdate/golden/purge_policies_for_all_cached_objects/dconf/profile/userintegrationtest@example.com @@ -0,0 +1,3 @@ +user-db:user +system-db:userintegrationtest@example.com +system-db:machine \ No newline at end of file diff --git a/internal/policies/dconf/dconf.go b/internal/policies/dconf/dconf.go index 9498b5e41..b5a6e2652 100644 --- a/internal/policies/dconf/dconf.go +++ b/internal/policies/dconf/dconf.go @@ -95,27 +95,12 @@ func (m *Manager) ApplyPolicy(ctx context.Context, objectName string, isComputer dbsPath := filepath.Join(dconfDir, "db") dbPath := filepath.Join(dbsPath, objectName+".d") - if !isComputer && len(entries) > 0 { + if !isComputer { if _, err := os.Stat(filepath.Join(dbsPath, "machine.d", "locks", "adsys")); err != nil { return errors.New(gotext.Get("machine dconf database is required before generating a policy for an user. This one returns: %v", err)) } } - // Only clean up user databases/profiles if there are no entries to apply. - // We don't clean up the machine database because we don't know if there's any user GPO depending on it. - if !isComputer && len(entries) == 0 { - if err := os.RemoveAll(dbPath); err != nil { - return errors.New(gotext.Get("can't remove user dconf database directory: %v", err)) - } - if er := os.RemoveAll(filepath.Join(dbsPath, objectName)); er != nil { - return errors.New(gotext.Get("can't remove user dconf binary database: %v", err)) - } - if err := os.RemoveAll(filepath.Join(profilesPath, objectName)); err != nil { - return errors.New(gotext.Get("can't remove user dconf profile: %v", err)) - } - return nil - } - // Create profiles for users only if !isComputer { //nolint:gosec // G301 - Profile must be readable by everyone diff --git a/internal/policies/dconf/dconf_test.go b/internal/policies/dconf/dconf_test.go index 645ebb17b..a7a9fc5c3 100644 --- a/internal/policies/dconf/dconf_test.go +++ b/internal/policies/dconf/dconf_test.go @@ -38,8 +38,6 @@ func TestApplyPolicy(t *testing.T) { "Update user disabled key with value": {entries: []entry.Entry{ {Key: "com/ubuntu/category/key-s", Value: "'onekey-s-othervalue'", Meta: "s"}}, existingDconfDir: "user-with-disabled-value"}, - "User empty state, with existing machine policy": {entries: []entry.Entry{}, existingDconfDir: "existing-user"}, - "User empty state": {entries: []entry.Entry{}, existingDconfDir: "-"}, // Machine cases "First boot": {entries: []entry.Entry{ @@ -57,7 +55,10 @@ func TestApplyPolicy(t *testing.T) { "Update machine disabled key with value": {entries: []entry.Entry{ {Key: "com/ubuntu/category/key-s", Value: "'onekey-s-othervalue'", Meta: "s"}}, isComputer: true, existingDconfDir: "machine-with-disabled-value"}, - "Machine empty state": {entries: []entry.Entry{}, isComputer: true, existingDconfDir: "-"}, + + // We still need to create an empty database even if there is no policy, otherwise DCONF will block any writes + // due to missing database profile stack file. + "No policy still generates a valid db": {entries: nil}, "Multiple keys same category": {entries: []entry.Entry{ {Key: "com/ubuntu/category/key-s", Value: "'onekey-s-othervalue'", Meta: "s"}, @@ -143,19 +144,19 @@ func TestApplyPolicy(t *testing.T) { }}, // Profiles tests - "Update existing correct profile stays unchanged": { + "Update existing correct profile stays unchanged": {entries: nil, existingDconfDir: "existing-user"}, - "Update existing correct profile with trailing spaces are removed": { + "Update existing correct profile with trailing spaces are removed": {entries: nil, existingDconfDir: "existing-user-with-trailing-spaces"}, - "Update existing profile without needed db append them": { + "Update existing profile without needed db append them": {entries: nil, existingDconfDir: "existing-user-no-adsysdb"}, - "Update existing profile without needed db, trailine lines are removed": { + "Update existing profile without needed db, trailine lines are removed": {entries: nil, existingDconfDir: "existing-user-no-adsysdb-trailing-newlines"}, - "Update existing profile with partial db append them without repetition": { + "Update existing profile with partial db append them without repetition": {entries: nil, existingDconfDir: "existing-user-one-adsysdb-partial"}, - "Update existing profile with wrong order appends them in correct order": { + "Update existing profile with wrong order appends them in correct order": {entries: nil, existingDconfDir: "existing-user-one-adsysdb-reversed-end"}, - "Update existing profile eliminates adsys DB repetitions": { + "Update existing profile eliminates adsys DB repetitions": {entries: nil, existingDconfDir: "existing-user-adsysdb-repetitions"}, // non adsys content @@ -194,10 +195,6 @@ func TestApplyPolicy(t *testing.T) { dconfDir := t.TempDir() - if tc.entries == nil { - tc.entries = []entry.Entry{{Key: "com/ubuntu/category/key-s", Value: "'onekey-s-othervalue'", Meta: "s"}} - } - if tc.existingDconfDir == "" { tc.existingDconfDir = "machine-base" } diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/db/ubuntu.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/db/ubuntu.d/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/db/ubuntu.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/db/ubuntu.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/profile/ubuntu b/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/profile/ubuntu new file mode 100644 index 000000000..87e5a45ce --- /dev/null +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/no_policy_still_generates_a_valid_db/profile/ubuntu @@ -0,0 +1,3 @@ +user-db:user +system-db:ubuntu +system-db:machine \ No newline at end of file diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_stays_unchanged/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_correct_profile_with_trailing_spaces_are_removed/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_eliminates_adsys_db_repetitions/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_partial_db_append_them_without_repetition/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_with_wrong_order_appends_them_in_correct_order/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db,_trailine_lines_are_removed/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/adsys index d0d7f8343..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/adsys @@ -1,2 +1 @@ -[com/ubuntu/category] -key-s='onekey-s-othervalue' + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/locks/adsys index fa93a75da..8b1378917 100644 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/locks/adsys +++ b/internal/policies/dconf/testdata/TestApplyPolicy/golden/update_existing_profile_without_needed_db_append_them/db/ubuntu.d/locks/adsys @@ -1 +1 @@ -/com/ubuntu/category/key-s + diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/db/machine.d/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/db/machine.d/adsys deleted file mode 100644 index 2c3d72cce..000000000 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/db/machine.d/adsys +++ /dev/null @@ -1,2 +0,0 @@ -[com/ubuntu/category] -key-s='onekey-s' diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/db/machine.d/locks/adsys b/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/db/machine.d/locks/adsys deleted file mode 100644 index fa93a75da..000000000 --- a/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/db/machine.d/locks/adsys +++ /dev/null @@ -1 +0,0 @@ -/com/ubuntu/category/key-s diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/profile/.empty b/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state,_with_existing_machine_policy/profile/.empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state/.empty b/internal/policies/dconf/testdata/TestApplyPolicy/golden/user_empty_state/.empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/db/gdm.d/adsys b/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/db/gdm.d/locks/adsys b/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/profile/gdm b/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/no_subscription_is_only_dconf_content/etc/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/db/gdm.d/adsys b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/db/gdm.d/locks/adsys b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/profile/gdm b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_deletes_everything/etc/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git "a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/adsys" "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/adsys" new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/adsys" @@ -0,0 +1 @@ + diff --git "a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/locks/adsys" "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/locks/adsys" new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/locks/adsys" @@ -0,0 +1 @@ + diff --git "a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/profile/gdm" "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/profile/gdm" new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_rules_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/profile/gdm" @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git "a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/adsys" "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/adsys" new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/adsys" @@ -0,0 +1 @@ + diff --git "a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/locks/adsys" "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/locks/adsys" new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/db/gdm.d/locks/adsys" @@ -0,0 +1 @@ + diff --git "a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/profile/gdm" "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/profile/gdm" new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ "b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_don't_remove_scripts_if_session_hasn\342\200\231t_ended/etc/dconf/profile/gdm" @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/db/gdm.d/adsys b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/db/gdm.d/locks/adsys b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/profile/gdm b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/second_call_with_no_subscription_should_remove_everything_but_dconf_content/etc/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git a/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/db/gdm.d/adsys b/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/db/gdm.d/locks/adsys b/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/profile/gdm b/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/succeed/etc/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file diff --git a/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/db/gdm.d/adsys b/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/db/gdm.d/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/db/gdm.d/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/db/gdm.d/locks/adsys b/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/db/gdm.d/locks/adsys new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/db/gdm.d/locks/adsys @@ -0,0 +1 @@ + diff --git a/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/profile/gdm b/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/profile/gdm new file mode 100644 index 000000000..96cbe1408 --- /dev/null +++ b/internal/policies/testdata/TestApplyPolicies/golden/succeed_if_checking_for_backend_online_status_returns_an_error/etc/dconf/profile/gdm @@ -0,0 +1,3 @@ +user-db:user +system-db:gdm +system-db:machine \ No newline at end of file