master - dumpconfig: add --withfullcomments option
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5f6ac1c81274de...
Commit: 5f6ac1c81274de2a3162764d7c4b14a80b3a5ae2
Parent: 9ce52430de8c8920e191aca8fd27be4dc8e2c96a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 15 10:56:42 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 15 10:56:42 2015 -0500
dumpconfig: add --withfullcomments option
--withfullcomments prints all comment lines for each config option.
--withcomments prints only the first comment line, which should be
a short one-line summary of the option.
---
WHATS_NEW | 1 +
lib/config/config.c | 8 ++++++--
lib/config/config.h | 3 ++-
man/lvm-dumpconfig.8.in | 7 ++++++-
tools/args.h | 1 +
tools/commands.h | 3 ++-
tools/dumpconfig.c | 2 ++
7 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 9313ffb..29e461c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.119 -
==================================
+ Add --withfullcomments option to dumpconfig to print full comment.
Check for lvm binary in blkdeactivate and skip LVM processing if not present.
Add --enable-halvm and --disable-halvm options to lvmconf script.
Add --services, --mirrorservice and --startstopservices option to lvmconf.
diff --git a/lib/config/config.c b/lib/config/config.c
index b28472b..8f116cd 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1541,15 +1541,19 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
cfg_def = cfg_def_get_item_p(cn->id);
- if (out->tree_spec->withcomments) {
+ if (out->tree_spec->withcomments || out->tree_spec->withfullcomments) {
_cfg_def_make_path(path, sizeof(path), cfg_def->id, cfg_def, 1);
fprintf(out->fp, "\n");
fprintf(out->fp, "%s# Configuration %s %s.\n", line, node_type_name, path);
if (cfg_def->comment) {
int pos = 0;
- while (_copy_one_line(cfg_def->comment, commentline, &pos, strlen(cfg_def->comment)))
+ while (_copy_one_line(cfg_def->comment, commentline, &pos, strlen(cfg_def->comment))) {
fprintf(out->fp, "%s# %s\n", line, commentline);
+ /* withcomments prints only the first comment line. */
+ if (!out->tree_spec->withfullcomments)
+ break;
+ }
}
if (cfg_def->flags & CFG_ADVANCED)
diff --git a/lib/config/config.h b/lib/config/config.h
index 5fe6a9f..72c7606 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -144,7 +144,8 @@ struct config_def_tree_spec {
uint16_t version; /* tree at this LVM2 version */
unsigned ignoreadvanced:1; /* do not include advanced configs */
unsigned ignoreunsupported:1; /* do not include unsupported configs */
- unsigned withcomments:1; /* include comments */
+ unsigned withcomments:1; /* include first line of comment */
+ unsigned withfullcomments:1; /* include all comment lines */
unsigned withversions:1; /* include versions */
uint8_t *check_status; /* status of last tree check (currently needed for CFG_DEF_TREE_MISSING only) */
};
diff --git a/man/lvm-dumpconfig.8.in b/man/lvm-dumpconfig.8.in
index 04afce9..a4289d9 100644
--- a/man/lvm-dumpconfig.8.in
+++ b/man/lvm-dumpconfig.8.in
@@ -22,6 +22,7 @@ lvm-dumpconfig \(em dump LVM configuration
.RB [ \-\-mergedconfig ]
.RB [ \-\-validate ]
.RB [ \-\-withcomments ]
+.RB [ \-\-withfullcomments ]
.RB [ \-\-withversions ]
.RB [ ConfigurationNode... ]
@@ -140,7 +141,11 @@ option is disabled.
.TP
.B \-\-withcomments
-Also dump comments for each configuration node.
+Dump a one line comment for each configuration node.
+
+.TP
+.B \-\-withfullcomments
+Dump a full comment for each configuration node.
.TP
.B \-\-withversions
diff --git a/tools/args.h b/tools/args.h
index a40cfb0..4a43457 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -117,6 +117,7 @@ arg(version_ARG, '\0', "version", NULL, 0)
arg(vgmetadatacopies_ARG, '\0', "vgmetadatacopies", metadatacopies_arg, 0)
arg(virtualoriginsize_ARG, '\0', "virtualoriginsize", size_mb_arg, 0)
arg(withcomments_ARG, '\0', "withcomments", NULL, 0)
+arg(withfullcomments_ARG, '\0', "withfullcomments", NULL, 0)
arg(withversions_ARG, '\0', "withversions", NULL, 0)
arg(writebehind_ARG, '\0', "writebehind", int_arg, 0)
arg(writemostly_ARG, '\0', "writemostly", string_arg, ARG_GROUPABLE)
diff --git a/tools/commands.h b/tools/commands.h
index 719c507..b9c7a8b 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -70,11 +70,12 @@ xx(dumpconfig,
"\t[--mergedconfig]\n"
"\t[--validate]\n"
"\t[--withcomments]\n"
+ "\t[--withfullcomments]\n"
"\t[--withversions]\n"
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, mergedconfig_ARG, metadataprofile_ARG,
- validate_ARG, withcomments_ARG, withversions_ARG)
+ validate_ARG, withcomments_ARG, withfullcomments_ARG, withversions_ARG)
xx(formats,
"List available metadata formats",
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 09f2119..6d2108f 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -219,6 +219,8 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
if (arg_count(cmd, withcomments_ARG))
tree_spec.withcomments = 1;
+ if (arg_count(cmd, withfullcomments_ARG))
+ tree_spec.withfullcomments = 1;
if (arg_count(cmd, withversions_ARG))
tree_spec.withversions = 1;
8 years, 5 months
master - NIX: Also install device-mapper-persistent-data on CentOS 7 & FC 19+.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9ce52430de8c89...
Commit: 9ce52430de8c8920e191aca8fd27be4dc8e2c96a
Parent: 191f3cf52a0ada3aba9ac340cbab464fb05efe89
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Apr 15 16:44:15 2015 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Apr 15 16:44:15 2015 +0200
NIX: Also install device-mapper-persistent-data on CentOS 7 & FC 19+.
---
nix/default.nix | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index b8e0061..5d2a260 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -362,7 +362,7 @@ let
centos65 = centos64;
centos66 = centos65;
centos70 = [ "dlm-devel" "dlm" "corosynclib-devel" "perl-Digest-MD5" "systemd-devel"
- "procps-ng" "valgrind-devel" ];
+ "device-mapper-persistent-data" "procps-ng" "valgrind-devel" ];
fedora17 = fedora18 ++ [ "libudev-devel" ];
8 years, 5 months
master - tests: shell-fu
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=191f3cf52a0ada...
Commit: 191f3cf52a0ada3aba9ac340cbab464fb05efe89
Parent: 43a6f9e726295eaf200e7acb19d7e35b0af4aabb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 15 15:07:49 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 15:09:45 2015 +0200
tests: shell-fu
Preserve quotes for devs and use shell arrays to pass things around.
---
test/shell/pvmove-abort-all.sh | 25 +++++++++++++------------
test/shell/pvmove-abort.sh | 16 ++++++++--------
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh
index e6e65e5..0398c75 100644
--- a/test/shell/pvmove-abort-all.sh
+++ b/test/shell/pvmove-abort-all.sh
@@ -37,24 +37,25 @@ lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
lvcreate -an -Zn -l30 -n $lv1 $vg1 "$dev4"
lvextend -l+30 -n $vg1/$lv1 "$dev5"
-cmd1="pvmove -i1 $backgroundarg \"$dev1\" \"$dev3\" $mode"
-cmd2="pvmove -i1 $backgroundarg \"$dev2\" \"$dev3\" $mode"
-cmd3="pvmove -i1 $backgroundarg -n $vg1/$lv1 \"$dev4\" \"$dev6\" $mode"
+cmd1=(pvmove -i1 $backgroundarg $mode "$dev1" "$dev3")
+cmd2=(pvmove -i1 $backgroundarg $mode "$dev2" "$dev3")
+cmd3=(pvmove -i1 $backgroundarg $mode -n $vg1/$lv1 "$dev4" "$dev6")
if test -z "$backgroundarg" ; then
- $cmd1 &
+ "${cmd1[@]}" &
aux wait_pvmove_lv_ready "$vg-pvmove0"
- $cmd2 &
+ "${cmd2[@]}" &
aux wait_pvmove_lv_ready "$vg-pvmove1"
- $cmd3 &
+ "${cmd3[@]}" &
aux wait_pvmove_lv_ready "$vg1-pvmove0"
+ lvs -a $vg $vg1
else
- $cmd1
- aux add_to_kill_list "$cmd1" -P 1
- $cmd2
- aux add_to_kill_list "$cmd2" -P 1
- $cmd3
- aux add_to_kill_list "$cmd3" -P 1
+ "${cmd1[@]}"
+ aux add_to_kill_list ${cmd1[*]} -P 1
+ "${cmd2[@]}"
+ aux add_to_kill_list ${cmd2[*]} -P 1
+ "${cmd3[@]}"
+ aux add_to_kill_list ${cmd3[*]} -P 1
fi
# test removal of all pvmove LVs
diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh
index 2c32f32..3417e77 100644
--- a/test/shell/pvmove-abort.sh
+++ b/test/shell/pvmove-abort.sh
@@ -31,19 +31,19 @@ do
lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1"
lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
-cmd1="pvmove -i1 $backgroundarg \"$dev1\" \"$dev3\" $mode"
-cmd2="pvmove -i1 $backgroundarg \"$dev2\" \"$dev3\" $mode"
+cmd1=(pvmove -i1 $backgroundarg $mode "$dev1" "$dev3")
+cmd2=(pvmove -i1 $backgroundarg $mode "$dev2" "$dev3")
if test -z "$backgroundarg" ; then
- $cmd1 &
+ "${cmd1[@]}" &
aux wait_pvmove_lv_ready "$vg-pvmove0"
- $cmd2 &
+ "${cmd2[@]}" &
aux wait_pvmove_lv_ready "$vg-pvmove1"
else
- $cmd1
- aux add_to_kill_list "$cmd1" -P 1
- $cmd2
- aux add_to_kill_list "$cmd2" -P 1
+ "${cmd1[@]}"
+ aux add_to_kill_list ${cmd1[*]} -P 1
+ "${cmd2[@]}"
+ aux add_to_kill_list ${cmd2[*]} -P 1
fi
# remove specific device
8 years, 5 months
master - tests: move print of replaced vars
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=43a6f9e726295e...
Commit: 43a6f9e726295eaf200e7acb19d7e35b0af4aabb
Parent: 53c2c4562555cbc00b2b78cb4394ee3f2b7f0729
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 15 14:31:28 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 15:09:45 2015 +0200
tests: move print of replaced vars
---
test/lib/inittest.sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index f55938f..3a0d332 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -86,6 +86,10 @@ prepare_test_vars
test -n "$BASH" && set -eE -o pipefail
+# Vars for harness
+echo "@TESTDIR=$TESTDIR"
+echo "@PREFIX=$PREFIX"
+
if test -n "$LVM_TEST_LVMETAD" ; then
export LVM_LVMETAD_SOCKET="$TESTDIR/lvmetad.socket"
export LVM_LVMETAD_PIDFILE="$TESTDIR/lvmetad.pid"
@@ -96,9 +100,6 @@ else
aux prepare_clvmd
fi
-# Vars for harness
-echo "@TESTDIR=$TESTDIR"
-echo "@PREFIX=$PREFIX"
echo "<======== Processing test: \"$TESTNAME\" ========>"
set -vx
8 years, 5 months
master - tests: align test result in batch mode
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=53c2c4562555cb...
Commit: 53c2c4562555cbc00b2b78cb4394ee3f2b7f0729
Parent: e478471dd54835b88d68d6d5b372e00b311807a9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 15 09:49:19 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 13:35:42 2015 +0200
tests: align test result in batch mode
---
test/lib/brick-shelltest.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 362ee8a..54114db 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -921,7 +921,8 @@ struct TestCase {
if ( options.batch ) {
int spaces = std::max( 64 - int(pretty().length()), 0 );
- progress( Last ) << " " << std::string( spaces, '.' ) << " " << r;
+ progress( Last ) << " " << std::string( spaces, '.' ) << " "
+ << std::left << std::setw( 9 ) << std::setfill( ' ' ) << r;
if ( r != Journal::SKIPPED )
progress( First ) << " " << rusage();
progress( Last ) << std::endl;
8 years, 5 months
master - tests: move stamp handling
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e478471dd54835...
Commit: e478471dd54835b88d68d6d5b372e00b311807a9
Parent: 5d4695569d58f42dfc95feda55e463ebcbf03ffb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 15 13:11:26 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 13:35:42 2015 +0200
tests: move stamp handling
Shift stamp handling into TimedBuffer,
so it's same everywhere.
---
test/lib/brick-shelltest.h | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 4540a71..362ee8a 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -296,6 +296,7 @@ struct TimedBuffer {
std::deque< Line > data;
Line incomplete;
+ bool stamp;
Line shift( bool force = false ) {
Line result = std::make_pair( 0, "" );
@@ -309,7 +310,7 @@ struct TimedBuffer {
}
void push( std::string buf ) {
- time_t now = time( 0 );
+ time_t now = stamp ? time( 0 ) : 0;
std::string::iterator b = buf.begin(), e = buf.begin();
while ( e != buf.end() )
@@ -323,6 +324,16 @@ struct TimedBuffer {
if ( e != buf.end() ) {
incomplete.second += "\n";
data.push_back( incomplete );
+ if (incomplete.second[0] == '#') {
+ /* Disable timing between '## 0 STACKTRACE' & '## teardown' keywords */
+ if (incomplete.second.find("# 0 STACKTRACE", 1) != std::string::npos) {
+ stamp = false;
+ now = 0;
+ } else if (incomplete.second.find("# teardown", 1) != std::string::npos) {
+ stamp = true;
+ now = time( 0 );
+ }
+ }
incomplete = std::make_pair( now, "" );
}
b = (e == buf.end() ? e : e + 1);
@@ -334,6 +345,8 @@ struct TimedBuffer {
return false;
return data.empty();
}
+
+ TimedBuffer() : stamp(true) {}
};
struct Sink {
@@ -369,12 +382,11 @@ struct Substitute {
struct Format {
time_t start;
- bool stamp;
Substitute subst;
std::string format( TimedBuffer::Line l ) {
std::stringstream result;
- if ( stamp ) {
+ if ( l.first >= start ) {
time_t rel = l.first - start;
result << "[" << std::setw( 2 ) << std::setfill( ' ' ) << rel / 60
<< ":" << std::setw( 2 ) << std::setfill( '0' ) << rel % 60 << "] ";
@@ -383,7 +395,7 @@ struct Format {
return result.str();
}
- Format() : start( time( 0 ) ), stamp( true ) {}
+ Format() : start( time( 0 ) ) {}
};
struct BufSink : Sink {
@@ -411,13 +423,6 @@ struct FdSink : Sink {
virtual void outline( bool force )
{
TimedBuffer::Line line = stream.shift( force );
- if (line.second.c_str()[0] == '#') {
- /* Disable timing between STACKTRACE & teardown keywords */
- if (strstr(line.second.c_str() + 1, "# 0 STACKTRACE"))
- fmt.stamp = false;
- else if (strstr(line.second.c_str() + 1, "# teardown"))
- fmt.stamp = true;
- }
std::string out = fmt.format( line );
write( fd, out.c_str(), out.length() );
}
8 years, 5 months
master - tests: hide error output
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5d4695569d58f4...
Commit: 5d4695569d58f42dfc95feda55e463ebcbf03ffb
Parent: 930f0aae845e65f3673d14df97e141baccf37849
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 15 13:10:33 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 13:35:42 2015 +0200
tests: hide error output
Hide error message if pid is already away.
---
test/lib/aux.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 505d15e..c28ac7b 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -218,7 +218,7 @@ kill_sleep_kill_() {
slow=$2
if test -s $pidfile ; then
pid=$(< $pidfile)
- kill -TERM $pid || return 0
+ kill -TERM $pid 2>/dev/null || return 0
if test $slow -eq 0 ; then sleep .1 ; else sleep 1 ; fi
kill -KILL $pid 2>/dev/null || true
wait=0
8 years, 5 months
master - tests: fix aux have test
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=930f0aae845e65...
Commit: 930f0aae845e65f3673d14df97e141baccf37849
Parent: 1a7dd13e70e32bc519b27b509b67b0de8f86e631
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 15 11:51:00 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 13:35:42 2015 +0200
tests: fix aux have test
Previous commit has made have_cache & have_thin producing
false return value.
Fix it and at the some time provide much better reconfiguring
warning message.
If the test machine is missing needed and configured binaries
it will produce TEST WARNING result.
---
test/lib/aux.sh | 48 ++++++++++++++++++++++++++++--------------------
1 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index bc70cc0..505d15e 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -893,17 +893,21 @@ have_thin() {
test "$THIN" = shared -o "$THIN" = internal || return 1
target_at_least dm-thin-pool "$@" || return 1
+ declare -a CONF
# disable thin_check if not present in system
- test -x "$LVM_TEST_THIN_CHECK_CMD" || LVM_TEST_THIN_CHECK_CMD=""
- test -x "$LVM_TEST_THIN_DUMP_CMD" || LVM_TEST_THIN_DUMP_CMD=""
- test -x "$LVM_TEST_THIN_REPAIR_CMD" || LVM_TEST_THIN_REPAIR_CMD=""
- test -z "$LVM_TEST_THIN_CHECK_CMD" -o \
- -z "$LVM_TEST_THIN_DUMP_CMD" -o \
- -z "$LVM_TEST_THIN_REPAIR_CMD" && {
- lvmconf "global/thin_check_executable = \"$LVM_TEST_THIN_CHECK_CMD\"" \
- "global/thin_dump_executable = \"$LVM_TEST_THIN_DUMP_CMD\"" \
- "global/thin_repair_executable = \"$LVM_TEST_THIN_REPAIR_CMD\""
- }
+ if test -n "$LVM_TEST_THIN_CHECK_CMD" -a ! -x "$LVM_TEST_THIN_CHECK_CMD" ; then
+ CONF[0]="global/thin_check_executable = \"\""
+ fi
+ if test -n "$LVM_TEST_THIN_DUMP_CMD" -a ! -x "$LVM_TEST_THIN_DUMP_CMD" ; then
+ CONF[1]="global/thin_dump_executable = \"\""
+ fi
+ if test -n "$LVM_TEST_THIN_REPAIR_CMD" -a ! -x "$LVM_TEST_THIN_REPAIR_CMD" ; then
+ CONF[2]="global/thin_repair_executable = \"\""
+ fi
+ if test ${#CONF[@]} -ne 0 ; then
+ echo "TEST WARNING: Reconfiguring ${CONF[@]}"
+ lvmconf "${CONF[@]}"
+ fi
}
have_raid() {
@@ -915,17 +919,21 @@ have_cache() {
test "$CACHE" = shared -o "$CACHE" = internal || return 1
target_at_least dm-cache "$@"
+ declare -a CONF
# disable cache_check if not present in system
- test -x "$LVM_TEST_CACHE_CHECK_CMD" || LVM_TEST_CACHE_CHECK_CMD=""
- test -x "$LVM_TEST_CACHE_DUMP_CMD" || LVM_TEST_CACHE_DUMP_CMD=""
- test -x "$LVM_TEST_CACHE_REPAIR_CMD" || LVM_TEST_CACHE_REPAIR_CMD=""
- test -z "$LVM_TEST_CACHE_CHECK_CMD" -o \
- -z "$LVM_TEST_CACHE_DUMP_CMD" -o \
- -z "$LVM_TEST_CACHE_REPAIR_CMD" && {
- lvmconf "global/cache_check_executable = \"$LVM_TEST_CACHE_CHECK_CMD\"" \
- "global/cache_dump_executable = \"$LVM_TEST_CACHE_DUMP_CMD\"" \
- "global/cache_repair_executable = \"$LVM_TEST_CACHE_REPAIR_CMD\""
- }
+ if test -n "$LVM_TEST_CACHE_CHECK_CMD" -a ! -x "$LVM_TEST_CACHE_CHECK_CMD" ; then
+ CONF[0]="global/cache_check_executable = \"\""
+ fi
+ if test -n "$LVM_TEST_CACHE_DUMP_CMD" -a ! -x "$LVM_TEST_CACHE_DUMP_CMD" ; then
+ CONF[1]="global/cache_dump_executable = \"\""
+ fi
+ if test -n "$LVM_TEST_CACHE_REPAIR_CMD" -a ! -x "$LVM_TEST_CACHE_REPAIR_CMD" ; then
+ CONF[2]="global/cache_repair_executable = \"\""
+ fi
+ if test ${#CONF[@]} -ne 0 ; then
+ echo "TEST WARNING: Reconfiguring ${CONF[@]}"
+ lvmconf "${CONF[@]}"
+ fi
}
have_tool_at_least() {
8 years, 5 months
master - tests: no tables for no devices
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1a7dd13e70e32b...
Commit: 1a7dd13e70e32bc519b27b509b67b0de8f86e631
Parent: f5466fe43597bfacb7fc70e0a61d569b6c5198c4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 14 14:56:15 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 13:35:42 2015 +0200
tests: no tables for no devices
If dm table does't contain any PREFIX device, don't bother
to call other commands
No tracing if test is skipped.
---
test/lib/utils.sh | 51 +++++++++++++++++++++++++++------------------------
1 files changed, 27 insertions(+), 24 deletions(-)
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index 1713cc9..e2b257d 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -132,6 +132,8 @@ STACKTRACE() {
done
fi
+ test -f SKIP_THIS_TEST && exit 200
+
test -z "$LVM_TEST_NODEBUG" -a -f debug.log && {
IDX=
for i in debug.log* ; do
@@ -139,39 +141,40 @@ STACKTRACE() {
sed -e "s,^,## DEBUG${IDX}: ," $i
IDX=$(($IDX + 1))
done
- test -e clvmddebug.log && {
+ if test -e clvmddebug.log ; then
echo "<======== CLVMD debug log ========>"
sed -e "s,^,## CLVMD: ," clvmddebug.log
- }
- test -e strace.log && {
+ fi
+ if test -e strace.log ; then
echo "<======== Strace debug log ========>"
sed -e "s,^,## STRACE: ," strace.log
- }
- echo "<======== Info ========>"
- dmsetup info -c | grep1_ "$PREFIX" | sed -e "s,^,## DMINFO: ,"
- echo "<======== Active table ========>"
- dmsetup table | grep "$PREFIX" | sed -e "s,^,## DMTABLE: ,"
- echo "<======== Inactive table ========>"
- dmsetup table --inactive | grep "$PREFIX" | sed -e "s,^,## DMITABLE: ,"
- echo "<======== Status ========>"
- dmsetup status | grep "$PREFIX" | sed -e "s,^,## DMSTATUS: ,"
- echo "<======== Tree ========>"
- dmsetup ls --tree | sed -e "s,^,## DMTREE: ,"
- echo "<======== Recursive list of $DM_DEV_DIR ========>"
- ls -Rl --hide=shm --hide=bus --hide=snd --hide=input --hide=dri \
- --hide=net --hide=hugepages --hide=mqueue --hide=pts \
- "$DM_DEV_DIR" | sed -e "s,^,## LSLR: ,"
- echo "<======== Udev DB content ========>"
- for i in /sys/block/dm-* /sys/block/loop* ; do
- udevadm info --path "$i" || true
- done | sed -e "s,^,## UDEV: ,"
+ fi
+ dmsetup info -c | grep1_ "$PREFIX" > out
+ if test $(wc -l < out) -gt 1 ; then
+ echo "<======== Info ========>"
+ sed -e "s,^,## DMINFO: ," out
+ echo "<======== Active table ========>"
+ dmsetup table | grep "$PREFIX" | sed -e "s,^,## DMTABLE: ,"
+ echo "<======== Inactive table ========>"
+ dmsetup table --inactive | grep "$PREFIX" | sed -e "s,^,## DMITABLE: ,"
+ echo "<======== Status ========>"
+ dmsetup status | grep "$PREFIX" | sed -e "s,^,## DMSTATUS: ,"
+ echo "<======== Tree ========>"
+ dmsetup ls --tree | sed -e "s,^,## DMTREE: ,"
+ echo "<======== Recursive list of $DM_DEV_DIR ========>"
+ ls -Rl --hide=shm --hide=bus --hide=snd --hide=input --hide=dri \
+ --hide=net --hide=hugepages --hide=mqueue --hide=pts \
+ "$DM_DEV_DIR" | sed -e "s,^,## LSLR: ,"
+ echo "<======== Udev DB content ========>"
+ for i in /sys/block/dm-* /sys/block/loop* ; do
+ udevadm info --query=all --path "$i" || true
+ done | sed -e "s,^,## UDEV: ,"
+ fi
echo "<======== Script file \"$(< TESTNAME)\" ========>"
local script=$0
test -f "$script" || script="$TESTOLDPWD/$0"
awk '{print "## Line:", NR, "\t", $0}' "$script"
}
-
- test -f SKIP_THIS_TEST && exit 200
}
init_udev_transaction() {
8 years, 5 months
master - tests: preserve "" around dev
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f5466fe43597bf...
Commit: f5466fe43597bfacb7fc70e0a61d569b6c5198c4
Parent: 1a814af46b6c8163c6b9b60932f9d700583914b0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 14 14:15:52 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 15 13:35:42 2015 +0200
tests: preserve "" around dev
---
test/shell/pvmove-abort-all.sh | 7 ++++---
test/shell/pvmove-abort.sh | 5 +++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh
index 3166965..e6e65e5 100644
--- a/test/shell/pvmove-abort-all.sh
+++ b/test/shell/pvmove-abort-all.sh
@@ -37,9 +37,10 @@ lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
lvcreate -an -Zn -l30 -n $lv1 $vg1 "$dev4"
lvextend -l+30 -n $vg1/$lv1 "$dev5"
-cmd1=$(echo pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode)
-cmd2=$(echo pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode)
-cmd3=$(echo pvmove -i1 $backgroundarg -n $vg1/$lv1 "$dev4" "$dev6" $mode)
+cmd1="pvmove -i1 $backgroundarg \"$dev1\" \"$dev3\" $mode"
+cmd2="pvmove -i1 $backgroundarg \"$dev2\" \"$dev3\" $mode"
+cmd3="pvmove -i1 $backgroundarg -n $vg1/$lv1 \"$dev4\" \"$dev6\" $mode"
+
if test -z "$backgroundarg" ; then
$cmd1 &
aux wait_pvmove_lv_ready "$vg-pvmove0"
diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh
index 39360a0..2c32f32 100644
--- a/test/shell/pvmove-abort.sh
+++ b/test/shell/pvmove-abort.sh
@@ -31,8 +31,9 @@ do
lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1"
lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
-cmd1=$(echo pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode)
-cmd2=$(echo pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode)
+cmd1="pvmove -i1 $backgroundarg \"$dev1\" \"$dev3\" $mode"
+cmd2="pvmove -i1 $backgroundarg \"$dev2\" \"$dev3\" $mode"
+
if test -z "$backgroundarg" ; then
$cmd1 &
aux wait_pvmove_lv_ready "$vg-pvmove0"
8 years, 5 months