]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machine: tests for io.systemd.MachineImage.{Clone, Remove} methods
authorIvan Kruglov <mail@ikruglov.com>
Mon, 21 Oct 2024 11:58:30 +0000 (13:58 +0200)
committerIvan Kruglov <mail@ikruglov.com>
Fri, 1 Nov 2024 14:30:39 +0000 (15:30 +0100)
test/units/TEST-13-NSPAWN.machined.sh

index 9a6e86cefbd10673ad9bfbed182578757ce5cb88..7d99880bedada2e946863abf4a47f2c4318951c9 100755 (executable)
@@ -381,3 +381,12 @@ varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineI
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.Update '{"name":"long-running-renamed", "newName": "long-running", "readOnly": false}'
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running"}'
 varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running"}' | jq '.readOnly' | grep 'false'
+
+# test io.systemd.MachineImage.Clone
+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'
+
+# test io.systemd.MachineImage.Remove
+varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.Remove '{"name":"long-running-cloned"}'
+(! varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running-cloned"}')