summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorwangyuhang <wangyuhang27@huawei.com>2022-04-24 09:31:33 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2022-04-25 10:27:17 +0200
commitcca3050b9ec46ee2f11a7abbde2d1bad07283630 (patch)
tree7dee7d6594f33b1d011b054508f44591e9682311 /test
parenttree-wide: Fix typo (diff)
downloadsystemd-cca3050b9ec46ee2f11a7abbde2d1bad07283630.tar.xz
systemd-cca3050b9ec46ee2f11a7abbde2d1bad07283630.zip
test: use cp for journal copying when systemd-journal-remote non-existent
Diffstat (limited to 'test')
-rw-r--r--test/test-functions8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test-functions b/test/test-functions
index 7155e99c0e..3748210527 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -94,7 +94,7 @@ fi
PATH_TO_INIT="$ROOTLIBDIR/systemd"
SYSTEMD_JOURNALD="${SYSTEMD_JOURNALD:-$(command -v "$BUILD_DIR/systemd-journald" || command -v "$ROOTLIBDIR/systemd-journald")}"
-SYSTEMD_JOURNAL_REMOTE="${SYSTEMD_JOURNAL_REMOTE:-$(command -v "$BUILD_DIR/systemd-journal-remote" || command -v "$ROOTLIBDIR/systemd-journal-remote")}"
+SYSTEMD_JOURNAL_REMOTE="${SYSTEMD_JOURNAL_REMOTE:-$(command -v "$BUILD_DIR/systemd-journal-remote" || command -v "$ROOTLIBDIR/systemd-journal-remote" || echo "")}"
SYSTEMD="${SYSTEMD:-$(command -v "$BUILD_DIR/systemd" || command -v "$ROOTLIBDIR/systemd")}"
SYSTEMD_NSPAWN="${SYSTEMD_NSPAWN:-$(command -v "$BUILD_DIR/systemd-nspawn" || command -v systemd-nspawn)}"
JOURNALCTL="${JOURNALCTL:-$(command -v "$BUILD_DIR/journalctl" || command -v journalctl)}"
@@ -1456,7 +1456,11 @@ save_journal() {
for j in "${1:?}"/*; do
if get_bool "$save"; then
- "$SYSTEMD_JOURNAL_REMOTE" -o "$dest" --getter="$JOURNALCTL -o export -D $j"
+ if [ "$SYSTEMD_JOURNAL_REMOTE" = "" ]; then
+ cp -a "$j" "$dest"
+ else
+ "$SYSTEMD_JOURNAL_REMOTE" -o "$dest" --getter="$JOURNALCTL -o export -D $j"
+ fi
fi
if [ -n "${TEST_SHOW_JOURNAL}" ]; then