]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Install test journals
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 22 Mar 2024 11:08:52 +0000 (12:08 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 22 Mar 2024 14:11:39 +0000 (15:11 +0100)
Let's package these just like we package other test data.

test/TEST-04-JOURNAL/test.sh
test/meson.build
test/units/testsuite-04.corrupted-journals.sh
test/units/testsuite-04.journal.sh

index 42574ce8ea7cfecf782f179132f0359efa1c95df..f8f3a4b3e32cf3f521b3e44ece906004497dbe57 100755 (executable)
@@ -11,9 +11,6 @@ test_append_files() {
     local workspace="${1:?}"
     local dropin_dir
 
-    mkdir -p "$workspace/test-journals/"
-    cp -av "${TEST_BASE_DIR:?}/test-journals/"* "$workspace/test-journals/"
-
     image_install curl setterm unzstd
     image_install -o openssl
     # Necessary for RH-based systems, otherwise MHD fails with:
index b47fa612b15d13d5d54fcccd49ae4b06ee903da4..aadf37a139ea610050bdb9dc1b437782d5c513cf 100644 (file)
@@ -4,6 +4,7 @@ if install_tests
         foreach subdir : [
                 'auxv',
                 'journal-data',
+                'test-journals',
                 'units',
                 'test-execute',
                 'test-fstab-generator',
index 2123b10152893758f4141564c25e4785b04d901f..479011ea78f43b81d0c162f281f30357ea67ba06 100755 (executable)
@@ -6,11 +6,11 @@ set -o pipefail
 JOURNAL_DIR="$(mktemp -d)"
 REMOTE_OUT="$(mktemp -d)"
 # tar on C8S doesn't support the --zstd option
-unzstd --stdout "/test-journals/afl-corrupted-journals.tar.zst" | tar -xC "$JOURNAL_DIR/"
+unzstd --stdout "/usr/lib/systemd/tests/testdata/test-journals/afl-corrupted-journals.tar.zst" | tar -xC "$JOURNAL_DIR/"
 while read -r file; do
     filename="${file##*/}"
     unzstd "$file" -o "$JOURNAL_DIR/${filename%*.zst}"
-done < <(find /test-journals/corrupted/ -name "*.zst")
+done < <(find /usr/lib/systemd/tests/testdata/test-journals/corrupted/ -name "*.zst")
 # First, try each of them sequentially. Skip this part when running with plain
 # QEMU, as it is excruciatingly slow
 # Note: we care only about exit code 124 (timeout) and special bash exit codes
index 40ae39557beb4a6a0bbe3e05bf2d5cb67e0ec9cf..90d865cdf571c74f4dbbe30015e7bad84ec49660 100755 (executable)
@@ -244,7 +244,7 @@ JOURNAL_DIR="$(mktemp -d)"
 while read -r file; do
     filename="${file##*/}"
     unzstd "$file" -o "$JOURNAL_DIR/${filename%*.zst}"
-done < <(find /test-journals/no-rtc -name "*.zst")
+done < <(find /usr/lib/systemd/tests/testdata/test-journals/no-rtc -name "*.zst")
 
 journalctl --directory="$JOURNAL_DIR" --list-boots --output=json >/tmp/lb1
 diff -u /tmp/lb1 - <<'EOF'