From: Ivan Kruglov Date: Thu, 17 Oct 2024 11:56:43 +0000 (+0200) Subject: machine: add tests for Addresses/OSRelease/UIDShift fields in io.systemd.Machine... X-Git-Tag: v257-rc1~170^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3cb72c7862d8950bc2a963aaa3ca3255eea374b6;p=thirdparty%2Fsystemd.git machine: add tests for Addresses/OSRelease/UIDShift fields in io.systemd.Machine.List output --- diff --git a/test/units/TEST-13-NSPAWN.machined.sh b/test/units/TEST-13-NSPAWN.machined.sh index f9ba8ea6567..244582677de 100755 --- a/test/units/TEST-13-NSPAWN.machined.sh +++ b/test/units/TEST-13-NSPAWN.machined.sh @@ -302,6 +302,22 @@ varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name":"registered-container"}' | jq '.sshPrivateKeyPath' | grep -q 'non-existent' varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Unregister '{"name": "registered-container"}' +# test io.systemd.Machine.List with addresses, OSRelease, and UIDShift fields +create_dummy_container "/var/lib/machines/container-without-os-release" +machinectl start "container-without-os-release" +rm -f /var/lib/machines/container-without-os-release/etc/os-release /var/lib/machines/container-without-os-release/usr/lib/os-release +(! varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": "container-without-os-release", "acquireMetadata": "yes"}') +varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": "container-without-os-release", "acquireMetadata": "graceful"}' +machinectl terminate "container-without-os-release" + +(ip addr show lo | grep -q 192.168.1.100) || ip address add 192.168.1.100/24 dev lo +(! varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": ".host"}' | grep 'addresses') +varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": ".host", "acquireMetadata": "yes"}' | grep 'addresses' +(! varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": ".host"}' | grep 'OSRelease') +varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": ".host", "acquireMetadata": "yes"}' | grep 'OSRelease' +(! varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": ".host"}' | grep 'acquireUIDShift') +varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.List '{"name": ".host", "acquireMetadata": "yes"}' | grep 'UIDShift' + # test io.systemd.MachineImage.List varlinkctl --more call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{}' | grep 'long-running' varlinkctl --more call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{}' | grep '.host'