master - cache: check for cache fail during flush
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5c415afd852b6d...
Commit: 5c415afd852b6d39021f97f63401a37e6408bf70
Parent: 569ba79abfef9b6cfc8d7c433834df5599f3188c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 10 17:56:43 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:53 2016 +0100
cache: check for cache fail during flush
Just WARN if the cache can't be flushed because it's failed.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 18 ++++++++++++------
lib/metadata/cache_manip.c | 18 ++++++++++++++----
lib/metadata/lv.c | 16 +++++++++++++---
lib/report/report.c | 12 ++++++++++++
5 files changed, 52 insertions(+), 13 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 04d32d6..e5b28bb 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.146 -
=================================
+ Use new cache status info and skip flushing for failed cache.
Support --uncache with missing PVs.
Tidy report field names, headings and widths.
Add vgscan --notifydbus to send a dbus notification.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 2d59cf4..8e56b7a 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1334,12 +1334,18 @@ int dev_manager_cache_status(struct dev_manager *dm,
c = (*status)->cache;
(*status)->mem = dm->mem; /* User has to destroy this mem pool later */
- (*status)->data_usage = dm_make_percent(c->used_blocks,
- c->total_blocks);
- (*status)->metadata_usage = dm_make_percent(c->metadata_used_blocks,
- c->metadata_total_blocks);
- (*status)->dirty_usage = dm_make_percent(c->dirty_blocks,
- c->used_blocks);
+ if (c->fail || c->error) {
+ (*status)->data_usage =
+ (*status)->metadata_usage =
+ (*status)->dirty_usage = DM_PERCENT_INVALID;
+ } else {
+ (*status)->data_usage = dm_make_percent(c->used_blocks,
+ c->total_blocks);
+ (*status)->metadata_usage = dm_make_percent(c->metadata_used_blocks,
+ c->metadata_total_blocks);
+ (*status)->dirty_usage = dm_make_percent(c->dirty_blocks,
+ c->used_blocks);
+ }
r = 1;
out:
dm_task_destroy(dmt);
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index 115abcb..3962247 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -359,10 +359,16 @@ int lv_cache_remove(struct logical_volume *cache_lv)
*/
if (!lv_cache_status(cache_lv, &status))
return_0;
- dirty_blocks = status->cache->dirty_blocks;
- if (!(status->cache->feature_flags & DM_CACHE_FEATURE_WRITETHROUGH))
- dirty_blocks++; /* Not writethrough - always dirty */
- is_cleaner = !strcmp(status->cache->policy_name, "cleaner");
+ if (!status->cache->fail) {
+ is_cleaner = !strcmp(status->cache->policy_name, "cleaner");
+ dirty_blocks = status->cache->dirty_blocks;
+ if (!(status->cache->feature_flags & DM_CACHE_FEATURE_WRITETHROUGH))
+ dirty_blocks++; /* Not writethrough - always dirty */
+ } else {
+ log_warn("WARNING: Skippping flush for failed cache.");
+ is_cleaner = 0;
+ dirty_blocks = 0;
+ }
dm_pool_destroy(status->mem);
if (dirty_blocks && !is_cleaner) {
@@ -378,6 +384,10 @@ int lv_cache_remove(struct logical_volume *cache_lv)
while (dirty_blocks) {
if (!lv_cache_status(cache_lv, &status))
return_0;
+ if (status->cache->fail) {
+ log_warn("WARNING: Flushing of failing cache skipped.");
+ break;
+ }
dirty_blocks = status->cache->dirty_blocks;
dm_pool_destroy(status->mem);
if (dirty_blocks) {
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 9e9549d..cb30e2d 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -1137,10 +1137,12 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_
}
}
- /* 'c' when thin-pool active with needs_check flag
+ /* 'c' when cache/thin-pool is active with needs_check flag
* 'C' for suspend */
- if (lv_is_thin_pool(lv) &&
- lvdm->seg_status.thin_pool->needs_check)
+ if ((lv_is_thin_pool(lv) &&
+ lvdm->seg_status.thin_pool->needs_check) ||
+ (lv_is_cache(lv) &&
+ lvdm->seg_status.cache->needs_check))
repstr[4] = lvdm->info.suspended ? 'C' : 'c';
/*
@@ -1194,6 +1196,14 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_
repstr[8] = 'm'; /* RAID has 'm'ismatches */
} else if (lv->status & LV_WRITEMOSTLY)
repstr[8] = 'w'; /* sub-LV has 'w'ritemostly */
+ } else if (lv_is_cache(lv) &&
+ (lvdm->seg_status.type != SEG_STATUS_NONE)) {
+ if (lvdm->seg_status.type == SEG_STATUS_UNKNOWN)
+ repstr[8] = 'X'; /* Unknown */
+ else if (lvdm->seg_status.cache->fail)
+ repstr[8] = 'F';
+ else if (lvdm->seg_status.cache->read_only)
+ repstr[8] = 'M';
} else if (lv_is_thin_pool(lv) &&
(lvdm->seg_status.type != SEG_STATUS_NONE)) {
if (lvdm->seg_status.type == SEG_STATUS_UNKNOWN)
diff --git a/lib/report/report.c b/lib/report/report.c
index 9ec3381..7070092 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -3487,6 +3487,14 @@ static int _lvhealthstatus_disp(struct dm_report *rh, struct dm_pool *mem,
health = "mismatches exist";
} else if (lv->status & LV_WRITEMOSTLY)
health = "writemostly";
+ } else if (lv_is_cache(lv) && (lvdm->seg_status.type != SEG_STATUS_NONE)) {
+ if (lvdm->seg_status.type != SEG_STATUS_CACHE)
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(health_undef),
+ GET_FIELD_RESERVED_VALUE(health_undef));
+ else if (lvdm->seg_status.cache->fail)
+ health = "failed";
+ else if (lvdm->seg_status.cache->read_only)
+ health = "metadata_read_only";
} else if (lv_is_thin_pool(lv) && (lvdm->seg_status.type != SEG_STATUS_NONE)) {
if (lvdm->seg_status.type != SEG_STATUS_THIN_POOL)
return _field_set_value(field, GET_FIRST_RESERVED_NAME(health_undef),
@@ -3512,6 +3520,10 @@ static int _lvcheckneeded_disp(struct dm_report *rh, struct dm_pool *mem,
return _binary_disp(rh, mem, field, lvdm->seg_status.thin_pool->needs_check,
GET_FIRST_RESERVED_NAME(lv_check_needed_y), private);
+ if (lv_is_cache(lvdm->lv) && lvdm->seg_status.type == SEG_STATUS_CACHE)
+ return _binary_disp(rh, mem, field, lvdm->seg_status.cache->needs_check,
+ GET_FIRST_RESERVED_NAME(lv_check_needed_y), private);
+
return _binary_undef_disp(rh, mem, field, private);
}
7 years, 9 months
master - lvconvert: uncache handles missing PV
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=569ba79abfef9b...
Commit: 569ba79abfef9b6cfc8d7c433834df5599f3188c
Parent: 29d1533a497be922dc114524b83e926cbb63c34a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 8 10:47:27 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:53 2016 +0100
lvconvert: uncache handles missing PV
Allow to process with --uncache when some PVs are missing in VG.
So it's now possible to --uncache cached LV if the cache-pool
has missing PV.
---
WHATS_NEW | 1 +
tools/lvconvert.c | 48 +++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f52b879..04d32d6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.146 -
=================================
+ Support --uncache with missing PVs.
Tidy report field names, headings and widths.
Add vgscan --notifydbus to send a dbus notification.
Add dbus notification from commands after a PV/VG/LV changes state.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index db1c7f7..2b5080f 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1997,6 +1997,9 @@ static int _lvconvert_uncache(struct cmd_context *cmd,
struct logical_volume *lv,
struct lvconvert_params *lp)
{
+ struct lv_segment *seg;
+ struct logical_volume *remove_lv;
+
if (lv_is_thin_pool(lv))
lv = seg_lv(first_seg(lv), 0); /* cached _tdata ? */
@@ -2006,10 +2009,49 @@ static int _lvconvert_uncache(struct cmd_context *cmd,
return 0;
}
- if (!lv_remove_single(cmd, first_seg(lv)->pool_lv, (force_t) lp->force, 0))
+ seg = first_seg(lv);
+
+ if (lv_is_partial(seg_lv(seg, 0))) {
+ log_warn("WARNING: Cache origin logical volume %s is missing.",
+ display_lvname(seg_lv(seg, 0)));
+ remove_lv = lv; /* When origin is missing, drop everything */
+ } else
+ remove_lv = seg->pool_lv;
+
+ if (lv_is_partial(seg_lv(first_seg(seg->pool_lv), 0)))
+ log_warn("WARNING: Cache pool data logical volume %s is missing.",
+ display_lvname(seg_lv(first_seg(seg->pool_lv), 0)));
+
+ if (lv_is_partial(first_seg(seg->pool_lv)->metadata_lv))
+ log_warn("WARNING: Cache pool metadata logical volume %s is missing.",
+ display_lvname(first_seg(seg->pool_lv)->metadata_lv));
+
+ /* TODO: Check for failed cache as well to get prompting? */
+ if (lv_is_partial(lv)) {
+ if (strcmp("writethrough", get_cache_mode_name(first_seg(seg->pool_lv)))) {
+ if (!lp->force) {
+ log_error("Conversion aborted.");
+ log_error("Cannot uncache writethrough cache volume %s without --force.",
+ display_lvname(lv));
+ return 0;
+ }
+ log_warn("WARNING: Uncaching of partially missing writethrough cache volume %s might destroy your data.",
+ display_lvname(first_seg(seg->pool_lv)->metadata_lv));
+ }
+
+ if (!lp->yes &&
+ yes_no_prompt("Do you really want to uncache %s? with missing LVs [y/n]: ",
+ display_lvname(lv)) == 'n') {
+ log_error("Conversion aborted.");
+ return 0;
+ }
+ }
+
+ if (!lvremove_single(cmd, remove_lv, NULL))
return_0;
- log_print_unless_silent("Logical volume %s is not cached.", display_lvname(lv));
+ if (remove_lv != lv)
+ log_print_unless_silent("Logical volume %s is not cached.", display_lvname(lv));
return 1;
}
@@ -3421,7 +3463,7 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
int saved_ignore_suspended_devices = ignore_suspended_devices();
uint32_t lockd_state = 0;
- if (lp->repair) {
+ if (lp->repair || lp->uncache) {
init_ignore_suspended_devices(1);
cmd->handles_missing_pvs = 1;
}
7 years, 9 months
master - libdm: parse more info from cache status
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=29d1533a497be9...
Commit: 29d1533a497be922dc114524b83e926cbb63c34a
Parent: 9918d95490d46dee12768494dcc8afe784dd19c0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 9 18:00:57 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:53 2016 +0100
libdm: parse more info from cache status
Parse Fail/Error/need_check/ro status info from cache.
---
WHATS_NEW_DM | 1 +
libdm/libdevmapper.h | 8 +++++++-
libdm/libdm-targets.c | 18 ++++++++++++++++++
3 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 4cdd97c..274d1b9 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.120 -
=================================
+ Improve parsing of cache status and report Fail, Error, needs_check, ro.
Version 1.02.119 - 4th March 2016
=================================
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 0b7d5ba..ac79a57 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -361,8 +361,14 @@ struct dm_status_cache {
char **core_argv;
char *policy_name;
- int policy_argc;
+ int policy_argc;
char **policy_argv;
+
+ unsigned error : 1; /* detected error (switches to fail soon) */
+ unsigned fail : 1; /* all I/O fails */
+ unsigned needs_check : 1; /* metadata needs check */
+ unsigned read_only : 1; /* metadata may not be changed */
+ uint32_t reserved : 28;
};
int dm_get_status_cache(struct dm_pool *mem, const char *params,
diff --git a/libdm/libdm-targets.c b/libdm/libdm-targets.c
index 7428eba..bd6e5e2 100644
--- a/libdm/libdm-targets.c
+++ b/libdm/libdm-targets.c
@@ -194,6 +194,17 @@ int dm_get_status_cache(struct dm_pool *mem, const char *params,
if (!(s = dm_pool_zalloc(mem, sizeof(struct dm_status_cache))))
return_0;
+ if (strstr(params, "Error")) {
+ s->error = 1;
+ s->fail = 1; /* This is also I/O fail state */
+ goto out;
+ }
+
+ if (strstr(params, "Fail")) {
+ s->fail = 1;
+ goto out;
+ }
+
/* Read in args that have definitive placement */
if (sscanf(params,
" %" PRIu32
@@ -258,6 +269,13 @@ int dm_get_status_cache(struct dm_pool *mem, const char *params,
(dm_split_words(str, s->policy_argc, 0, s->policy_argv) != s->policy_argc)))
goto bad;
+ /* TODO: improve this parser */
+ if (strstr(p, " ro"))
+ s->read_only = 1;
+
+ if (strstr(p, " needs_check"))
+ s->needs_check = 1;
+out:
*status = s;
return 1;
7 years, 9 months
master - metadata: do not issue warning message about PV dev size being 0 when the device has gone just after VG read
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9918d95490d46d...
Commit: 9918d95490d46dee12768494dcc8afe784dd19c0
Parent: 8f01ee3035cf5ede72a8653fd1dca2987db29475
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Mar 10 13:02:38 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Mar 10 13:11:15 2016 +0100
metadata: do not issue warning message about PV dev size being 0 when the device has gone just after VG read
There's a window between doing VG read and checking PV device size
against real device size. If the device is removed in this window,
the dev cache still holds struct device and pv->dev still references
that and that PV is not marked as missing. However, if we're trying
to get size for such device, the open fails because that device
doesn't exists anymore.
We called existing pv_dev_size in _check_pv_dev_sizes fn. But
pv_dev_size assigned a size of 0 if the dev_get_size it called failed
(because the device is gone).
So call the dev_get_size directly and check for the return code
in _check_pv_dev_sizes and go further only if we really know the
device size. This is to avoid confusing warning messages like:
Device /dev/sdd1 has size of 0 sectors which is smaller than corresponding PV size of 31455207 sectors. Was device resized?
One or more devices used as PVs in VG helter_skelter have changed sizes.
---
lib/metadata/metadata.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 1330cc0..d04adb6 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -680,8 +680,14 @@ static int _check_pv_dev_sizes(struct volume_group *vg)
dm_list_iterate_items(pvl, &vg->pvs) {
if (is_missing_pv(pvl->pv))
continue;
-
- dev_size = pv_dev_size(pvl->pv);
+ /*
+ * Don't compare the sizes if we're not able
+ * to determine the real dev_size. This may
+ * happen if the device has gone since we did
+ * VG read.
+ */
+ if (!dev_get_size(pvl->pv->dev, &dev_size))
+ continue;
size = pv_size(pvl->pv);
if (dev_size < size) {
7 years, 9 months
master - remove unused define
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8f01ee3035cf5e...
Commit: 8f01ee3035cf5ede72a8653fd1dca2987db29475
Parent: 18291fd01639939812779e63de0d64a4224729ad
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Mar 9 13:38:04 2016 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Mar 9 13:38:04 2016 -0600
remove unused define
---
lib/config/defaults.h | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 51fd01d..a6806cd 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -235,6 +235,4 @@
#define DEFAULT_THIN_POOL_AUTOEXTEND_THRESHOLD 100
#define DEFAULT_THIN_POOL_AUTOEXTEND_PERCENT 20
-#define DEFAULT_CY_LOCK_TYPE "sanlock"
-
#endif /* _LVM_DEFAULTS_H */
7 years, 9 months
master - test: Remove work-in-progress code from dbustest
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=18291fd0163993...
Commit: 18291fd01639939812779e63de0d64a4224729ad
Parent: e72184bb761a7f2c48caf5dae64e75d57f64bfe0
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Mar 9 14:03:17 2016 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Mar 9 14:04:28 2016 +0100
test: Remove work-in-progress code from dbustest
(cherry picked from commit 3189d4d50492f5b78cf3920a7f499fd1020983c6)
---
test/api/dbustest.sh | 35 -----------------------------------
1 files changed, 0 insertions(+), 35 deletions(-)
diff --git a/test/api/dbustest.sh b/test/api/dbustest.sh
index 0ef9a95..039689d 100644
--- a/test/api/dbustest.sh
+++ b/test/api/dbustest.sh
@@ -30,40 +30,5 @@ fi
# Setup the python path so we can run
export PYTHONPATH=$abs_top_builddir/daemons
-if true; then
-
aux prepare_lvmdbusd
$abs_top_builddir/test/dbus/lvmdbustest.py -v
-
-else
-
-# Start the dbus service
-$abs_top_builddir/daemons/lvmdbusd/lvmdbusd --debug --udev > debug.log_lvmdbusd 2>&1 &
-
-# Give the service some time to start before we try to run the
-# unit test
-sleep 1
-
-LVM_DBUS_PID=$(ps aux | grep lvmdbus[d] | awk '{print $2}')
-if [ "CHK${LVM_DBUS_PID}" == "CHK" ];then
- echo "Failed to start lvmdbusd daemon"
- exit 1
-fi
-END
-
-# Run all the unit tests
-$abs_top_builddir/test/dbus/lvmdbustest.py -v || fail=$?
-
-# We can run individual unit tests by doing this
-# $abs_top_builddir/test/dbus/lvmdbustest.py -v TestDbusService.test_snapshot_merge
-
-echo "Stopping service"
-kill $LVM_DBUS_PID || {
- sleep 1
- kill -9 $LVM_DBUS_PID
-}
-wait
-
-exit ${fail:-"0"}
-
-fi
7 years, 9 months
master - spec: Fix gobject dependency
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e72184bb761a7f...
Commit: e72184bb761a7f2c48caf5dae64e75d57f64bfe0
Parent: 55d1105fc9f7e81bdca0f4d489d157b79350cac8
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Mar 9 11:42:55 2016 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Mar 9 14:00:05 2016 +0100
spec: Fix gobject dependency
Use python3-gobject-base instead of python3-gobject requiring xorg
(cherry picked from commit d929d82116759f53484e662b967165ef4fe4257c)
---
spec/packages.inc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index 23d6fd6..817457b 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -458,7 +458,7 @@ Requires: lvm2 >= %{version}-%{release}
Requires: dbus
Requires: python3-dbus
Requires: python3-pyudev
-Requires: python3-gobject
+Requires: python3-gobject-base
Requires(post): systemd-units >= %{systemd_version}
Requires(preun): systemd-units >= %{systemd_version}
Requires(postun): systemd-units >= %{systemd_version}
7 years, 9 months
master - test: skip unrelated tests while testing lvmpolld
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=55d1105fc9f7e8...
Commit: 55d1105fc9f7e81bdca0f4d489d157b79350cac8
Parent: 5434e9f5ea697de7fe8785476f9e94f8615012f8
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Wed Mar 9 12:32:10 2016 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Wed Mar 9 12:59:45 2016 +0100
test: skip unrelated tests while testing lvmpolld
---
test/api/vgtest.sh | 1 +
test/shell/dmstats-create.sh | 2 ++
test/shell/dmstats-report.sh | 2 ++
test/shell/format-lvm1.sh | 2 ++
test/shell/lv-ancestry.sh | 2 ++
test/shell/process-each-duplicate-pvs.sh | 1 +
test/shell/process-each-vg.sh | 2 ++
test/shell/process-each-vgreduce.sh | 1 +
test/shell/pvcreate-restore.sh | 1 +
test/shell/thin-overprovisioning.sh | 1 +
10 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/test/api/vgtest.sh b/test/api/vgtest.sh
index a262c26..13bf505 100644
--- a/test/api/vgtest.sh
+++ b/test/api/vgtest.sh
@@ -14,6 +14,7 @@
#
SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/dmstats-create.sh b/test/shell/dmstats-create.sh
index 028bec7..a52cd34 100644
--- a/test/shell/dmstats-create.sh
+++ b/test/shell/dmstats-create.sh
@@ -9,6 +9,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+SKIP_WITH_LVMPOLLD=1
+
. lib/inittest
# Don't attempt to test stats with driver < 4.33.00
diff --git a/test/shell/dmstats-report.sh b/test/shell/dmstats-report.sh
index 702ea61..56f913d 100644
--- a/test/shell/dmstats-report.sh
+++ b/test/shell/dmstats-report.sh
@@ -9,6 +9,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+SKIP_WITH_LVMPOLLD=1
+
. lib/inittest
# Don't attempt to test stats with driver < 4.33.00
diff --git a/test/shell/format-lvm1.sh b/test/shell/format-lvm1.sh
index 2b6e1a2..a310b12 100644
--- a/test/shell/format-lvm1.sh
+++ b/test/shell/format-lvm1.sh
@@ -11,6 +11,8 @@
test_description='Test lvm1 format'
+SKIP_WITH_LVMPOLLD=1
+
. lib/inittest
aux prepare_devs 1
diff --git a/test/shell/lv-ancestry.sh b/test/shell/lv-ancestry.sh
index febaf40..0e0cc79 100644
--- a/test/shell/lv-ancestry.sh
+++ b/test/shell/lv-ancestry.sh
@@ -10,6 +10,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+SKIP_WITH_LVMPOLLD=1
+
. lib/inittest
aux have_thin 1 0 0 || skip
diff --git a/test/shell/process-each-duplicate-pvs.sh b/test/shell/process-each-duplicate-pvs.sh
index cf0ca2d..47e1043 100644
--- a/test/shell/process-each-duplicate-pvs.sh
+++ b/test/shell/process-each-duplicate-pvs.sh
@@ -8,6 +8,7 @@
test_description='Test duplicate PVs'
SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/process-each-vg.sh b/test/shell/process-each-vg.sh
index 22244a6..6d7b716 100644
--- a/test/shell/process-each-vg.sh
+++ b/test/shell/process-each-vg.sh
@@ -11,6 +11,8 @@
test_description='Exercise toollib process_each_vg'
+SKIP_WITH_LVMPOLLD=1
+
. lib/inittest
aux prepare_devs 6
diff --git a/test/shell/process-each-vgreduce.sh b/test/shell/process-each-vgreduce.sh
index 6df8c56..e9f024a 100644
--- a/test/shell/process-each-vgreduce.sh
+++ b/test/shell/process-each-vgreduce.sh
@@ -12,6 +12,7 @@
test_description='Exercise toollib process_each_pv with vgreduce'
SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/pvcreate-restore.sh b/test/shell/pvcreate-restore.sh
index ac0469e..7a4a57c 100644
--- a/test/shell/pvcreate-restore.sh
+++ b/test/shell/pvcreate-restore.sh
@@ -10,6 +10,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
. lib/inittest
diff --git a/test/shell/thin-overprovisioning.sh b/test/shell/thin-overprovisioning.sh
index 73accfe..8a396b6 100644
--- a/test/shell/thin-overprovisioning.sh
+++ b/test/shell/thin-overprovisioning.sh
@@ -12,6 +12,7 @@
# Test warns when thin pool is overprovisiong
SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
7 years, 9 months
master - test: fix inverted condition
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5434e9f5ea697d...
Commit: 5434e9f5ea697de7fe8785476f9e94f8615012f8
Parent: e655ccb418d942889aae5c83af25ca8d085825b8
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Wed Mar 9 11:31:01 2016 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Wed Mar 9 12:59:42 2016 +0100
test: fix inverted condition
---
test/shell/lvmetad-pvs.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvmetad-pvs.sh b/test/shell/lvmetad-pvs.sh
index 97cc205..2f51944 100644
--- a/test/shell/lvmetad-pvs.sh
+++ b/test/shell/lvmetad-pvs.sh
@@ -10,7 +10,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
SKIP_WITH_LVMLOCKD=1
-SKIP_WITHOUT_LVMPOLLD=1
+SKIP_WITH_LVMPOLLD=1
. lib/inittest
7 years, 9 months
master - test: Add prepare_lvmdbusd
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e655ccb418d942...
Commit: e655ccb418d942889aae5c83af25ca8d085825b8
Parent: d7ca164597ec5f334c061ffbad78677c4b36f281
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Mar 1 11:49:05 2016 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Mar 9 10:58:21 2016 +0100
test: Add prepare_lvmdbusd
- Check for running lvmdbusd at start
- Add teardown for lvmdbusd
---
test/api/dbustest.sh | 12 +++++++++++-
test/lib/aux.sh | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 1 deletions(-)
diff --git a/test/api/dbustest.sh b/test/api/dbustest.sh
index ba3173e..0ef9a95 100644
--- a/test/api/dbustest.sh
+++ b/test/api/dbustest.sh
@@ -30,6 +30,13 @@ fi
# Setup the python path so we can run
export PYTHONPATH=$abs_top_builddir/daemons
+if true; then
+
+aux prepare_lvmdbusd
+$abs_top_builddir/test/dbus/lvmdbustest.py -v
+
+else
+
# Start the dbus service
$abs_top_builddir/daemons/lvmdbusd/lvmdbusd --debug --udev > debug.log_lvmdbusd 2>&1 &
@@ -39,9 +46,10 @@ sleep 1
LVM_DBUS_PID=$(ps aux | grep lvmdbus[d] | awk '{print $2}')
if [ "CHK${LVM_DBUS_PID}" == "CHK" ];then
- echo "Failed to start lsmdbusd daemon"
+ echo "Failed to start lvmdbusd daemon"
exit 1
fi
+END
# Run all the unit tests
$abs_top_builddir/test/dbus/lvmdbustest.py -v || fail=$?
@@ -57,3 +65,5 @@ kill $LVM_DBUS_PID || {
wait
exit ${fail:-"0"}
+
+fi
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 021eb81..af6b25a 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -300,6 +300,42 @@ lvmpolld_dump() {
(echo 'request="dump"'; echo '##') | lvmpolld_talk "$@"
}
+prepare_lvmdbusd() {
+ rm -f debug.log_LVMDBUSD_out
+
+ echo "checking lvmdbusd is NOT running..."
+ if ps -elf | grep lvmdbusd | grep python3; then
+ echo "Cannot run while existing lvmdbusd process exists"
+ return 1
+ fi
+ echo ok
+
+ # skip if we don't have our own lvmdbusd...
+ # TODO: lvmdbusd is not in PATH
+ #(which lvmdbusd 2>/dev/null | grep "$abs_builddir") || skip
+ [[ -x $abs_top_builddir/daemons/lvmdbusd/lvmdbusd ]] || skip
+
+ kill_sleep_kill_ LOCAL_LVMDBUSD 0
+
+ echo "preparing lvmdbusd..."
+ $abs_top_builddir/daemons/lvmdbusd/lvmdbusd --debug --udev > debug.log_LVMDBUSD_out 2>&1 &
+ local pid=$!
+
+ sleep 1
+ echo "checking lvmdbusd IS running..."
+ if ! ps -elf | grep lvmdbusd | grep python3; then
+ echo "Failed to start lvmdbusd daemon"
+ return 1
+ fi
+ # TODO: Is there a better check than wait 1 second and check pid?
+ if ! ps -p $pid -o comm= >/dev/null || [[ $(ps -p $pid -o comm=) != python3 ]]; then
+ echo "Failed to start lvmdbusd daemon"
+ return 1
+ fi
+ echo $pid > LOCAL_LVMDBUSD
+ echo ok
+}
+
teardown_devs_prefixed() {
local prefix=$1
local stray=${2:-0}
@@ -464,6 +500,10 @@ teardown() {
fi
}
+ kill_sleep_kill_ LOCAL_LVMDBUSD 0
+
+ echo -n .
+
kill_sleep_kill_ LOCAL_LVMPOLLD ${LVM_VALGRIND_LVMPOLLD:-0}
echo -n .
7 years, 9 months