mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-30 17:31:43 +00:00
8c759d5a06
Since run_check_stdout() can insert INSTRUMENT for all btrfs related programs, which could easily pollute the stdout, any caller of run_check_stdout() should do proper filter. The following callers are affected: - misc/004 Filter the output of "btrfs ins min-dev-size" - misc/009 - misc/013 - misc/024 They are all calling "btrfs ins rootid", so introduce get_subvolid() function to grab the subvolid properly. - misc/031 Loose the filter for "btrfs qgroup show". No need for "tail -n 1". So we still have the same coverage, but now these tests won't cause false alert if we insert INSTRUMENT for all btrfs commands. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
50 lines
1.1 KiB
Bash
Executable File
50 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Verify that subvolume sync waits until the subvolume is cleaned and does not
|
|
# crash at the end
|
|
|
|
source "$TEST_TOP/common"
|
|
|
|
check_prereq mkfs.btrfs
|
|
check_prereq btrfs
|
|
|
|
setup_root_helper
|
|
|
|
prepare_test_dev
|
|
run_check_mkfs_test_dev
|
|
run_check_mount_test_dev
|
|
run_check $SUDO_HELPER chmod a+rw "$TEST_MNT"
|
|
|
|
cd "$TEST_MNT"
|
|
|
|
for i in `seq 5`; do
|
|
run_check dd if=/dev/zero of=file$i bs=1M count=10
|
|
done
|
|
|
|
# 128 is minimum
|
|
for sn in `seq 130`;do
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot . snap$sn
|
|
for i in `seq 10`; do
|
|
run_check dd if=/dev/zero of="snap$sn/file$i" bs=1M count=1
|
|
done
|
|
done
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume list .
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume list -d .
|
|
|
|
idtodel=`$SUDO_HELPER "$TOP/btrfs" inspect-internal rootid snap3`
|
|
|
|
# delete, sync after some time
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume delete -c snap*
|
|
{ sleep 5; run_check "$TOP/btrfs" filesystem sync "$TEST_MNT"; } &
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume sync .
|
|
|
|
run_check "$TOP/btrfs" filesystem sync "$TEST_MNT"
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume list -d .
|
|
|
|
wait
|
|
cd ..
|
|
|
|
run_check_umount_test_dev
|