]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-26-SETENV/testsuite.sh
scripts: use 4 space indentation
[thirdparty/systemd.git] / test / TEST-26-SETENV / testsuite.sh
CommitLineData
79411bbc 1#!/bin/bash
79411bbc
LP
2set -ex
3set -o pipefail
4
5# Make sure PATH is set
6systemctl show-environment | grep -q '^PATH='
7
8# Let's add an entry and override a built-in one
9systemctl set-environment PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/testaddition FOO=BAR
10
11# Check that both are set
12systemctl show-environment | grep -q '^PATH=.*testaddition$'
13systemctl show-environment | grep -q '^FOO=BAR$'
14
15systemctl daemon-reload
16
17# Check again after the reload
18systemctl show-environment | grep -q '^PATH=.*testaddition$'
19systemctl show-environment | grep -q '^FOO=BAR$'
20
21# Drop both
22systemctl unset-environment FOO PATH
23
24# Check that one is gone and the other reverted to the built-in
25! (systemctl show-environment | grep -q '^FOO=$')
26! (systemctl show-environment | grep -q '^PATH=.*testaddition$')
27systemctl show-environment | grep -q '^PATH='
28
29echo OK > /testok
30
31exit 0