mirror of
https://github.com/systemd/systemd.git
synced 2025-01-04 09:18:12 +03:00
machine: tests for io.systemd.Machine.Open
This commit is contained in:
parent
11df4587a5
commit
d1cab2f2d3
@ -318,6 +318,17 @@ varlinkctl --more call /run/systemd/machine/io.systemd.Machine io.systemd.Machin
|
||||
(! 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.Machine.Open
|
||||
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open '{"name": ".host", "mode": "tty"}'
|
||||
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open '{"name": ".host", "mode": "login"}'
|
||||
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open '{"name": ".host", "mode": "shell"}'
|
||||
|
||||
# TODO(ikruglov): how to really test other modes?
|
||||
rm -f /tmp/none-existent-file
|
||||
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open '{"name": ".host", "mode": "shell", "user": "root", "path": "/bin/sh", "args": ["/bin/sh", "-c", "echo $FOO > /tmp/none-existent-file"], "env": ["FOO=BAR"]}'
|
||||
timeout 30 bash -c "until test -e /tmp/none-existent-file; do sleep .5; done"
|
||||
grep -q "BAR" /tmp/none-existent-file
|
||||
|
||||
# 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'
|
||||
|
Loading…
Reference in New Issue
Block a user