Commit 023a7283 authored by Helen Koike's avatar Helen Koike

wip: cache

parent 1ad3f806
......@@ -28,7 +28,7 @@ fill_rootfs()
sudo chmod +x dm-mount/bin/init.sh
}
create_snap_mirror()
create_3part()
{
# Create disk
DISK=$1
......@@ -48,7 +48,7 @@ create_snap_mirror()
# Partition 2
sudo sgdisk -n 2:0:+200M -t 2:7f01 "$DISK"
# Partition 3
sudo sgdisk -n 3:0:+200M -t 2:7f01 "$DISK"
sudo sgdisk -n 3:0:+200M -t 3:7f01 "$DISK"
LOOP_DEV=$(sudo losetup -fP --show $DISK)
sectors=$(sudo blockdev --getsz "${LOOP_DEV}"p1)
......@@ -619,36 +619,45 @@ snap_tests()
{
launch_test \
"snap: snapshot-origin" \
"-hda ${DSN1}" \
"-hda ${D3P}" \
/dev/dm-4 \
"dm-snap-orig,,4,ro,0 ${DSN1_sectors} snapshot-origin 8:1"
"dm-snap-orig,,4,ro,0 ${D3P_sectors} snapshot-origin 8:1"
launch_test \
"snap: snapshot-origin" \
"-hda ${DSN1}" \
"-hda ${D3P}" \
/dev/dm-0 \
"dm-snap,,,ro,0 ${DSN1_sectors} snapshot 8:1 8:2 P 8"
"dm-snap,,,ro,0 ${D3P_sectors} snapshot 8:1 8:2 P 8"
launch_test \
"snap: snapshot-merge" \
"-hda ${DSN1}" \
"-hda ${D3P}" \
/dev/dm-0 \
"dm-snap,,,ro,0 ${DSN1_sectors} snapshot-merge 8:1 8:2 P 8"
"dm-snap,,,ro,0 ${D3P_sectors} snapshot-merge 8:1 8:2 P 8"
}
mirror_tests()
{
launch_test \
"mirror: core" \
"-hda ${DM1}" \
"-hda ${D3P}" \
/dev/dm-4 \
"dm-mirror-core,,4,ro,0 ${DM1_sectors} mirror core 1 1024 2 /dev/sda1 0 /dev/sda2 0 1 handle_errors"
"dm-mirror-core,,4,ro,0 ${D3P_sectors} mirror core 1 1024 2 /dev/sda1 0 /dev/sda2 0 1 handle_errors"
launch_test \
"mirror: disk" \
"-hda ${DM1}" \
"-hda ${D3P}" \
/dev/dm-4 \
"dm-mirror-disk,,4,ro,0 ${D3P_sectors} mirror disk 2 /dev/sda3 1024 2 /dev/sda1 0 /dev/sda2 0 1 handle_errors"
}
cache_tests()
{
launch_test \
"cache: with minor" \
"-hda ${D3P}" \
/dev/dm-4 \
"dm-mirror-disk,,4,ro,0 ${DM1_sectors} mirror disk 2 /dev/sda3 1024 2 /dev/sda1 0 /dev/sda2 0 1 handle_errors"
"dm-cache,,4,ro,0 ${D3P_sectors} cache /dev/sda3 /dev/sda2 /dev/sda1 128 0 default 0"
}
DR41=disk-raid4-1.img
......@@ -691,15 +700,11 @@ create_crypt $DC1 DC1_
# Load disk info
source ${DC1}.info
DSN1=disk-snap-1.img
create_snap_mirror $DSN1 DSN1_
# Load disk info
source ${DSN1}.info
DM1=disk-mirror-1.img
create_snap_mirror $DM1 DM1_
# used by snap, mirror and cache
D3P=disk-3part-1.img
create_3part $D3P D3P_ 3part
# Load disk info
source ${DM1}.info
source ${D3P}.info
verity_tests
linear_parser_tests
......@@ -708,3 +713,4 @@ crypt_tests
raid_tests
snap_tests
mirror_tests
cache_tests
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment