1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: catch all output

Previous fix was invalid (after some in-place shuffling)
'dd' copied goes to 'stderr' so we need to catch all output.
Grep needs to check output of tee tool.
Ensure 'C' locales are in use with 'dd'.
This commit is contained in:
Zdenek Kabelac 2023-07-17 16:24:22 +02:00
parent 1c2782354c
commit b2431d105e
2 changed files with 3 additions and 3 deletions

View File

@ -965,7 +965,7 @@ corrupt_dev() {
test -n "${a[0]-}" || return 0
# Seek for the sequence and replace it with corruption pattern
echo -n "${a[1]/$2/$3}" | dd of="$1" bs=1 seek="${a[0]}" conv=fdatasync
echo -n "${a[1]/$2/$3}" | LANG=C dd of="$1" bs=1 seek="${a[0]}" conv=fdatasync
}
prepare_backing_dev() {

View File

@ -53,8 +53,8 @@ _test1() {
# Corrupting raid1 is simple - 1 leg needs to be modifed
# For raid5 corrupted block can be places on any of its leg.
for i in "$@" ; do
aux corrupt_dev "$i" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB |tee out
grep -q "copied" && break # leg found and corrupted
aux corrupt_dev "$i" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB |& tee out
grep -q "copied" out && break # leg found and corrupted
done
lvchange -ay $vg/$lv1