Skip to content

Commit

Permalink
TEST-13-NSPAWN: Set TERM=dumb when calling machinectl shell
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DaanDeMeyer authored and bluca committed Mar 6, 2025
1 parent 4efd46c commit cbcaf9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/units/TEST-13-NSPAWN.machined.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ machinectl disable long-running
test ! -L /etc/systemd/system/machines.target.wants/[email protected]
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
Expand Down

0 comments on commit cbcaf9f

Please sign in to comment.