]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-13-NSPAWN: Set TERM=dumb when calling machinectl shell
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 6 Mar 2025 16:31:49 +0000 (17:31 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 6 Mar 2025 22:33:54 +0000 (22:33 +0000)
We only consider something not a tty if it's not connected to a tty
and not connected to /dev/null, so let's use the environment variable
instead to tell machinectl shell that it shouldn't do any of its TTY
stuff.

test/units/TEST-13-NSPAWN.machined.sh

index d8c15dfcfb8ce8447db198c7f9db3f07a00fdf4d..46884791ea61cc01320d9abab9c410b5f7e13edc 100755 (executable)
@@ -113,8 +113,8 @@ machinectl disable long-running
 test ! -L /etc/systemd/system/machines.target.wants/systemd-nspawn@long-running.service
 machinectl disable long-running long-running long-running container1
 
-[[ "$(machinectl shell testuser@ /usr/bin/bash -c 'echo -ne $FOO')" == "" ]]
-[[ "$(machinectl shell --setenv=FOO=bar testuser@ /usr/bin/bash -c 'echo -ne $FOO')" == "bar" ]]
+[[ "$(TERM=dumb machinectl shell testuser@ /usr/bin/bash -c 'echo -ne $FOO')" == "" ]]
+[[ "$(TERM=dumb machinectl shell --setenv=FOO=bar testuser@ /usr/bin/bash -c 'echo -ne $FOO')" == "bar" ]]
 
 [[ "$(machinectl show --property=State --value long-running)" == "running" ]]
 # Equivalent to machinectl kill --signal=SIGRTMIN+4 --kill-whom=leader