mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: use odirect
Fill snaphot with odirect so we know data hits disk before we test how full the snapshot is.
This commit is contained in:
parent
74a81a4577
commit
4f6660db7d
@ -21,9 +21,9 @@ vgcreate -s 4k $vg $(cat DEVICES)
|
|||||||
lvcreate -aey -l 5 -n foo $vg
|
lvcreate -aey -l 5 -n foo $vg
|
||||||
lvcreate -s -n snap $vg/foo -l 3 -c 4k
|
lvcreate -s -n snap $vg/foo -l 3 -c 4k
|
||||||
lvcreate -s -n snap2 $vg/foo -l 6 -c 4k
|
lvcreate -s -n snap2 $vg/foo -l 6 -c 4k
|
||||||
dd if=/dev/urandom of="$DM_DEV_DIR/$vg/snap2" count=1 bs=1024
|
dd if=/dev/zero of="$DM_DEV_DIR/$vg/snap2" count=1 bs=1024 oflag=direct
|
||||||
lvcreate -aey --type mirror -m 1 -n mirr $vg -l 1 --mirrorlog core
|
lvcreate -aey --type mirror -m 1 -n mirr $vg -l 1 --mirrorlog core
|
||||||
lvs $vg
|
lvs -a $vg
|
||||||
aux apitest percent $vg
|
aux apitest percent $vg
|
||||||
|
|
||||||
vgremove -ff $vg
|
vgremove -ff $vg
|
||||||
|
@ -16,8 +16,7 @@ extend() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
write_() {
|
write_() {
|
||||||
dd if=/dev/zero of="$DM_DEV_DIR/$vg/snap" bs=1k count=$2 seek=$1
|
dd if=/dev/zero of="$DM_DEV_DIR/$vg/snap" bs=1k count=$2 seek=$1 oflag=direct
|
||||||
sync
|
|
||||||
}
|
}
|
||||||
|
|
||||||
percent_() {
|
percent_() {
|
||||||
|
@ -32,8 +32,8 @@ mkdir "$mntdir"
|
|||||||
mount "$DM_DEV_DIR/mapper/$vg-snap" "$mntdir"
|
mount "$DM_DEV_DIR/mapper/$vg-snap" "$mntdir"
|
||||||
mount
|
mount
|
||||||
cat /proc/mounts | grep "$mntdir"
|
cat /proc/mounts | grep "$mntdir"
|
||||||
dd if=/dev/zero of="$mntdir/file$1" bs=1M count=5
|
dd if=/dev/zero of="$mntdir/file$1" bs=1M count=5 oflag=direct
|
||||||
sync
|
|
||||||
#dmeventd only checks every 10 seconds :(
|
#dmeventd only checks every 10 seconds :(
|
||||||
for i in {1..10}; do
|
for i in {1..10}; do
|
||||||
cat /proc/mounts | grep "$mntdir" || break
|
cat /proc/mounts | grep "$mntdir" || break
|
||||||
|
@ -22,7 +22,7 @@ lvcreate -aey -L1 -n $lv1 $vg
|
|||||||
# Snapshot should be large enough to handle any writes
|
# Snapshot should be large enough to handle any writes
|
||||||
lvcreate -L2 -s $vg/$lv1 -n $lv2
|
lvcreate -L2 -s $vg/$lv1 -n $lv2
|
||||||
|
|
||||||
dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1
|
dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 oflag=direct
|
||||||
|
|
||||||
# Snapshot must not be 'I'nvalid here
|
# Snapshot must not be 'I'nvalid here
|
||||||
check lv_attr_bit state $vg/$lv2 "a"
|
check lv_attr_bit state $vg/$lv2 "a"
|
||||||
|
Loading…
Reference in New Issue
Block a user