master - tests: workaround clvmd .cache consistency
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1216aa7826428d...
Commit: 1216aa7826428dfa5f83af4bd29c7741de7a1a23
Parent: 2c8f0c9800e658c14d57f1726055876dab869d08
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 23:13:22 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:45:00 2014 +0200
tests: workaround clvmd .cache consistency
May need futher fixes, but it's needed only on non-udev systems
(systems which still needs .cache - just like test suite)
---
test/shell/stray-device-node.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/test/shell/stray-device-node.sh b/test/shell/stray-device-node.sh
index 8e67caa..cd6525f 100644
--- a/test/shell/stray-device-node.sh
+++ b/test/shell/stray-device-node.sh
@@ -17,5 +17,9 @@ cp -r "$dev1" "$DM_DEV_DIR/stray"
vgcreate $vg $(cat DEVICES)
lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg
aux disable_dev "$dev1"
+# FIXME:
+# for the .cache use case we need to run pvscan
+# to keep clvmd in sync.
+pvscan
vgreduce --removemissing --force $vg
aux enable_dev "$dev1"
10 years, 1 month
master - tests: more vgexport tests
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2c8f0c9800e658...
Commit: 2c8f0c9800e658c14d57f1726055876dab869d08
Parent: cc82dc7b23902c900ac59c35566bd63d65902155
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 22:45:02 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:45:00 2014 +0200
tests: more vgexport tests
cover more options
---
test/shell/vgimportclone.sh | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/test/shell/vgimportclone.sh b/test/shell/vgimportclone.sh
index 923638e..29c172e 100644
--- a/test/shell/vgimportclone.sh
+++ b/test/shell/vgimportclone.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010-2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2010-2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -17,9 +17,27 @@ vgcreate --metadatasize 128k $vg1 "$dev1"
lvcreate -l100%FREE -n $lv1 $vg1
# Test plain vgexport vgimport tools
+
+# Argument is needed
+invalid vgexport
+invalid vgimport
+# Cannot combine -a and VG name
+invalid vgexport -a $vg
+invalid vgimport -a $vg1
+# Cannot export unknonw VG
+fail vgexport ${vg1}-non
+fail vgimport ${vg1}-non
+# Cannot export VG with active volumes
+fail vgexport $vg1
+
vgchange -an $vg1
vgexport $vg1
+# Already exported
+fail vgexport $vg1
+
vgimport $vg1
+# Already imported
+fail vgimport $vg1
vgchange -ay $vg1
# Clone the LUN
10 years, 1 month
master - cleanup: pvdisplay indent
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cc82dc7b23902c...
Commit: cc82dc7b23902c900ac59c35566bd63d65902155
Parent: d7b63340793b32e24f9e695c29d97014339fb3ec
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 23:10:42 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:44:59 2014 +0200
cleanup: pvdisplay indent
Reindent else path, since other branch already exits with return.
---
tools/pvdisplay.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c
index b85635e..3de7969 100644
--- a/tools/pvdisplay.c
+++ b/tools/pvdisplay.c
@@ -98,12 +98,15 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
return pvs(cmd, argc, argv);
- } else if (arg_count(cmd, aligned_ARG) ||
- arg_count(cmd, all_ARG) ||
- arg_count(cmd, noheadings_ARG) ||
- arg_count(cmd, options_ARG) ||
- arg_count(cmd, separator_ARG) ||
- arg_count(cmd, sort_ARG) || arg_count(cmd, unbuffered_ARG)) {
+ }
+
+ if (arg_count(cmd, aligned_ARG) ||
+ arg_count(cmd, all_ARG) ||
+ arg_count(cmd, noheadings_ARG) ||
+ arg_count(cmd, options_ARG) ||
+ arg_count(cmd, separator_ARG) ||
+ arg_count(cmd, sort_ARG) ||
+ arg_count(cmd, unbuffered_ARG)) {
log_error("Incompatible options selected");
return EINVALID_CMD_LINE;
}
10 years, 1 month
master - cleanup: vgexport drops pv pointer
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d7b63340793b32...
Commit: d7b63340793b32e24f9e695c29d97014339fb3ec
Parent: 31d68b7124519b4ed6b9ba1960cb021962f2a3dd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 22:40:02 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:44:59 2014 +0200
cleanup: vgexport drops pv pointer
PV pointer is not really needed.
---
tools/vgexport.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/tools/vgexport.c b/tools/vgexport.c
index ad658f8..d9f8efa 100644
--- a/tools/vgexport.c
+++ b/tools/vgexport.c
@@ -21,7 +21,6 @@ static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
void *handle __attribute__((unused)))
{
struct pv_list *pvl;
- struct physical_volume *pv;
if (lvs_in_vg_activated(vg)) {
log_error("Volume group \"%s\" has active logical volumes",
@@ -34,10 +33,8 @@ static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
vg->status |= EXPORTED_VG;
- dm_list_iterate_items(pvl, &vg->pvs) {
- pv = pvl->pv;
- pv->status |= EXPORTED_VG;
- }
+ dm_list_iterate_items(pvl, &vg->pvs)
+ pvl->pv->status |= EXPORTED_VG;
if (!vg_write(vg) || !vg_commit(vg))
goto_bad;
10 years, 1 month
master - man: sort options
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=31d68b7124519b...
Commit: 31d68b7124519b4ed6b9ba1960cb021962f2a3dd
Parent: 7a9c569eb41f48b32c32dd29f8f36add09e95e30
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 22:35:45 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:43:31 2014 +0200
man: sort options
Sort order for -C|--columns as with other options,
and use short capital name as the first (as with other options).
Also drop multiple reference for pvs/lvs/vgs, since now
the text for -C is really close to referrence of lvm anyway.
---
WHATS_NEW | 1 +
man/lvdisplay.8.in | 10 +++++-----
man/pvdisplay.8.in | 15 +++++++--------
man/vgdisplay.8.in | 13 ++++++-------
4 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3368c9d..0decc72 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Update man pages for pv/vg/lvdisplay.
Report error when running pvscan with free argument (i.e. PV name).
Fix error message for pvdisplay -c -m and add new for pvdisplay -c -s.
Return proper invalid cmd when vgimport/exports find error in parameters.
diff --git a/man/lvdisplay.8.in b/man/lvdisplay.8.in
index 49654bc..8348879 100644
--- a/man/lvdisplay.8.in
+++ b/man/lvdisplay.8.in
@@ -21,7 +21,7 @@ lvdisplay \- display attributes of a logical volume
.br
.B lvdisplay
-.BR \-\-columns | \-C
+.BR \-C | \-\-columns
.RB [ \-\-aligned ]
.RB [ \-a | \-\-all ]
.RB [ \-d | \-\-debug ]
@@ -66,6 +66,10 @@ For example, after creating a mirror using
this option will reveal three internal Logical Volumes, with suffixes
mimage_0, mimage_1, and mlog.
.TP
+.BR \-C ", " \-\-columns
+Display output in columns, the equivalent of \fBlvs\fP(8).
+Options listed are the same as options given in \fBlvs\fP(8).
+.TP
.BR \-c ", " \-\-colon
Generate colon separated output for easier parsing in scripts or programs.
N.B. \fBlvs\fP(8) provides considerably more control over the output.
@@ -94,10 +98,6 @@ Display the mapping of logical extents to physical volumes and
physical extents. To map physical extents
to logical extents use:
.B pvs \-\-segments \-o+lv_name,seg_start_pe,segtype
-.TP
-.BR \-\-columns ", " \-C
-Display output in columns, the equivalent of \fBlvs\fP. Options listed
-are the same as options given in \fBlvs\fP(8).
.SH Examples
Shows attributes of that logical volume. If snapshot
logical volumes have been created for this original logical volume,
diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
index 13c26b5..b2a2577 100644
--- a/man/pvdisplay.8.in
+++ b/man/pvdisplay.8.in
@@ -22,7 +22,7 @@ pvdisplay \- display attributes of a physical volume
.br
.B pvdisplay
-.BR \-\-columns | \-C
+.BR \-C | \-\-columns
.RB [ \-\-aligned ]
.RB [ \-a | \-\-all ]
.RB [ \-d | \-\-debug ]
@@ -53,8 +53,12 @@ area and so on.
\fBpvs\fP(8) is an alternative that provides the same information
in the style of \fBps\fP(1).
.SH OPTIONS
-See \fBlvm\fP for common options and \fBpvs\fP for options given with
-\fB\-\-columns\fP.
+See \fBlvm\fP(8) for common options.
+.TP
+.BR \-C ", " \-\-columns
+Display output in columns, the equivalent of \fBpvs\fP(8). See
+\fBpvs\fP(8) for a description of other options with this form of
+\fBpvdisplay\fP.
.TP
.BR \-c ", " \-\-colon
Generate colon separated output for easier parsing in scripts or programs.
@@ -83,11 +87,6 @@ Only display the size of the given physical volumes.
.BR \-m ", " \-\-maps
Display the mapping of physical extents to logical volumes and
logical extents.
-.TP
-.BR \-\-columns ", " \-C
-Display output in columns, the equivalent of \fBpvs\fP(8). See
-\fBpvs\fP(8) for a description of other options with this form of
-\fBpvdisplay\fP.
.SH SEE ALSO
.BR lvm (8),
.BR pvs (8),
diff --git a/man/vgdisplay.8.in b/man/vgdisplay.8.in
index 4dada16..7f50f83 100644
--- a/man/vgdisplay.8.in
+++ b/man/vgdisplay.8.in
@@ -22,7 +22,7 @@ vgdisplay \- display attributes of volume groups
.br
.B vgdisplay
-.BR \-\-columns | \-C
+.BR \-C | \-\-columns
.RB [ \-\-aligned ]
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
@@ -53,13 +53,16 @@ volumes and their sizes etc.
\fBvgs\fP(8) is an alternative that provides the same information
in the style of \fBps\fP(1).
.SH OPTIONS
-See \fBlvm\fP(8) for common options and \fBvgs\fP(8) for options given with
-\fB\-\-columns\fP.
+See \fBlvm\fP(8) for common options.
.TP
.BR \-A ", " \-\-activevolumegroups
Only select the active volume groups. The volume group is considered active
if at least one of its logical volumes is active.
.TP
+.BR \-C ", " \-\-columns
+Display output in columns, the equivalent of \fBvgs\fP(8).
+Options listed are the same as options given in \fPvgs\fP(8).
+.TP
.BR \-c ", " \-\-colon
Generate colon separated output for easier parsing in scripts or programs.
N.B. \fBvgs\fP(8) provides considerably more control over the output.
@@ -97,10 +100,6 @@ information of vgdisplay's activities.
.TP
.B \-\-version
Display version and exit successfully.
-.TP
-.BR \-\-columns | \-C
-Display output in columns, the equivalent of \fBvgs\fP(8).
-Options listed are the same as options given in \fPvgs\fP(8).
.SH SEE ALSO
.BR lvm (8),
.BR vgs (8),
10 years, 1 month
master - pvscan: return error when free parameter is given
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7a9c569eb41f48...
Commit: 7a9c569eb41f48b32c32dd29f8f36add09e95e30
Parent: 844afa32a0d980d0bf09ae1663f010d9e1a12839
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 23:32:53 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:42:57 2014 +0200
pvscan: return error when free parameter is given
Just like vgscan, pvscan (without --cache option) is not
accepting and 'free' args (i.e. pvscan /dev/sdx)
---
WHATS_NEW | 1 +
tools/pvscan.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 542b802..3368c9d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Report error when running pvscan with free argument (i.e. PV name).
Fix error message for pvdisplay -c -m and add new for pvdisplay -c -s.
Return proper invalid cmd when vgimport/exports find error in parameters.
Obtain list of known VGs for pvchange --all when using lvmetad.
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 724ae5f..ae14878 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -334,6 +334,11 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)
if (arg_count(cmd, cache_ARG))
return _pvscan_lvmetad(cmd, argc, argv);
+ if (argc) {
+ log_error("Too many parameters on command line.");
+ return EINVALID_CMD_LINE;
+ }
+
if (arg_count(cmd, activate_ARG)) {
log_error("--activate is only valid with --cache.");
return EINVALID_CMD_LINE;
10 years, 1 month
master - pvdisplay: fix option error
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=844afa32a0d980...
Commit: 844afa32a0d980d0bf09ae1663f010d9e1a12839
Parent: cf29de5de0a39ade491e18c1fe0e8bd3c2937b08
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 23:12:09 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:41:52 2014 +0200
pvdisplay: fix option error
Properly show error for '-m'.
Also report unsupported '-c & -s' (just like with vg/lvdisplay)
---
WHATS_NEW | 1 +
tools/pvdisplay.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index dc0d1b4..542b802 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Fix error message for pvdisplay -c -m and add new for pvdisplay -c -s.
Return proper invalid cmd when vgimport/exports find error in parameters.
Obtain list of known VGs for pvchange --all when using lvmetad.
Add man page for lvm dumpconfig.
diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c
index 34ec3d5..b85635e 100644
--- a/tools/pvdisplay.c
+++ b/tools/pvdisplay.c
@@ -109,7 +109,12 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
}
if (arg_count(cmd, colon_ARG) && arg_count(cmd, maps_ARG)) {
- log_error("Option -v not allowed with option -c");
+ log_error("Option -c not allowed with option -m");
+ return EINVALID_CMD_LINE;
+ }
+
+ if (arg_count(cmd, colon_ARG) && arg_count(cmd, short_ARG)) {
+ log_error("Option -c is not allowed with option -s");
return EINVALID_CMD_LINE;
}
10 years, 1 month
master - vgimport/vgexport: return invalid cmd
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cf29de5de0a39a...
Commit: cf29de5de0a39ade491e18c1fe0e8bd3c2937b08
Parent: 5aa2e5ec8c8fcb279362c73983f09b4b50f706c0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Mar 30 22:38:51 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Mar 30 23:40:27 2014 +0200
vgimport/vgexport: return invalid cmd
When option parsing fails, return invalid cmd instead of fail.
---
WHATS_NEW | 1 +
tools/vgexport.c | 4 ++--
tools/vgimport.c | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 626a5b8..dc0d1b4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Return proper invalid cmd when vgimport/exports find error in parameters.
Obtain list of known VGs for pvchange --all when using lvmetad.
Add man page for lvm dumpconfig.
Drop unused cmd pointer for internal function for_each_sub_lv().
diff --git a/tools/vgexport.c b/tools/vgexport.c
index c573619..ad658f8 100644
--- a/tools/vgexport.c
+++ b/tools/vgexport.c
@@ -56,12 +56,12 @@ int vgexport(struct cmd_context *cmd, int argc, char **argv)
{
if (!argc && !arg_count(cmd, all_ARG)) {
log_error("Please supply volume groups or use -a for all.");
- return ECMD_FAILED;
+ return EINVALID_CMD_LINE;
}
if (argc && arg_count(cmd, all_ARG)) {
log_error("No arguments permitted when using -a for all.");
- return ECMD_FAILED;
+ return EINVALID_CMD_LINE;
}
return process_each_vg(cmd, argc, argv, READ_FOR_UPDATE, NULL,
diff --git a/tools/vgimport.c b/tools/vgimport.c
index 3a0798a..7cb9337 100644
--- a/tools/vgimport.c
+++ b/tools/vgimport.c
@@ -60,12 +60,12 @@ int vgimport(struct cmd_context *cmd, int argc, char **argv)
{
if (!argc && !arg_count(cmd, all_ARG)) {
log_error("Please supply volume groups or use -a for all.");
- return ECMD_FAILED;
+ return EINVALID_CMD_LINE;
}
if (argc && arg_count(cmd, all_ARG)) {
log_error("No arguments permitted when using -a for all.");
- return ECMD_FAILED;
+ return EINVALID_CMD_LINE;
}
if (arg_count(cmd, force_ARG)) {
10 years, 1 month
master - tests: update pvs test
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5aa2e5ec8c8fcb...
Commit: 5aa2e5ec8c8fcb279362c73983f09b4b50f706c0
Parent: 3181dc72e7fbca5a63a3fd077fce3eafa0808ac9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 28 17:06:13 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 28 17:06:13 2014 +0100
tests: update pvs test
TODO:
It seems commit 7e685e6c70e5b738e5740b920e6080b9a13c2556
has changed the old logic, when 'pvs device_name' used
to work. (regression from 2.02.104)
Currently put in extra pvscan.
---
test/shell/lvmcache-exercise.sh | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvmcache-exercise.sh b/test/shell/lvmcache-exercise.sh
index 1e4b86a..785ab17 100644
--- a/test/shell/lvmcache-exercise.sh
+++ b/test/shell/lvmcache-exercise.sh
@@ -18,11 +18,16 @@ vgcreate $vg2 "$dev3" "$dev4" "$dev5"
aux disable_dev "$dev1"
pvscan
-vgcreate $vg1 "$dev2"
-aux enable_dev "$dev1"
# dev1 is missing
fail pvs $(cat DEVICES)
+vgcreate $vg1 "$dev2"
+aux enable_dev "$dev1"
+
+pvscan
+# FIXME: above pvscan should not be needed
+pvs "$dev1"
+
# reappearing device (rhbz 995440)
lvcreate -aey -m2 --type mirror -l4 --alloc anywhere --corelog -n $lv1 $vg2
10 years, 1 month
master - tests: more coverage for pvchange
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3181dc72e7fbca...
Commit: 3181dc72e7fbca5a63a3fd077fce3eafa0808ac9
Parent: 2a79971004d4fb14b4483d7a87eca6eae4b8dd72
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 28 11:38:50 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 28 11:38:50 2014 +0100
tests: more coverage for pvchange
Change metadataignore
Argless pvchange
Alocatability for orphans
---
test/shell/pvchange-usage.sh | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/test/shell/pvchange-usage.sh b/test/shell/pvchange-usage.sh
index a6a03fa..00489bd 100644
--- a/test/shell/pvchange-usage.sh
+++ b/test/shell/pvchange-usage.sh
@@ -13,14 +13,20 @@
. lib/test
-aux prepare_devs 4
+check_changed_uuid_() {
+ test "$1" != "$(get pv_field "$2" uuid)" || die "UUID has not changed!"
+}
+
+aux prepare_pvs 4
for mda in 0 1 2
do
# "setup pv with metadatacopies = $mda"
- pvcreate "$dev4"
pvcreate --metadatacopies $mda "$dev1"
- vgcreate $vg1 "$dev1" "$dev4"
+# cannot change allocatability for orphan PVs
+ fail pvchange "$dev1" -x y
+ fail pvchange "$dev1" -x n
+ vgcreate $vg1 "$dev4" "$dev1"
# "pvchange adds/dels tag to pvs with metadatacopies = $mda "
pvchange "$dev1" --addtag test$mda
@@ -36,9 +42,16 @@ do
pvchange "$dev1" -x y # already enabled
check pv_field "$dev1" pv_attr a--
+# check we are able to change number of managed metadata areas
+ if test $mda -gt 0 ; then
+ pvchange --force --metadataignore y "$dev1"
+ else
+ # already ignored
+ fail pvchange --metadataignore y "$dev1"
+ fi
# 'remove pv'
vgremove $vg1
- pvremove "$dev1" "$dev4"
+ pvremove "$dev1"
done
# "pvchange uuid"
@@ -49,19 +62,22 @@ vgcreate $vg1 "$dev1" "$dev2"
# Checking for different UUID after pvchange
UUID1=$(get pv_field "$dev1" uuid)
pvchange -u "$dev1"
-test "$UUID1" != "$(get pv_field "$dev1" uuid)" || die "UUID has not changed!"
+check_changed_uuid_ "$UUID1" "$dev1"
UUID2=$(get pv_field "$dev2" uuid)
pvchange -u "$dev2"
-test "$UUID2" != "$(get pv_field "$dev2" uuid)" || die "UUID has not changed!"
+check_changed_uuid_ "$UUID2" "$dev2"
UUID1=$(get pv_field "$dev1" uuid)
UUID2=$(get pv_field "$dev2" uuid)
pvchange -u --all
-test "$UUID1" != "$(get pv_field "$dev1" uuid)" || die "UUID has not changed!"
-test "$UUID2" != "$(get pv_field "$dev2" uuid)" || die "UUID has not changed!"
+check_changed_uuid_ "$UUID1" "$dev1"
+check_changed_uuid_ "$UUID2" "$dev2"
check pvlv_counts $vg1 2 0 0
+# some args are needed
+invalid pvchange
+
# '-a' needs more params
invalid pvchange -a
# '-a' is searching for devs, so specifying device is invalid
10 years, 1 month