mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-08 21:57:06 +00:00
btrfs-progs: tests: more variable quoting in common scripts
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c1d714f944
commit
55db7bf059
14
tests/common
14
tests/common
@ -73,7 +73,7 @@ run_mayfail()
|
||||
echo "############### $@" >> "$RESULTS" 2>&1
|
||||
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mayfail): $@" > /dev/tty; fi
|
||||
if [ "$1" = 'root_helper' ]; then
|
||||
"$@" >> $RESULTS 2>&1
|
||||
"$@" >> "$RESULTS" 2>&1
|
||||
else
|
||||
$INSTRUMENT "$@" >> "$RESULTS" 2>&1
|
||||
fi
|
||||
@ -136,11 +136,11 @@ check_image()
|
||||
|
||||
image=$1
|
||||
echo "testing image $(basename $image)" >> "$RESULTS"
|
||||
$TOP/btrfs check "$image" >> "$RESULTS" 2>&1
|
||||
"$TOP/btrfs" check "$image" >> "$RESULTS" 2>&1
|
||||
[ $? -eq 0 ] && _fail "btrfs check should have detected corruption"
|
||||
|
||||
run_check $TOP/btrfs check --repair "$image"
|
||||
run_check $TOP/btrfs check "$image"
|
||||
run_check "$TOP/btrfs" check --repair "$image"
|
||||
run_check "$TOP/btrfs" check "$image"
|
||||
}
|
||||
|
||||
# Extract a usable image from packed formats
|
||||
@ -322,7 +322,7 @@ generate_dataset() {
|
||||
dirpath=$TEST_MNT/$dataset_type
|
||||
run_check $SUDO_HELPER mkdir -p "$dirpath"
|
||||
|
||||
case $dataset_type in
|
||||
case "$dataset_type" in
|
||||
small)
|
||||
for num in $(seq 1 "$DATASET_SIZE"); do
|
||||
run_check $SUDO_HELPER dd if=/dev/urandom of="$dirpath/$dataset_type.$num" bs=10K \
|
||||
@ -332,14 +332,14 @@ generate_dataset() {
|
||||
|
||||
hardlink)
|
||||
for num in $(seq 1 "$DATASET_SIZE"); do
|
||||
run_check $SUDO_HELPER touch $dirpath/$dataset_type.$num
|
||||
run_check $SUDO_HELPER touch "$dirpath/$dataset_type.$num"
|
||||
run_check $SUDO_HELPER ln "$dirpath/$dataset_type.$num" "$dirpath/hlink.$num"
|
||||
done
|
||||
;;
|
||||
|
||||
fast_symlink)
|
||||
for num in $(seq 1 "$DATASET_SIZE"); do
|
||||
run_check $SUDO_HELPER touch $dirpath/$dataset_type.$num
|
||||
run_check $SUDO_HELPER touch "$dirpath/$dataset_type.$num"
|
||||
run_check cd "$dirpath" && \
|
||||
$SUDO_HELPER ln -s "$dataset_type.$num" "$dirpath/slink.$num" && \
|
||||
cd /
|
||||
|
@ -89,7 +89,7 @@ convert_test_acl() {
|
||||
# $2: nodesize, argument of -N, can be empty
|
||||
convert_test_do_convert() {
|
||||
run_check "$TOP/btrfs-convert" ${1:+-O "$1"} ${2:+-N "$2"} "$TEST_DEV"
|
||||
run_check "$TOP/btrfs" check $TEST_DEV
|
||||
run_check "$TOP/btrfs" check "$TEST_DEV"
|
||||
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa "$TEST_DEV"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user