]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machine: move io.systemd.Machine.Map* tests into right position 34913/head
authorIvan Kruglov <mail@ikruglov.com>
Tue, 17 Dec 2024 18:03:05 +0000 (19:03 +0100)
committerIvan Kruglov <mail@ikruglov.com>
Mon, 6 Jan 2025 13:51:57 +0000 (14:51 +0100)
test/units/TEST-13-NSPAWN.machined.sh

index eaa72e1daf8471e38815a4ea94c632b5c4c36c3e..f3d59722ea85d7022e23491e2fddba5414e4fae0 100755 (executable)
@@ -387,6 +387,11 @@ varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open
 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"}'
 
+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"], "environment": ["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.Machine.MapFrom
 varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.MapFrom '{"name": "long-running", "uid":0, "gid": 0}'
 container_uid=$(varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.MapFrom '{"name": "long-running", "uid":0}' | jq '.uid')
@@ -396,11 +401,6 @@ varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.MapTo
 (! varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.MapTo '{"uid": 0}')
 (! varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.MapTo '{"gid": 0}')
 
-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"], "environment": ["FOO=BAR"]}'
-timeout 30 bash -c "until test -e /tmp/none-existent-file; do sleep .5; done"
-grep -q "BAR" /tmp/none-existent-file
-
 # io.systemd.Machine.BindMount is covered by testcase_check_machinectl_bind() in nspawn tests
 
 # test io.systemd.Machine.CopyTo