~ubuntu-branches/debian/sid/lvm2/sid

« back to all changes in this revision

Viewing changes to test/lib/check.sh

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2014-08-19 15:37:06 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20140819153706-i1gaio8lg534dara
Tags: 2.02.109-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
282
282
                die "vg_field: vg=$1, field=\"$2\", actual=\"$actual\", expected=\"$3\""
283
283
}
284
284
 
 
285
vg_attr_bit() {
 
286
        local actual=$(get vg_field "$2" vg_attr "${@:4}")
 
287
        local offset=$1
 
288
        case "$offset" in
 
289
          perm*) offset=0 ;;
 
290
          resiz*) offset=1 ;;
 
291
          export*) offset=2 ;;
 
292
          partial) offset=3 ;;
 
293
          alloc*) offset=4 ;;
 
294
          cluster*) offset=5 ;;
 
295
        esac
 
296
        test "${actual:$offset:1}" = "$3" || \
 
297
                die "vg_attr_bit: vg=$2, ${offset} bit of \"$actual\" is \"${actual:$offset:1}\", but expected \"$3\""
 
298
}
 
299
 
285
300
lv_field() {
286
301
        local actual=$(get lv_field "$1" "$2" "${@:4}")
287
302
        test "$actual" = "$3" || \
288
 
                die "lv_field: lv=$lv, field=\"$2\", actual=\"$actual\", expected=\"$3\""
 
303
                die "lv_field: lv=$1, field=\"$2\", actual=\"$actual\", expected=\"$3\""
 
304
}
 
305
 
 
306
lv_attr_bit() {
 
307
        local actual=$(get lv_field "$2" lv_attr "${@:4}")
 
308
        local offset=$1
 
309
        case "$offset" in
 
310
          type) offset=0 ;;
 
311
          perm*) offset=1 ;;
 
312
          alloc*) offset=2 ;;
 
313
          fixed*) offset=3 ;;
 
314
          state) offset=4 ;;
 
315
          open) offset=5 ;;
 
316
          target) offset=6 ;;
 
317
          zero) offset=7 ;;
 
318
          health) offset=8 ;;
 
319
          skip) offset=9 ;;
 
320
        esac
 
321
        test "${actual:$offset:1}" = "$3" || \
 
322
                die "lv_attr_bit: lv=$2, ${offset} bit of \"$actual\" is \"${actual:$offset:1}\", but expected \"$3\""
289
323
}
290
324
 
291
325
compare_fields() {