From: Vratislav Podzimek <vpodzime(a)redhat.com>
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).
---
tests/kickstart_tests/lvm-cache-2.ks | 18 ++++++++++++++++++
tests/kickstart_tests/lvm-raid-1.ks | 9 +++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/tests/kickstart_tests/lvm-cache-2.ks b/tests/kickstart_tests/lvm-cache-2.ks
index 3d7290a..142b32d 100644
--- a/tests/kickstart_tests/lvm-cache-2.ks
+++ b/tests/kickstart_tests/lvm-cache-2.ks
@@ -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")"
@@ -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
diff --git a/tests/kickstart_tests/lvm-raid-1.ks b/tests/kickstart_tests/lvm-raid-1.ks
index 25e099d..55bac34 100644
--- a/tests/kickstart_tests/lvm-raid-1.ks
+++ b/tests/kickstart_tests/lvm-raid-1.ks
@@ -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)"
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/c8c908898c212f48bb8612a7a3...