mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
TEST-29: trim output a bit
IIUC, pipefail doesn't matter for a sequence of commands joined with &&, and we don't have any pipes. And such a failing expression also does not trigger an exit, so the set +e/set -e were noops.
This commit is contained in:
parent
19a04e8071
commit
13391986b5
@ -607,7 +607,7 @@ ExecStart=sleep 120
|
|||||||
EOF
|
EOF
|
||||||
cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-foo.service"
|
cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-foo.service"
|
||||||
|
|
||||||
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_0.raw" -noappend
|
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_0.raw" -noappend -quiet
|
||||||
veritysetup format "$oldinitdir/usr/share/minimal_0.raw" "$oldinitdir/usr/share/minimal_0.verity" | \
|
veritysetup format "$oldinitdir/usr/share/minimal_0.raw" "$oldinitdir/usr/share/minimal_0.verity" | \
|
||||||
grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_0.roothash"
|
grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_0.roothash"
|
||||||
|
|
||||||
@ -615,7 +615,7 @@ EOF
|
|||||||
rm "$initdir/usr/lib/systemd/system/minimal-app0-foo.service"
|
rm "$initdir/usr/lib/systemd/system/minimal-app0-foo.service"
|
||||||
cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-bar.service"
|
cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-bar.service"
|
||||||
|
|
||||||
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_1.raw" -noappend
|
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_1.raw" -noappend -quiet
|
||||||
veritysetup format "$oldinitdir/usr/share/minimal_1.raw" "$oldinitdir/usr/share/minimal_1.verity" | \
|
veritysetup format "$oldinitdir/usr/share/minimal_1.raw" "$oldinitdir/usr/share/minimal_1.verity" | \
|
||||||
grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_1.roothash"
|
grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_1.roothash"
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ cat /usr/lib/extension-release.d/extension-release.app0
|
|||||||
EOF
|
EOF
|
||||||
chmod +x "$initdir/opt/script0.sh"
|
chmod +x "$initdir/opt/script0.sh"
|
||||||
echo MARKER=1 >"$initdir/usr/lib/systemd/system/some_file"
|
echo MARKER=1 >"$initdir/usr/lib/systemd/system/some_file"
|
||||||
mksquashfs "$initdir" "$oldinitdir/usr/share/app0.raw" -noappend
|
mksquashfs "$initdir" "$oldinitdir/usr/share/app0.raw" -noappend -quiet
|
||||||
|
|
||||||
export initdir="$TESTDIR/app1"
|
export initdir="$TESTDIR/app1"
|
||||||
mkdir -p "$initdir/usr/lib/extension-release.d" "$initdir/usr/lib/systemd/system" "$initdir/opt"
|
mkdir -p "$initdir/usr/lib/extension-release.d" "$initdir/usr/lib/systemd/system" "$initdir/opt"
|
||||||
@ -673,7 +673,7 @@ cat /usr/lib/extension-release.d/extension-release.app2
|
|||||||
EOF
|
EOF
|
||||||
chmod +x "$initdir/opt/script1.sh"
|
chmod +x "$initdir/opt/script1.sh"
|
||||||
echo MARKER=1 >"$initdir/usr/lib/systemd/system/other_file"
|
echo MARKER=1 >"$initdir/usr/lib/systemd/system/other_file"
|
||||||
mksquashfs "$initdir" "$oldinitdir/usr/share/app1.raw" -noappend
|
mksquashfs "$initdir" "$oldinitdir/usr/share/app1.raw" -noappend -quiet
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,21 +31,13 @@ portablectl "${ARGS[@]}" attach --now --runtime /usr/share/minimal_0.raw minimal
|
|||||||
|
|
||||||
systemctl is-active minimal-app0.service
|
systemctl is-active minimal-app0.service
|
||||||
systemctl is-active minimal-app0-foo.service
|
systemctl is-active minimal-app0-foo.service
|
||||||
set +o pipefail
|
|
||||||
set +e
|
|
||||||
systemctl is-active minimal-app0-bar.service && exit 1
|
systemctl is-active minimal-app0-bar.service && exit 1
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
portablectl "${ARGS[@]}" reattach --now --runtime /usr/share/minimal_1.raw minimal-app0
|
portablectl "${ARGS[@]}" reattach --now --runtime /usr/share/minimal_1.raw minimal-app0
|
||||||
|
|
||||||
systemctl is-active minimal-app0.service
|
systemctl is-active minimal-app0.service
|
||||||
systemctl is-active minimal-app0-bar.service
|
systemctl is-active minimal-app0-bar.service
|
||||||
set +o pipefail
|
|
||||||
set +e
|
|
||||||
systemctl is-active minimal-app0-foo.service && exit 1
|
systemctl is-active minimal-app0-foo.service && exit 1
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
portablectl list | grep -q -F "minimal_1"
|
portablectl list | grep -q -F "minimal_1"
|
||||||
|
|
||||||
@ -55,28 +47,20 @@ portablectl list | grep -q -F "No images."
|
|||||||
|
|
||||||
# portablectl also works with directory paths rather than images
|
# portablectl also works with directory paths rather than images
|
||||||
|
|
||||||
unsquashfs -dest /tmp/minimal_0 /usr/share/minimal_0.raw
|
unsquashfs -q -dest /tmp/minimal_0 /usr/share/minimal_0.raw
|
||||||
unsquashfs -dest /tmp/minimal_1 /usr/share/minimal_1.raw
|
unsquashfs -q -dest /tmp/minimal_1 /usr/share/minimal_1.raw
|
||||||
|
|
||||||
portablectl "${ARGS[@]}" attach --copy=symlink --now --runtime /tmp/minimal_0 minimal-app0
|
portablectl "${ARGS[@]}" attach --copy=symlink --now --runtime /tmp/minimal_0 minimal-app0
|
||||||
|
|
||||||
systemctl is-active minimal-app0.service
|
systemctl is-active minimal-app0.service
|
||||||
systemctl is-active minimal-app0-foo.service
|
systemctl is-active minimal-app0-foo.service
|
||||||
set +o pipefail
|
|
||||||
set +e
|
|
||||||
systemctl is-active minimal-app0-bar.service && exit 1
|
systemctl is-active minimal-app0-bar.service && exit 1
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
portablectl "${ARGS[@]}" reattach --now --enable --runtime /tmp/minimal_1 minimal-app0
|
portablectl "${ARGS[@]}" reattach --now --enable --runtime /tmp/minimal_1 minimal-app0
|
||||||
|
|
||||||
systemctl is-active minimal-app0.service
|
systemctl is-active minimal-app0.service
|
||||||
systemctl is-active minimal-app0-bar.service
|
systemctl is-active minimal-app0-bar.service
|
||||||
set +o pipefail
|
|
||||||
set +e
|
|
||||||
systemctl is-active minimal-app0-foo.service && exit 1
|
systemctl is-active minimal-app0-foo.service && exit 1
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
portablectl list | grep -q -F "minimal_1"
|
portablectl list | grep -q -F "minimal_1"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user