]>
Commit | Line | Data |
---|---|---|
196b0a11 LP |
1 | #!/bin/bash |
2 | # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | |
3 | # ex: ts=8 sw=4 sts=4 et filetype=sh | |
4 | set -ex | |
5 | set -o pipefail | |
6 | ||
7 | systemd-analyze set-log-level debug | |
8 | systemd-analyze set-log-target console | |
9 | ||
324ca054 | 10 | systemd-run --wait --unit=one -p StandardOutput=file:/tmp/stdout -p StandardError=file:/tmp/stderr -p Type=exec sh -c 'echo x ; echo y >&2' |
196b0a11 LP |
11 | cmp /tmp/stdout <<EOF |
12 | x | |
13 | EOF | |
14 | cmp /tmp/stderr <<EOF | |
15 | y | |
16 | EOF | |
17 | ||
324ca054 | 18 | systemd-run --wait --unit=two -p StandardOutput=file:/tmp/stdout -p StandardError=file:/tmp/stderr -p Type=exec sh -c 'echo z ; echo a >&2' |
196b0a11 LP |
19 | cmp /tmp/stdout <<EOF |
20 | z | |
21 | EOF | |
22 | cmp /tmp/stderr <<EOF | |
23 | a | |
24 | EOF | |
25 | ||
324ca054 | 26 | systemd-run --wait --unit=three -p StandardOutput=append:/tmp/stdout -p StandardError=append:/tmp/stderr -p Type=exec sh -c 'echo b ; echo c >&2' |
196b0a11 LP |
27 | cmp /tmp/stdout <<EOF |
28 | z | |
29 | b | |
30 | EOF | |
31 | cmp /tmp/stderr <<EOF | |
32 | a | |
33 | c | |
34 | EOF | |
35 | ||
36 | systemd-analyze set-log-level info | |
37 | ||
38 | echo OK > /testok | |
39 | ||
40 | exit 0 |