[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 21/21] Update metadatabalance tests to include sanity checks for vgchange.



Signed-off-by: Dave Wysochanski <dwysocha redhat com>
---
 test/t-metadata-balance.sh |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/test/t-metadata-balance.sh b/test/t-metadata-balance.sh
index c0dd679..64e165b 100755
--- a/test/t-metadata-balance.sh
+++ b/test/t-metadata-balance.sh
@@ -28,6 +28,8 @@ for mdacp in 1 2; do
 	if [ $pv_in_vg = 1 ]; then
 		check_vg_field_ $vg vg_mda_count $(($mdacp * 2))
 		check_vg_field_ $vg vg_mda_count_disabled $mdacp
+		check_vg_field_ $vg vg_mda_balance_min 1
+		check_vg_field_ $vg vg_mda_balance_max 3
 	fi
 	pvchange --metadatadisable n $dev1
 	check_pv_field_ $dev1 pv_mda_count $mdacp
@@ -35,7 +37,30 @@ for mdacp in 1 2; do
 	if [ $pv_in_vg = 1 ]; then
 		check_vg_field_ $vg vg_mda_count $(($mdacp * 2))
 		check_vg_field_ $vg vg_mda_count_disabled 0
+		check_vg_field_ $vg vg_mda_balance_min 1
+		check_vg_field_ $vg vg_mda_balance_max 3
+		# Sanity test of metadata balance params
+		# 'min' threshold (1 < min <= max)
+		# 'max' threshold (min <= max <= #pvs)
+		not vgchange --metadatabalancemin 0 $vg
+		not vgchange --metadatabalancemin 4 $vg
+		vgchange --metadatabalancemin 2 $vg
+		check_vg_field_ $vg vg_mda_balance_min 2
+		not vgchange --metadatabalancemax 4 $vg
+		vgchange --metadatabalancemax 2 $vg
+		check_vg_field_ $vg vg_mda_balance_max 2
+		vgchange --metadatabalancemax 3 $vg
+		check_vg_field_ $vg vg_mda_balance_max 3
+		vgchange --metadatabalancemin 3 $vg
+		check_vg_field_ $vg vg_mda_balance_min 3
 		vgremove -f $vg
 	fi
 done
 done
+
+# Test behavior of metadata balance min / max
+# ensure setting min/max affects underlying pv enable/disable
+
+# Setting a larger min value should trigger enabling mdas
+# Setting a smaller max value should trigger disabling mdas
+# vg_mda_count_disabled should always be consistent with min/max
\ No newline at end of file
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]