mirror of
https://github.com/systemd/systemd.git
synced 2025-03-11 20:58:27 +03:00
machine: tests for io.systemd.Machine.BindMount
This commit is contained in:
parent
3c6ec3480b
commit
1881c9ef22
@ -395,6 +395,8 @@ varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open
|
|||||||
timeout 30 bash -c "until test -e /tmp/none-existent-file; do sleep .5; done"
|
timeout 30 bash -c "until test -e /tmp/none-existent-file; do sleep .5; done"
|
||||||
grep -q "BAR" /tmp/none-existent-file
|
grep -q "BAR" /tmp/none-existent-file
|
||||||
|
|
||||||
|
# io.systemd.Machine.BindMount is covered by testcase_check_machinectl_bind() in nspawn tests
|
||||||
|
|
||||||
# terminate machines
|
# terminate machines
|
||||||
machinectl terminate long-running
|
machinectl terminate long-running
|
||||||
# wait for the container being stopped, otherwise acquiring image metadata by io.systemd.MachineImage.List may fail in the below.
|
# wait for the container being stopped, otherwise acquiring image metadata by io.systemd.MachineImage.List may fail in the below.
|
||||||
|
@ -796,7 +796,7 @@ EOF
|
|||||||
|
|
||||||
testcase_machinectl_bind() {
|
testcase_machinectl_bind() {
|
||||||
local service_path service_name root container_name ec
|
local service_path service_name root container_name ec
|
||||||
local cmd='for i in $(seq 1 20); do if test -f /tmp/marker; then exit 0; fi; sleep .5; done; exit 1;'
|
local cmd='for i in $(seq 1 20); do if test -f /tmp/marker && test -f /tmp/marker-varlink; then exit 0; fi; sleep .5; done; exit 1;'
|
||||||
|
|
||||||
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)"
|
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)"
|
||||||
create_dummy_container "$root"
|
create_dummy_container "$root"
|
||||||
@ -814,6 +814,8 @@ EOF
|
|||||||
systemctl start "$service_name"
|
systemctl start "$service_name"
|
||||||
touch /tmp/marker
|
touch /tmp/marker
|
||||||
machinectl bind --mkdir "$container_name" /tmp/marker
|
machinectl bind --mkdir "$container_name" /tmp/marker
|
||||||
|
touch /tmp/marker-varlink
|
||||||
|
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.BindMount "{\"name\": \"$container_name\", \"source\": \"/tmp/marker-varlink\", \"makeFileOrDirectory\": true}"
|
||||||
|
|
||||||
timeout 10 bash -c "while [[ '\$(systemctl show -P SubState $service_name)' == running ]]; do sleep .2; done"
|
timeout 10 bash -c "while [[ '\$(systemctl show -P SubState $service_name)' == running ]]; do sleep .2; done"
|
||||||
ec="$(systemctl show -P ExecMainStatus "$service_name")"
|
ec="$(systemctl show -P ExecMainStatus "$service_name")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user