master - tests: shellcheck misc
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3a48fb47b771c3f4db4...
Commit: 3a48fb47b771c3f4db4222f0fdaf5eb462803ac5
Parent: 1507956383b9b28e52051ecf56d754e8cda6e025
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 23 17:01:13 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
tests: shellcheck misc
Few more minor complains from ShellCheck.
---
test/lib/check.sh | 4 ++--
test/lib/utils.sh | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 3c7b81a..ed4f8d7 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -240,10 +240,10 @@ in_sync() {
fi
if [[ ${a[$(( idx - 1 ))]} =~ a ]] ; then
- [ $ignore_a -eq 0 ] && \
+ [ "$ignore_a" = 0 ] && \
die "$lvm_name ($type$snap) in-sync, but 'a' characters in health status"
echo "$lvm_name ($type$snap) is not in-sync"
- [ $ignore_a -eq 1 ] && return 0
+ [ "$ignore_a" = 1 ] && return 0
return 1
fi
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index f2a4bde..36fbf06 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -39,7 +39,7 @@ rand_bytes() {
# Ensure that $data has length at least 50+$n
while :; do
- len=$(echo "$data" | wc -c)
+ len=${#data} # number of chars in $data
test "$n_plus_50" -le "$len" && break;
data=$( (echo "$data"; eval "$cmds") 2>&1 | gzip )
done
@@ -112,7 +112,7 @@ stacktrace() {
# i=1 - ignoring innermost frame - it is always stacktrace function
local i=1 n=${#BASH_LINENO[*]}
# n-=1 - ignoring last frame as well - it is not interesting
- let n-=1
+ n=$(( n - 1 ))
echo "## - $0:${BASH_LINENO[$((n-1))]}"
while [[ $i -lt $n ]]; do
5 years, 6 months
master - tests: shellcheck split assing
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1507956383b9b28e520...
Commit: 1507956383b9b28e52051ecf56d754e8cda6e025
Parent: 397b7891ff79ba7c31040c31c17aa8587e78a9a6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 23 17:03:00 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
tests: shellcheck split assing
Keep possibly error unmasked by assign
---
test/lib/aux.sh | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index f8fb8a3..4269987 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1107,7 +1107,9 @@ prepare_vg() {
}
extend_filter() {
- local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
+ local filter
+
+ filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for rx in "$@"; do
filter=$(echo "$filter" | sed -e "s:\\[:[ \"$rx\", :")
done
@@ -1119,7 +1121,9 @@ extend_filter_LVMTEST() {
}
hide_dev() {
- local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
+ local filter
+
+ filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for dev in "$@"; do
filter=$(echo "$filter" | sed -e "s:\\[:[ \"r|$dev|\", :")
done
@@ -1127,7 +1131,9 @@ hide_dev() {
}
unhide_dev() {
- local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
+ local filter
+
+ filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for dev in "$@"; do
filter=$(echo "$filter" | sed -e "s:\"r|$dev|\", ::")
done
5 years, 6 months
master - tests: shellcheck liter
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=397b7891ff79ba7c310...
Commit: 397b7891ff79ba7c31040c31c17aa8587e78a9a6
Parent: 410c99274418f0ce184f670522939ff14a06217f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 23 17:02:44 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
tests: shellcheck liter
---
test/lib/aux.sh | 10 +++++-----
test/lib/check.sh | 4 ++--
test/lib/inittest.sh | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index a22f858..f8fb8a3 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -885,7 +885,7 @@ prepare_devs() {
# dmsetup table $name
#done
- printf "%s\n" "${DEVICES[@]}" > DEVICES
+ printf "%s\\n" "${DEVICES[@]}" > DEVICES
# ( IFS=$'\n'; echo "${DEVICES[*]}" ) >DEVICES
echo "ok"
@@ -1109,7 +1109,7 @@ prepare_vg() {
extend_filter() {
local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for rx in "$@"; do
- filter=$(echo "$filter" | sed -e "s:\[:[ \"$rx\", :")
+ filter=$(echo "$filter" | sed -e "s:\\[:[ \"$rx\", :")
done
lvmconf "$filter"
}
@@ -1121,7 +1121,7 @@ extend_filter_LVMTEST() {
hide_dev() {
local filter=$(grep ^devices/global_filter CONFIG_VALUES | tail -n 1)
for dev in "$@"; do
- filter=$(echo "$filter" | sed -e "s:\[:[ \"r|$dev|\", :")
+ filter=$(echo "$filter" | sed -e "s:\\[:[ \"r|$dev|\", :")
done
lvmconf "$filter"
}
@@ -1223,7 +1223,7 @@ EOF
# append all parameters (avoid adding empty \n)
local v
- test $# -gt 0 && printf "%s\n" "$@" >> "$config_values"
+ test $# -gt 0 && printf "%s\\n" "$@" >> "$config_values"
declare -A CONF 2>/dev/null || {
# Associative arrays is not available
@@ -1249,7 +1249,7 @@ EOF
done < "$config_values"
# sort by section and iterate through them
- printf "%s\n" "${!CONF[@]}" | sort | while read -r v ; do
+ printf "%s\\n" "${!CONF[@]}" | sort | while read -r v ; do
sec=${v%%/*} # split on section'/'param_name
test "$sec" = "$last_sec" || {
test -z "$last_sec" || echo "}"
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 1829857..3c7b81a 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -65,8 +65,8 @@ lv_on_diff_() {
local diff_e
# Find diff between 2 shell arrays, print them as stdin files
- printf "%s\n" "${expect[@]}" | sort | uniq >_lv_on_diff1
- printf "%s\n" "${xdevs[@]}" >_lv_on_diff2
+ printf "%s\\n" "${expect[@]}" | sort | uniq >_lv_on_diff1
+ printf "%s\\n" "${xdevs[@]}" >_lv_on_diff2
diff_e=$(diff _lv_on_diff1 _lv_on_diff2) ||
die "LV $2/$3 $(lv_err_list_ "^>" "${diff_e}" found)$(lv_err_list_ "^<" "${diff_e}" "not found")."
}
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index 20bc345..62ec494 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -126,8 +126,8 @@ fi
echo "$TESTNAME" >TESTNAME
# Require 50M of free space in testdir
-test $(df -k -P . | awk '/\// {print $4}') -gt 51200 ||
- skip "Testing requires more then 50M of free space in directory $TESTDIR!\n$(df -H | sed -e 's,^,## DF: ,')"
+test "$(df -k -P . | awk '/\// {print $4}')" -gt 51200 || \
+ skip "Testing requires more then 50M of free space in directory $TESTDIR!\\n$(df -H | sed -e 's,^,## DF: ,')"
echo "Kernel is $(uname -a)"
# Report SELinux mode
5 years, 6 months
master - tests: shellcheck use grep -E
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=410c99274418f0ce184...
Commit: 410c99274418f0ce184f670522939ff14a06217f
Parent: 14abe1e87b85ebaf254d81f6ee98d10ae21d79ce
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 23 16:59:51 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
tests: shellcheck use grep -E
Replace egrep with grep -E
---
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 43dfa50..a22f858 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -402,7 +402,7 @@ teardown_devs_prefixed() {
rm -rf "${TESTDIR:?}/dev/$prefix*"
# Send idle message to frozen raids (with hope to unfreeze them)
- for dm in $(dm_status | egrep "$prefix.*raid.*frozen"); do
+ for dm in $(dm_status | grep -E "$prefix.*raid.*frozen"); do
echo "## unfreezing: dmsetup message \"${dm%:*}\""
dmsetup message "${dm%:*}" 0 "idle" &
done
5 years, 6 months
master - tests: shellcheck prevention check
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=14abe1e87b85ebaf254...
Commit: 14abe1e87b85ebaf254d81f6ee98d10ae21d79ce
Parent: cafcc5813ac958798d5dce19b1b65a9941cc39ad
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 23 16:58:48 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
tests: shellcheck prevention check
Always make sure variable is set to something else the /dev/*
---
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 a7ad60a..43dfa50 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -399,7 +399,7 @@ teardown_devs_prefixed() {
local once=1
local dm
- rm -rf "$TESTDIR/dev/$prefix*"
+ rm -rf "${TESTDIR:?}/dev/$prefix*"
# Send idle message to frozen raids (with hope to unfreeze them)
for dm in $(dm_status | egrep "$prefix.*raid.*frozen"); do
5 years, 6 months
master - fsadm: shellcheck prefer explicit escaping
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cafcc5813ac958798d5...
Commit: cafcc5813ac958798d5dce19b1b65a9941cc39ad
Parent: fe69731d31648af24383515c1c3bc323551d75e5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 23 15:53:36 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
fsadm: shellcheck prefer explicit escaping
Backslash is literal in "\t". Prefer explicit escaping: "\\t".
---
scripts/fsadm.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index a09b915..28ca670 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -311,10 +311,10 @@ detect_mounted_with_proc_self_mountinfo() {
# device (which could have been renamed).
# We need to visit every mount point and check it's major minor
detect_mounted_with_proc_mounts() {
- MOUNTED=$("$GREP" "^$VOLUME[ \t]" "$PROCMOUNTS")
+ MOUNTED=$("$GREP" "^$VOLUME[ \\t]" "$PROCMOUNTS")
# for empty string try again with real volume name
- test -z "$MOUNTED" && MOUNTED=$("$GREP" "^$RVOLUME[ \t]" "$PROCMOUNTS")
+ test -z "$MOUNTED" && MOUNTED=$("$GREP" "^$RVOLUME[ \\t]" "$PROCMOUNTS")
MOUNTDEV=$(echo -n -e "${MOUNTED%% *}")
# cut device name prefix and trim everything past mountpoint
@@ -325,8 +325,8 @@ detect_mounted_with_proc_mounts() {
# for systems with different device names - check also mount output
if test -z "$MOUNTED" ; then
# will not work with spaces in paths
- MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \t]")
- test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \t]")
+ MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \\t]")
+ test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \\t]")
MOUNTDEV=${MOUNTED%% on *}
MOUNTED=${MOUNTED##* on }
MOUNTED=${MOUNTED% type *} # allow type in the mount name
5 years, 6 months
master - tests: handle setting better
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fe69731d31648af2438...
Commit: fe69731d31648af24383515c1c3bc323551d75e5
Parent: 30975a3328a0d101dda935644349dac58e2fb97f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 19 19:58:53 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:25:00 2018 +0100
tests: handle setting better
When using 'make check... LVM_TEST_AUX_TRACE=0' make it behaving
like other supported VARS in use so it's like disabled.
---
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 9f8c8d7..a7ad60a 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1650,7 +1650,7 @@ kernel_at_least() {
version_at_least "$(uname -r)" "$@"
}
-test -z "${LVM_TEST_AUX_TRACE-}" || set -x
+test "${LVM_TEST_AUX_TRACE-0}" = "0" || set -x
test -f DEVICES && devs=$(< DEVICES)
5 years, 6 months
master - libdm: enhance mounted fs detection
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=30975a3328a0d101dda...
Commit: 30975a3328a0d101dda935644349dac58e2fb97f
Parent: 8c02cc9e8ffba777a92d798ca08c60e73dd2c109
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 20 11:13:22 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 23 17:24:58 2018 +0100
libdm: enhance mounted fs detection
btrfs is using fake major:minor device numbers.
try to be smarter and detect used node via DM device name.
This shortens delays, where i.e. lvm2 is asked to deactivate
volume with mounted btrfs as such operation is not retryed
and user is informed about device being in use.
---
WHATS_NEW_DM | 1 +
libdm/libdm-common.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 34c6833..d3cdf7d 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.147 -
=====================================
+ Recognize also mounted btrfs through dm_device_has_mounted_fs().
Add missing log_error() into dm_stats_populate() returning 0.
Avoid calling dm_stats_populat() for DM devices without any stats regions.
Support DM_DEBUG_WITH_LINE_NUMBERS envvar for debug msg with source:line.
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index 99cf0c8..094e618 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -1742,6 +1742,10 @@ static int _mountinfo_parse_line(const char *line, unsigned *maj, unsigned *min,
{
char root[PATH_MAX + 1]; /* sscanf needs extra '\0' */
char target[PATH_MAX + 1];
+ char *devmapper;
+ struct dm_task *dmt;
+ struct dm_info info;
+ unsigned i;
/* TODO: maybe detect availability of %ms glib support ? */
if (sscanf(line, "%*u %*u %u:%u %" DM_TO_STRING(PATH_MAX)
@@ -1751,6 +1755,32 @@ static int _mountinfo_parse_line(const char *line, unsigned *maj, unsigned *min,
return 0;
}
+ /* btrfs fakes device numbers, but there is still /dev/mapper name
+ * placed in mountinfo, so try to detect proper major:minor via this */
+ if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
+ if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
+ log_error("Mount info task creation failed.");
+ return 0;
+ }
+ devmapper += 12; /* skip fixed prefix */
+ for (i = 0; devmapper[i] && devmapper[i] != ' ' && i < sizeof(root); ++i)
+ root[i] = devmapper[i];
+ root[i] = 0;
+ _unmangle_mountinfo_string(root, buf);
+ buf[DM_NAME_LEN] = 0; /* cut away */
+
+ if (dm_task_set_name(dmt, buf) &&
+ dm_task_no_open_count(dmt) &&
+ dm_task_run(dmt) &&
+ dm_task_get_info(dmt, &info)) {
+ log_debug("Replacing mountinfo device (%u:%u) with matching DM device %s (%u:%u).",
+ *maj, *min, buf, info.major, info.minor);
+ *maj = info.major;
+ *min = info.minor;
+ }
+ dm_task_destroy(dmt);
+ }
+
_unmangle_mountinfo_string(target, buf);
return 1;
5 years, 6 months
master - tests: update no tool test
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8c02cc9e8ffba777a92...
Commit: 8c02cc9e8ffba777a92d798ca08c60e73dd2c109
Parent: 4e0c0417ce1af29ae5253bca7f1277e13e3c3ee6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 19 10:26:50 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 19 12:08:04 2018 +0100
tests: update no tool test
Correct testing with format 1 and mq policy.
Add testing of 'smq'
Fix testing with clvmd - where logged message is part of clvmd log
and we can only check command status.
---
test/shell/lvcreate-cache-no-tools.sh | 121 ++++++++++++++++++++++-----------
1 files changed, 80 insertions(+), 41 deletions(-)
diff --git a/test/shell/lvcreate-cache-no-tools.sh b/test/shell/lvcreate-cache-no-tools.sh
index 72359e5..c38ecfd 100644
--- a/test/shell/lvcreate-cache-no-tools.sh
+++ b/test/shell/lvcreate-cache-no-tools.sh
@@ -17,65 +17,104 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
+if test -e LOCAL_CLVMD ; then
+# In cluster, the error from activation is logged in clvmd
+# so we can only check resulting state of activation
+ GREP=echo
+else
+ GREP=grep
+fi
+
+make_fake_() {
+ cat <<- EOF >fake-tool.sh
+#!/bin/sh
+echo "$1"
+exit 1
+EOF
+ chmod +x fake-tool.sh
+}
+
+check_change_() {
+ lvchange -an $vg |& tee out
+ "$GREP" "$1" out
+
+ lvchange -ay $vg |& tee out
+ "$GREP" "$1" out
+}
+
+# Integrity check fails, but deactivation is OK
+check_change_failed_() {
+ lvchange -an $vg |& tee out
+ "$GREP" "failed" out
+
+ # Activation must fail
+ fail lvchange -ay $vg |& tee out
+ "$GREP" "failed" out
+
+ cat <<- EOF >fake-tool.sh
+#!/bin/sh
+exit
+EOF
+ chmod +x fake-tool.sh
+ # Activate without any check
+ lvchange -ay $vg
+}
+
+
aux have_cache 1 3 0 || skip
# FIXME: parallel cache metadata allocator is crashing when used value 8000!
aux prepare_vg 5 80000
-aux lvmconf 'global/cache_disabled_features = [ "policy_smq" ]' \
- 'global/cache_check_executable = "./fake-tool.sh"'
-
+aux lvmconf 'global/cache_check_executable = "./fake-tool.sh"'
rm -f fake-tool.sh
-lvcreate -l1 -n $lv1 $vg
-lvcreate -H -l2 $vg/$lv1
+# On cache target that supports V2
+if aux have_cache 1 10 0 ; then
-lvchange -an $vg |& tee out
-grep "Check is skipped" out
+lvcreate -aey -l1 -n $lv1 $vg
+lvcreate -H -l2 $vg/$lv1
-lvchange -ay $vg
-grep "Check is skipped" out
+check_change_ "Check is skipped"
+vgcfgbackup -f /dev/shm/back
# prepare fake version of cache_check tool that reports old version
-cat <<- EOF >fake-tool.sh
-#!/bin/sh
-echo "0.1.0"
-exit 1
-EOF
-chmod +x fake-tool.sh
+make_fake_ "0.1.0"
+check_change_ "upgrade"
-lvchange -an $vg |& tee out
-grep "upgrade" out
+# prepare fake version of cache_check tool that reports garbage
+make_fake_ "garbage"
+check_change_ "parse"
-lvchange -ay $vg
-grep "upgrade" out
+# prepare fake version of cache_check tool with high version
+make_fake_ "99.0.0"
+check_change_failed_
-# prepare fake version of cache_check tool that reports garbage
-cat <<- EOF >fake-tool.sh
-#!/bin/sh
-echo "garbage"
-exit 1
-EOF
-chmod +x fake-tool.sh
+lvremove -f $vg
+
+fi
-lvchange -an $vg |& tee out
-grep "parse" out
-lvchange -ay $vg
-grep "parse" out
+# On older cache target that supports only V1 format
+aux lvmconf 'global/cache_disabled_features = [ "policy_smq" ]'
+rm -f fake-tool.sh
+
+lvcreate -aey -l1 -n $lv1 $vg
+lvcreate -H -l2 $vg/$lv1
+
+check_change_ "Check is skipped"
+
+# prepare fake version of cache_check tool that reports old version
+make_fake_ "0.1.0"
+check_change_failed_
+
+# prepare fake version of cache_check tool that reports garbage
+make_fake_ "garbage"
+check_change_failed_
# prepare fake version of cache_check tool with high version
-cat <<- EOF >fake-tool.sh
-#!/bin/sh
-echo "9.0.0"
-exit 1
-EOF
-chmod +x fake-tool.sh
+make_fake_ "99.0.0"
+check_change_failed_
-# Integrity check fails, but deactivation is OK
-lvchange -an $vg |& tee out
-grep "failed" out
-# Activation must fail
-fail lvchange -ay $vg
vgremove -ff $vg
5 years, 6 months
master - cleanup: typo fix
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4e0c0417ce1af29ae52...
Commit: 4e0c0417ce1af29ae5253bca7f1277e13e3c3ee6
Parent: 8d7ece126b96337326d026ab4edebe2db4333459
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 19 12:05:36 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 19 12:05:57 2018 +0100
cleanup: typo fix
---
lib/activate/dev_manager.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 32c737c..a7947d8 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -2109,7 +2109,7 @@ static int _pool_callback(struct dm_tree_node *node,
if (!(ret = exec_cmd(pool_lv->vg->cmd, (const char * const *)argv,
&status, 0))) {
if (status == ENOENT) {
- log_warn("WARNING: Check is skipped, please install recomended missing binary %s!",
+ log_warn("WARNING: Check is skipped, please install recommended missing binary %s!",
argv[0]);
return 1;
}
5 years, 6 months