]> git.proxmox.com Git - pve-access-control.git/blobdiff - src/test/realm_sync_test.pl
bump version to 7.1-8
[pve-access-control.git] / src / test / realm_sync_test.pl
index 2a4a1327dd3aae07200993e96abc6a6a566d35e3..ea083f3c3dbb0acf79cc5a397c1291fa6bc3ee6e 100755 (executable)
@@ -150,8 +150,6 @@ my $tests = [
        "non-full without purge",
        {
            realm => 'syncedrealm',
-           full => 0,
-           purge => 0,
            scope => 'both',
        },
        {
@@ -198,8 +196,7 @@ my $tests = [
        "full without purge",
        {
            realm => 'syncedrealm',
-           full => 1,
-           purge => 0,
+           'remove-vanished' => 'entry;properties',
            scope => 'both',
        },
        {
@@ -240,8 +237,7 @@ my $tests = [
        "non-full with purge",
        {
            realm => 'syncedrealm',
-           full => 0,
-           purge => 1,
+           'remove-vanished' => 'acl',
            scope => 'both',
        },
        {
@@ -276,20 +272,56 @@ my $tests = [
            },
            acl => {
                '/' => {
+                   users => {},
+                   groups => {},
+               },
+           },
+       },
+    ],
+    [
+       "full with purge",
+       {
+           realm => 'syncedrealm',
+           'remove-vanished' => 'acl;entry;properties',
+           scope => 'both',
+       },
+       {
+           users => {
+               'root@pam' => { username => 'root', },
+               'user1@syncedrealm' => {
+                   username => 'user1',
+                   enable => 1,
+               },
+               'user2@syncedrealm' => {
+                   username => 'user2',
+                   enable => 1,
+               },
+               'user4@syncedrealm' => {
+                   username => 'user4',
+                   enable => 1,
+               },
+           },
+           groups => {
+               'group1-syncedrealm' => {
                    users => {
-                       'user3@syncedrealm' => {},
+                       'user1@syncedrealm' => 1,
                    },
+               },
+               'group3-syncedrealm' => { users => {}, },
+           },
+           acl => {
+               '/' => {
+                   users => {},
                    groups => {},
                },
            },
        },
     ],
     [
-       "full with purge",
+       "don't delete properties, but users and acls",
        {
            realm => 'syncedrealm',
-           full => 1,
-           purge => 1,
+           'remove-vanished' => 'acl;entry',
            scope => 'both',
        },
        {
@@ -298,6 +330,7 @@ my $tests = [
                'user1@syncedrealm' => {
                    username => 'user1',
                    enable => 1,
+                   'keys' => 'some',
                },
                'user2@syncedrealm' => {
                    username => 'user2',