]> git.proxmox.com Git - pve-guest-common.git/commitdiff
tests: add checks for add_to_pending_delete
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 17:26:51 +0000 (19:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 17:35:06 +0000 (19:35 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
tests/abstract-config-tests.pl

index 37f54a0b6c65cb48e54da820cbfb63e1f32540b2..b0865c6b220ce1fc9c4914f067c84229227d4fa8 100755 (executable)
@@ -78,6 +78,29 @@ my $tests = [
        },
     ]
 },
+{
+    method => 'add_to_pending_delete', # $conf, $key, $force
+    subtests => [
+       { # simple test addition to of a pending deletion to the empty config
+           params => [ {}, 'memory', ],
+           expect => { pending => { delete => 'memory', }, },
+,
+       },
+       {
+           params => [ { pending => { delete => 'cpu', }, }, 'memory', 1 ],
+           expect => { pending => { delete => 'cpu,!memory', }, },
+,
+       },
+       {
+           params => [ { pending => { delete => 'cpu', }, }, 'cpu', 1 ],
+           expect => { pending => { delete => '!cpu', }, },
+       },
+       {
+           params => [ { pending => { delete => 'cpu', }, }, 'cpu', ],
+           expect => { pending => { delete => 'cpu', }, },
+       },
+    ]
+},
 ]; # tests definition end