mirror of
https://github.com/systemd/systemd.git
synced 2025-03-01 08:58:29 +03:00
test: don't hide exit code of the systemd-run process
This commit is contained in:
parent
347756ed81
commit
5d7b7bf1d4
@ -8,13 +8,20 @@ set -eux
|
||||
|
||||
systemd-analyze log-level debug
|
||||
|
||||
run_with_cred_compare() {
|
||||
run_with_cred_compare() (
|
||||
local cred="${1:?}"
|
||||
local exp="${2?}"
|
||||
local log_file
|
||||
shift 2
|
||||
|
||||
diff <(systemd-run -p SetCredential="$cred" --wait --pipe -- systemd-creds "$@") <(echo -ne "$exp")
|
||||
}
|
||||
log_file="$(mktemp)"
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -f '$log_file'" RETURN
|
||||
|
||||
set -o pipefail
|
||||
systemd-run -p SetCredential="$cred" --wait --pipe -- systemd-creds "$@" | tee "$log_file"
|
||||
diff "$log_file" <(echo -ne "$exp")
|
||||
)
|
||||
|
||||
# Sanity checks
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user