[PATCH] sync from lvm-utils.sh

Jim Meyering meyering at redhat.com
Fri Jun 6 07:38:11 UTC 2008


---
 tests/dm-utils.sh |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/tests/dm-utils.sh b/tests/dm-utils.sh
index a1c907b..2aba445 100644
--- a/tests/dm-utils.sh
+++ b/tests/dm-utils.sh
@@ -50,6 +50,54 @@ loop_setup_()
   return 0;
 }

+compare_vg_field_()
+{
+if test "$verbose" =3D "t"
+then
+  echo "compare_vg_field_ VG1: `vgs --noheadings -o $3 $1` VG2: `vgs --noh=
eadings -o $3 $2`"
+fi
+  return $(test $(vgs --noheadings -o $3 $1) =3D=3D $(vgs --noheadings -o =
$3 $2) )
+}
+
+check_vg_field_()
+{
+if test "$verbose" =3D "t"
+then
+  echo "check_vg_field_ VG=3D$1, field=3D$2, actual=3D`vgs --noheadings -o=
 $2 $1`, expected=3D$3"
+fi
+  return $(test $(vgs --noheadings -o $2 $1) =3D=3D $3)
+}
+
+check_pv_field_()
+{
+if test "$verbose" =3D "t"
+then
+  echo "check_pv_field_ PV=3D$1, field=3D$2, actual=3D`pvs --noheadings -o=
 $2 $1`, expected=3D$3"
+fi
+  return $(test $(pvs --noheadings -o $2 $1) =3D=3D $3)
+}
+
+check_lv_field_()
+{
+if test "$verbose" =3D "t"
+then
+  echo "check_lv_field_ LV=3D$1, field=3D$2, actual=3D`lvs --noheadings -o=
 $2 $1`, expected=3D$3"
+fi
+  return $(test $(lvs --noheadings -o $2 $1) =3D=3D $3)
+}
+
+vg_validate_pvlv_counts_()
+{
+	local local_vg=3D$1
+	local num_pvs=3D$2
+	local num_lvs=3D$3
+	local num_snaps=3D$4
+
+	check_vg_field_ $local_vg pv_count $num_pvs &&
+	check_vg_field_ $local_vg lv_count $num_lvs &&
+	check_vg_field_ $local_vg snap_count $num_snaps
+}
+
 dmsetup_has_dm_devdir_support_()
 {
   # Detect support for the envvar.  If it's supported, the
@@ -89,6 +137,6 @@ init_root_dir_()
 EOF
 }

-if test $(this_test_) =3D t6000; then
+if test $(this_test_) !=3D 000-basic; then
   init_root_dir_
 fi
--=20
1.5.6.rc0.30.g7c3f3




More information about the parted-devel mailing list