From 8105e4322419b80304f4f71297ff2f687c9c7ccc Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Fri, 12 Feb 2016 12:05:59 +0100 Subject: tests: fix tests checking pv_attr - there's a new bit now --- lib/format_text/format-text.c | 3 +++ test/shell/pvchange-usage.sh | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 666357c95..72ca19878 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -1447,6 +1447,9 @@ static int _text_pv_needs_rewrite(const struct format_type *fmt, struct physical *needs_rewrite = 0; + if (!pv->is_labelled) + return 1; + if (!(info = lvmcache_info_from_pvid((const char *)&pv->id, 0))) { log_error("Failed to find cached info for PV %s.", pv_dev_name(pv)); return 0; diff --git a/test/shell/pvchange-usage.sh b/test/shell/pvchange-usage.sh index b6fbebdb6..ce44d841a 100644 --- a/test/shell/pvchange-usage.sh +++ b/test/shell/pvchange-usage.sh @@ -23,11 +23,11 @@ aux prepare_pvs 4 # check 'allocatable' pv attribute pvcreate "$dev1" -check pv_field "$dev1" pv_attr --- +check pv_field "$dev1" pv_attr ---- vgcreate $vg1 "$dev1" -check pv_field "$dev1" pv_attr a-- +check pv_field "$dev1" pv_attr a--u pvchange --allocatable n "$dev1" -check pv_field "$dev1" pv_attr --- +check pv_field "$dev1" pv_attr ---u vgremove -ff $vg1 not pvchange --allocatable y "$dev1" pvremove -ff "$dev1" @@ -50,10 +50,10 @@ do # "vgchange disable/enable allocation for pvs with metadatacopies = $mda (bz452982)" pvchange "$dev1" -x n pvchange "$dev1" -x n # already disabled - check pv_field "$dev1" pv_attr --- + check pv_field "$dev1" pv_attr ---u pvchange "$dev1" -x y pvchange "$dev1" -x y # already enabled - check pv_field "$dev1" pv_attr a-- + check pv_field "$dev1" pv_attr a--u # check we are able to change number of managed metadata areas if test $mda -gt 0 ; then -- cgit v1.2.1