2 # SPDX-License-Identifier: LGPL-2.1-or-later
6 # Make sure PATH is set
7 systemctl show-environment |
grep -q '^PATH='
9 # Let's add an entry and override a built-in one
10 systemctl set-environment PATH
=/usr
/local
/sbin
:/usr
/local
/bin
:/usr
/sbin
:/usr
/bin
:/testaddition FOO
=BAR
12 # Check that both are set
13 systemctl show-environment |
grep -q '^PATH=.*testaddition$'
14 systemctl show-environment |
grep -q '^FOO=BAR$'
16 systemctl daemon-reload
18 # Check again after the reload
19 systemctl show-environment |
grep -q '^PATH=.*testaddition$'
20 systemctl show-environment |
grep -q '^FOO=BAR$'
23 systemctl unset-environment FOO PATH
25 # Check that one is gone and the other reverted to the built-in
26 systemctl show-environment |
grep '^FOO=$' && exit 1
27 systemctl show-environment |
grep '^PATH=.*testaddition$' && exit 1
28 systemctl show-environment |
grep -q '^PATH='