Skip to content

Commit

Permalink
test: make TEST-27 non-racy
Browse files Browse the repository at this point in the history
Not sure how I missed this, but we of course need to wait for the
"systemd-run" commands to finish before we can check the output files
this generated.
  • Loading branch information
poettering authored and yuwata committed Nov 28, 2018
1 parent 466a2be commit 324ca05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/TEST-27-STDOUTFILE/testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ set -o pipefail
systemd-analyze set-log-level debug
systemd-analyze set-log-target console

systemd-run --unit=one -p StandardOutput=file:/tmp/stdout -p StandardError=file:/tmp/stderr -p Type=exec sh -c 'echo x ; echo y >&2'
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'
cmp /tmp/stdout <<EOF
x
EOF
cmp /tmp/stderr <<EOF
y
EOF

systemd-run --unit=two -p StandardOutput=file:/tmp/stdout -p StandardError=file:/tmp/stderr -p Type=exec sh -c 'echo z ; echo a >&2'
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'
cmp /tmp/stdout <<EOF
z
EOF
cmp /tmp/stderr <<EOF
a
EOF

systemd-run --unit=three -p StandardOutput=append:/tmp/stdout -p StandardError=append:/tmp/stderr -p Type=exec sh -c 'echo b ; echo c >&2'
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'
cmp /tmp/stdout <<EOF
z
b
Expand Down

0 comments on commit 324ca05

Please sign in to comment.