]>
Commit | Line | Data |
---|---|---|
196b0a11 | 1 | #!/bin/bash |
196b0a11 LP |
2 | set -ex |
3 | set -o pipefail | |
4 | ||
6c34ed51 ZJS |
5 | systemd-analyze log-level debug |
6 | systemd-analyze log-target console | |
196b0a11 | 7 | |
cc5549ca ZJS |
8 | systemd-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 |
13 | cmp /tmp/stdout <<EOF |
14 | x | |
15 | EOF | |
16 | cmp /tmp/stderr <<EOF | |
17 | y | |
18 | EOF | |
19 | ||
cc5549ca ZJS |
20 | systemd-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 |
25 | cmp /tmp/stdout <<EOF |
26 | z | |
27 | EOF | |
28 | cmp /tmp/stderr <<EOF | |
29 | a | |
30 | EOF | |
31 | ||
cc5549ca ZJS |
32 | systemd-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 |
37 | cmp /tmp/stdout <<EOF |
38 | z | |
39 | b | |
40 | EOF | |
41 | cmp /tmp/stderr <<EOF | |
42 | a | |
43 | c | |
44 | EOF | |
45 | ||
6c34ed51 | 46 | systemd-analyze log-level info |
196b0a11 LP |
47 | |
48 | echo OK > /testok | |
49 | ||
50 | exit 0 |