mirror of
https://github.com/systemd/systemd.git
synced 2026-08-13 17:08:14 +00:00
test: Modernize btrfs tests
Convert test-btrfs to use the test framework and assertions, merge the physical offset test into it and beef it up to include what TEST-83-BTRFS does and finally get rid of TEST-83-BTRFS as it is unneeded now. (cherry picked from commit7cc5d161e6) (cherry picked from commit1a16a22bb7)
This commit is contained in:
committed by
Luca Boccassi
parent
d3847d1949
commit
e85b9a01bc
@@ -1,8 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
integration_tests += [
|
||||
integration_test_template + {
|
||||
'name' : fs.name(meson.current_source_dir()),
|
||||
'vm' : true,
|
||||
},
|
||||
]
|
||||
@@ -96,7 +96,6 @@ foreach dirname : [
|
||||
'TEST-80-NOTIFYACCESS',
|
||||
'TEST-81-GENERATORS',
|
||||
'TEST-82-SOFTREBOOT',
|
||||
'TEST-83-BTRFS',
|
||||
'TEST-84-STORAGETM',
|
||||
'TEST-85-NETWORK',
|
||||
'TEST-86-MULTI-PROFILE-UKI',
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
FSTYPE="$(stat --file-system --format "%T" /)"
|
||||
|
||||
if [[ "$FSTYPE" != "btrfs" ]]; then
|
||||
echo "Root filesystem is $FSTYPE instead of btrfs, skipping"
|
||||
exit 77
|
||||
fi
|
||||
|
||||
TEST_BTRFS_OFFSET=/usr/lib/systemd/tests/unit-tests/manual/test-btrfs-physical-offset
|
||||
|
||||
SWAPFILE=/var/tmp/swapfile
|
||||
|
||||
btrfs filesystem mkswapfile -s 10m "$SWAPFILE"
|
||||
sync -f "$SWAPFILE"
|
||||
|
||||
offset_btrfs_progs="$(btrfs inspect-internal map-swapfile -r "$SWAPFILE")"
|
||||
echo "btrfs-progs: $offset_btrfs_progs"
|
||||
|
||||
offset_btrfs_util="$("$TEST_BTRFS_OFFSET" "$SWAPFILE")"
|
||||
echo "btrfs-util: $offset_btrfs_util"
|
||||
|
||||
(( offset_btrfs_progs == offset_btrfs_util ))
|
||||
|
||||
rm -f "$SWAPFILE"
|
||||
|
||||
/usr/lib/systemd/tests/unit-tests/manual/test-btrfs
|
||||
|
||||
touch /testok
|
||||
Reference in New Issue
Block a user