]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machine: tests for io.systemd.MachineImage.CleanPool 35928/head
authorIvan Kruglov <mail@ikruglov.com>
Wed, 8 Jan 2025 15:02:26 +0000 (16:02 +0100)
committerIvan Kruglov <mail@ikruglov.com>
Tue, 4 Feb 2025 11:03:00 +0000 (03:03 -0800)
test/units/TEST-13-NSPAWN.machined.sh

index 3566f9fb9995932e700e65f5a9ffff117abcfb04..5bc24236747a061b947a42cb5d8a1d67f0d128bf 100755 (executable)
@@ -451,6 +451,8 @@ varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineI
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.Clone '{"name":"long-running", "newName": "long-running-cloned", "readOnly": true}'
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running-cloned"}'
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running-cloned"}' | jq '.readOnly' | grep 'true'
+# this is for io.systemd.MachineImage.CleanPool test
+varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.Clone '{"name":"long-running", "newName": "long-running-to-cleanup", "readOnly": true}'
 
 # test io.systemd.MachineImage.Remove
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.Remove '{"name":"long-running-cloned"}'
@@ -461,3 +463,8 @@ FSTYPE="$(stat --file-system --format "%T" /var/lib/machines)"
 if [[ "$FSTYPE" == "btrfs" ]]; then
      varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.SetPoolLimit '{"limit": 18446744073709551615}' # UINT64_MAX
 fi
+
+# test io.systemd.MachineImage.CleanPool
+varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running-to-cleanup"}'
+varlinkctl --more call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.CleanPool '{"mode":"all"}' | grep "long-running-to-cleanup"
+(! varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running-to-cleanup"}')