From: Ivan Kruglov Date: Wed, 8 Jan 2025 15:02:26 +0000 (+0100) Subject: machine: tests for io.systemd.MachineImage.CleanPool X-Git-Tag: v258-rc1~1426^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F35928%2Fhead;p=thirdparty%2Fsystemd.git machine: tests for io.systemd.MachineImage.CleanPool --- diff --git a/test/units/TEST-13-NSPAWN.machined.sh b/test/units/TEST-13-NSPAWN.machined.sh index 3566f9fb999..5bc24236747 100755 --- a/test/units/TEST-13-NSPAWN.machined.sh +++ b/test/units/TEST-13-NSPAWN.machined.sh @@ -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"}')