]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-27-STDOUTFILE/testsuite.sh
docs: fix path to unit files
[thirdparty/systemd.git] / test / TEST-27-STDOUTFILE / testsuite.sh
CommitLineData
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
4set -ex
5set -o pipefail
6
7systemd-analyze set-log-level debug
8systemd-analyze set-log-target console
9
324ca054 10systemd-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
11cmp /tmp/stdout <<EOF
12x
13EOF
14cmp /tmp/stderr <<EOF
15y
16EOF
17
324ca054 18systemd-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
19cmp /tmp/stdout <<EOF
20z
21EOF
22cmp /tmp/stderr <<EOF
23a
24EOF
25
324ca054 26systemd-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
27cmp /tmp/stdout <<EOF
28z
29b
30EOF
31cmp /tmp/stderr <<EOF
32a
33c
34EOF
35
36systemd-analyze set-log-level info
37
38echo OK > /testok
39
40exit 0