]> sourceware.org Git - lvm2.git/commitdiff
tests: add help function
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 16 Sep 2013 09:02:58 +0000 (11:02 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 16 Sep 2013 09:22:04 +0000 (11:22 +0200)
Add mkdev_md5sum to create and checksum given LV.
Add dev_md5sum to verify device has matching md5 sum.

test/lib/aux.sh
test/lib/check.sh

index e07397d93200a4b7e5ac92dc1d9e30c3b78f083a..6194492c9253e4286dc1962a2d0bed3476f36053 100644 (file)
@@ -506,6 +506,12 @@ unhide_dev() {
        lvmconf "$filter"
 }
 
+mkdev_md5sum() {
+       rm -f debug.log
+       mkfs.ext2 "$DM_DEV_DIR/$1/$2" || return 1
+       md5sum "$DM_DEV_DIR/$1/$2" > "md5.$1-$2"
+}
+
 generate_config() {
        if test -n "$profile_name"; then
                config_values=PROFILE_VALUES_$profile_name
index 8b2cfcebbf35b91d6a0c6afe48deb30a0b926922..6eedb47278e44de3eebec61c2aee8c6babc8a2ca 100644 (file)
@@ -280,5 +280,13 @@ pvlv_counts() {
        vg_field $local_vg snap_count $num_snaps
 }
 
+# Compare md5 check generated from get dev_md5sum
+dev_md5sum() {
+       md5sum -c "md5.$1-$2" || \
+               (get lv_field $1/$2 "name,size,seg_pe_ranges"
+                die "LV $1/$2 has different MD5 check sum!")
+}
+
+#set -x
 unset LVM_VALGRIND
 "$@"
This page took 0.043029 seconds and 5 git commands to generate.