test: move TEST-27-STDOUTFILE setup to static files

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-12-10 09:19:13 +01:00
parent dfa633ca6a
commit 468874997a
3 changed files with 11 additions and 19 deletions

View File

@ -13,22 +13,8 @@ test_setup() {
setup_basic_environment
mask_supporting_services
inst_binary cmp
# setup the testsuite service
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
[Unit]
Description=Testsuite service
[Service]
ExecStart=/testsuite.sh
Type=oneshot
EOF
cp testsuite.sh $initdir/
setup_testsuite
)
setup_nspawn_root
}
do_test "$@"
do_test "$@" 27

View File

@ -0,0 +1,6 @@
[Unit]
Description=TEST-27-STDOUTFILE
[Service]
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot

View File

@ -5,7 +5,7 @@ set -o pipefail
systemd-analyze log-level debug
systemd-analyze log-target console
systemd-run --wait --unit=one \
systemd-run --wait --unit=test27-one \
-p StandardOutput=file:/tmp/stdout \
-p StandardError=file:/tmp/stderr \
-p Type=exec \
@ -17,7 +17,7 @@ cmp /tmp/stderr <<EOF
y
EOF
systemd-run --wait --unit=two \
systemd-run --wait --unit=test27-two \
-p StandardOutput=file:/tmp/stdout \
-p StandardError=file:/tmp/stderr \
-p Type=exec \
@ -29,7 +29,7 @@ cmp /tmp/stderr <<EOF
a
EOF
systemd-run --wait --unit=three \
systemd-run --wait --unit=test27-three \
-p StandardOutput=append:/tmp/stdout \
-p StandardError=append:/tmp/stderr \
-p Type=exec \
@ -45,6 +45,6 @@ EOF
systemd-analyze log-level info
echo OK > /testok
echo OK >/testok
exit 0