]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-27-STDOUTFILE/testsuite.sh
test-network: stop service before editing unit file
[thirdparty/systemd.git] / test / TEST-27-STDOUTFILE / testsuite.sh
CommitLineData
196b0a11 1#!/bin/bash
196b0a11
LP
2set -ex
3set -o pipefail
4
6c34ed51
ZJS
5systemd-analyze log-level debug
6systemd-analyze log-target console
196b0a11 7
cc5549ca
ZJS
8systemd-run --wait --unit=one \
9 -p StandardOutput=file:/tmp/stdout \
10 -p StandardError=file:/tmp/stderr \
11 -p Type=exec \
12 sh -c 'echo x ; echo y >&2'
196b0a11
LP
13cmp /tmp/stdout <<EOF
14x
15EOF
16cmp /tmp/stderr <<EOF
17y
18EOF
19
cc5549ca
ZJS
20systemd-run --wait --unit=two \
21 -p StandardOutput=file:/tmp/stdout \
22 -p StandardError=file:/tmp/stderr \
23 -p Type=exec \
24 sh -c 'echo z ; echo a >&2'
196b0a11
LP
25cmp /tmp/stdout <<EOF
26z
27EOF
28cmp /tmp/stderr <<EOF
29a
30EOF
31
cc5549ca
ZJS
32systemd-run --wait --unit=three \
33 -p StandardOutput=append:/tmp/stdout \
34 -p StandardError=append:/tmp/stderr \
35 -p Type=exec \
36 sh -c 'echo b ; echo c >&2'
196b0a11
LP
37cmp /tmp/stdout <<EOF
38z
39b
40EOF
41cmp /tmp/stderr <<EOF
42a
43c
44EOF
45
6c34ed51 46systemd-analyze log-level info
196b0a11
LP
47
48echo OK > /testok
49
50exit 0