Skip to content

Commit

Permalink
Make kickstart tests growing LVs stricter
Browse files Browse the repository at this point in the history
Having the installation succeed is a great thing, but if the request in
kickstart was that some LV should grow to a maximum possible size, we shouldn't
end up with a VG having a lot of free space (unless the request was for a thin
pool where we intentionally leave 20 % of space free for future growths).
  • Loading branch information
vpodzime committed Sep 1, 2015
1 parent b958a4d commit c8c9088
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
18 changes: 18 additions & 0 deletions tests/kickstart_tests/lvm-cache-2.ks
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ if [ -z "$root_lv_entry" -a -z "$root_uuid_entry" ] ; then
echo "*** root LV is not the root entry in /etc/fstab" >> /root/RESULT
fi
# verify size of root lv
root_lv_size=$(lvs --noheadings -o size --unit=m --nosuffix fedora/root | sed -r 's/\s*([0-9]+)\..*/\1/')
if [ $root_lv_size -le 4000 ]; then
echo "*** root lv has incorrect size" >> /root/RESULT
fi
# verify size of home lv
home_lv_size=$(lvs --noheadings -o size --unit=m --nosuffix fedora/home | sed -r 's/\s*([0-9]+)\..*/\1/')
if [ $home_lv_size -le 1000 ]; then
echo "*** home lv has incorrect size" >> /result/RESULT
fi
# verify swap on lvm is active
swap_lv="/dev/mapper/fedora-swap"
swap_uuid="UUID=$(blkid -o value -s UUID "$swap_lv")"
Expand All @@ -69,6 +81,12 @@ if [ "$swap_lv_size" != "500" ]; then
echo "*** swap lv has incorrect size" >> /root/RESULT
fi
# verify that not too much space was left free in the VG
vg_free="$(vgs -o vg_free_count --noheadings fedora)"
if [ $vg_free -gt 2 ]; then
echo "*** too much free space left in the fedora vg" >> /root/RESULT
fi
# we don't need to check sizes of grown LVs, the fact that the installation
# reached this point means everything fit into the VG somehow
Expand Down
9 changes: 7 additions & 2 deletions tests/kickstart_tests/lvm-raid-1.ks
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ if [ -z "$root_lv_entry" -a -z "$root_uuid_entry" ] ; then
echo "*** root lv is not the root entry in /etc/fstab" >> /root/RESULT
fi
# verify size of root lv (do not check any particular size, let's just be happy to see the
# installation succeed and the LV grown somehow, for now)
# verify size of root lv
root_lv_size=$(lvs --noheadings -o size --unit=m --nosuffix fedora/root | sed -r 's/\s*([0-9]+)\..*/\1/')
if [ $root_lv_size -le 4000 ]; then
echo "*** root lv has incorrect size" >> /root/RESULT
fi
# verify that not too much space was left free in the VG
vg_free="$(vgs -o vg_free_count --noheadings fedora)"
if [ $vg_free -gt 2 ]; then
echo "*** too much free space left in the fedora vg" >> /root/RESULT
fi
# verify swap on lvm is active
swap_lv="/dev/mapper/fedora-swap"
swap_uuid="UUID=$(blkid -o value -s UUID $swap_lv)"
Expand Down

0 comments on commit c8c9088

Please sign in to comment.