master - tests: do not run lvmetad tests without lvmetad
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c7b733cd6cbc69...
Commit: c7b733cd6cbc69e4a681b17ca4e89eb9fcd6d31f
Parent: 6f0300de9653063222c536b7cb04784d94787dd0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 5 12:31:49 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 5 12:40:47 2013 +0100
tests: do not run lvmetad tests without lvmetad
Skip tests when lvmetad is not compiled.
---
test/Makefile.in | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 943a4ce..96c4fdb 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -42,6 +42,11 @@ comma = ,
RUN = $(shell find $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | sort)
RUN_BASE = $(subst $(srcdir)/,,$(RUN))
+ifeq ("@BUILD_LVMETAD@", "yes")
+LVMETAD_RUN_BASE = $(RUN_BASE)
+endif
+
+
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -83,7 +88,7 @@ check: .tests-stamp
lvmetad_LVM_TEST_LVMETAD=1 \
./lib/harness $(patsubst %,normal:%,$(RUN_BASE)) \
$(patsubst %,cluster:%,$(RUN_BASE)) \
- $(patsubst %,lvmetad:%,$(RUN_BASE))
+ $(patsubst %,lvmetad:%,$(LVMETAD_RUN_BASE))
check_full: .tests-stamp
VERBOSE=$(VERBOSE) \
@@ -96,10 +101,10 @@ check_full: .tests-stamp
slvmetad_LVM_TEST_DEVDIR=/dev \
./lib/harness $(patsubst %,normal:%,$(RUN_BASE)) \
$(patsubst %,cluster:%,$(RUN_BASE)) \
- $(patsubst %,lvmetad:%,$(RUN_BASE)) \
+ $(patsubst %,lvmetad:%,$(LVMETAD_RUN_BASE)) \
$(patsubst %,snormal:%,$(RUN_BASE)) \
$(patsubst %,scluster:%,$(RUN_BASE)) \
- $(patsubst %,slvmetad:%,$(RUN_BASE))
+ $(patsubst %,slvmetad:%,$(LVMETAD_RUN_BASE))
check_cluster: .tests-stamp
@echo Testing with locking_type 3
@@ -109,9 +114,11 @@ check_local: .tests-stamp
@echo Testing with locking_type 1
VERBOSE=$(VERBOSE) LVM_TEST_LOCKING=1 ./lib/harness $(RUN_BASE)
+ifeq ("@BUILD_LVMETAD@", "yes")
check_lvmetad: .tests-stamp
@echo Testing with lvmetad on
VERBOSE=$(VERBOSE) LVM_TEST_LVMETAD=1 ./lib/harness $(RUN_BASE)
+endif
lib/should: lib/not
ln -sf not lib/should
10 years, 3 months
master - lv_remove_single: update parameter name
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6f0300de965306...
Commit: 6f0300de9653063222c536b7cb04784d94787dd0
Parent: aa75698a1779c426914fde81bd57a016397017f3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 5 12:39:02 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 5 12:40:47 2013 +0100
lv_remove_single: update parameter name
Since we have already a meaning for 'silent'
replace its name with more explanator suppress_remove_message
(updates recent commit).
---
lib/metadata/lv_manip.c | 4 ++--
lib/metadata/metadata-exported.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9806758..62ca245 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4494,7 +4494,7 @@ void lv_set_hidden(struct logical_volume *lv)
}
int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
- force_t force, int silent)
+ force_t force, int suppress_remove_message)
{
struct volume_group *vg;
struct lvinfo info;
@@ -4651,7 +4651,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
backup(vg);
- if (!silent && visible)
+ if (!suppress_remove_message && visible)
log_print_unless_silent("Logical volume \"%s\" successfully removed", lv->name);
return 1;
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 9798197..9d547bb 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -658,7 +658,7 @@ int lv_extend(struct logical_volume *lv,
int lv_remove(struct logical_volume *lv);
int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
- force_t force, int silent);
+ force_t force, int suppress_remove_message);
int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *lv,
force_t force, unsigned level);
10 years, 3 months
master - tests: harness prints debug.log
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aa75698a1779c4...
Commit: aa75698a1779c426914fde81bd57a016397017f3
Parent: 7baf411c9774d8e51ccc8bff9399562da69906a3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 5 11:12:56 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 5 11:18:15 2013 +0100
tests: harness prints debug.log
When the test is interrupted because debug.log has got to big,
and the test doesn't react on SIGINT - and needs to be only
killed with SIGKILL - it's still valuable to print at least
a portion of this debug.log (currently 4MB).
LVM_TEST_UNLIMITED could be set to avoid this limitation
(i.e. when busy-looping lvm command needs to be running
for gdb attachment)
---
test/lib/harness.c | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/test/lib/harness.c b/test/lib/harness.c
index 4b7686d..5591f77 100644
--- a/test/lib/harness.c
+++ b/test/lib/harness.c
@@ -27,6 +27,7 @@
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
+#include <stdint.h>
static pid_t pid;
static int fds[2];
@@ -54,6 +55,7 @@ static int verbose = 0; /* >1 with timestamps */
static int interactive = 0; /* disable all redirections */
static const char *results;
static unsigned fullbuffer = 0;
+static int unlimited = 0;
static FILE *outfile = NULL;
char testdirdebug[PATH_MAX];
@@ -170,8 +172,7 @@ static int64_t _get_time_us(void)
static void _append_buf(const char *buf, size_t len)
{
if ((readbuf_used + len) >= readbuf_sz) {
- if ((readbuf_sz >= MAX_LOG_SIZE) &&
- !getenv("LVM_TEST_UNLIMITED")) {
+ if ((readbuf_sz >= MAX_LOG_SIZE) && !unlimited) {
if (fullbuffer++ == 0)
kill(-pid, SIGINT);
return;
@@ -222,12 +223,12 @@ static const char *_append_with_stamp(const char *buf, int stamp)
return bb;
}
-static void drain(int fd)
+static void drain(int fd, size_t size_limit)
{
char buf[4096 + 1];
const char *bp;
int stamp = 0;
- int sz;
+ int sz, total_sz = 0;
static int stdout_last = -1, stdout_counter = 0;
static int outfile_last = -1, outfile_counter = 0;
@@ -249,6 +250,12 @@ static void drain(int fd)
trickle(stdout, &stdout_last, &stdout_counter);
if (outfile)
trickle(outfile, &outfile_last, &outfile_counter);
+
+ total_sz += sz;
+ if (total_sz > size_limit) {
+ printf("\n...Trimmed output...\n");
+ break;
+ }
}
}
@@ -373,6 +380,7 @@ static void run(int i, char *f) {
fd_set set;
int runaway = 0;
int no_write = 0;
+ int collect_debug = 0;
FILE *varlogmsg;
int fd_vlm = -1;
@@ -403,6 +411,7 @@ static void run(int i, char *f) {
kill(pid, SIGINT);
sleep(5); /* wait a bit for a reaction */
if ((w = waitpid(pid, &st, WNOHANG)) == 0) {
+ collect_debug = 1;
kill(-pid, SIGKILL);
w = pid; // waitpid(pid, &st, NULL);
}
@@ -416,7 +425,8 @@ static void run(int i, char *f) {
selectwait.tv_usec = 500000; /* timeout 0.5s */
if (select(fds[0] + 1, &set, NULL, NULL, &selectwait) <= 0) {
/* Still checking debug log size if it's not growing too much */
- if (testdirdebug[0] && (stat(testdirdebug, &statbuf) == 0) &&
+ if (!unlimited && testdirdebug[0] &&
+ (stat(testdirdebug, &statbuf) == 0) &&
statbuf.st_size > 32 * 1024 * 1024) { /* 32MB command log size */
printf("Killing test since debug.log has gone wild (size %ld)\n",
statbuf.st_size);
@@ -426,21 +436,27 @@ static void run(int i, char *f) {
no_write++;
continue;
}
- drain(fds[0]);
+ drain(fds[0], INT32_MAX);
no_write = 0;
if (fd_vlm >= 0)
- drain(fd_vlm);
+ drain(fd_vlm, INT32_MAX);
}
if (w != pid) {
perror("waitpid");
exit(206);
}
- drain(fds[0]);
+ drain(fds[0], INT32_MAX);
if (fd_vlm >= 0)
- drain(fd_vlm);
+ drain(fd_vlm, INT32_MAX);
if (die == 2)
interrupted(i, f);
else if (runaway) {
+ if (collect_debug &&
+ (fd_vlm = open(testdirdebug, O_RDONLY)) != -1) {
+ /* Normally read only first 4MB */
+ drain(fd_vlm, unlimited ? INT32_MAX : 4 * 1024 * 1024);
+ close(fd_vlm);
+ }
timeout(i, f);
} else if (WIFEXITED(st)) {
if (WEXITSTATUS(st) == 0)
@@ -485,6 +501,7 @@ int main(int argc, char **argv) {
interactive = atoi(be_interactive);
results = getenv("LVM_TEST_RESULTS") ? : "results";
+ unlimited = getenv("LVM_TEST_UNLIMITED") ? 1 : 0;
(void) snprintf(results_list, sizeof(results_list), "%s/list", results);
//if (pipe(fds)) {
10 years, 3 months
master - dev-cache: return success when ignoring dirs
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7baf411c9774d8...
Commit: 7baf411c9774d8e51ccc8bff9399562da69906a3
Parent: 74878bc2bcd66d60a0b53f409a30271496acd348
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 5 11:11:26 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 5 11:17:37 2013 +0100
dev-cache: return success when ignoring dirs
When there is no failure from the insert operation itself,
just dirs and links are skipped - return success.
---
WHATS_NEW | 1 +
lib/device/dev-cache.c | 14 +++++---------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 60571ff..2e1f59a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
+ Return success when inserting dirs and links into device cache.
Test for remote exclusive activation after activation fails.
Support lvconvert --merge for thin snapshots.
Add support to read thin device id from table line entry.
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 9451314..bbdde92 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -592,7 +592,6 @@ static void _insert_dirs(struct dm_list *dirs)
static int _insert(const char *path, int rec, int check_with_udev_db)
{
struct stat info;
- int r = 0;
if (stat(path, &info) < 0) {
log_sys_very_verbose("stat", path);
@@ -613,25 +612,22 @@ static int _insert(const char *path, int rec, int check_with_udev_db)
if (S_ISLNK(info.st_mode)) {
log_debug_devs("%s: Symbolic link to directory", path);
- return 0;
+ return 1;
}
- if (rec)
- r = _insert_dir(path);
-
+ if (rec && !_insert_dir(path))
+ return_0;
} else { /* add a device */
if (!S_ISBLK(info.st_mode)) {
log_debug_devs("%s: Not a block device", path);
- return 0;
+ return 1;
}
if (!_insert_dev(path, info.st_rdev))
return_0;
-
- r = 1;
}
- return r;
+ return 1;
}
static void _full_scan(int dev_scan)
10 years, 3 months
master - cleanup: gcc can't see the code path
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=74878bc2bcd66d...
Commit: 74878bc2bcd66d60a0b53f409a30271496acd348
Parent: ac6cd9baa7dac621cae58d545080599dcc281413
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 5 09:41:03 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 5 09:42:50 2013 +0100
cleanup: gcc can't see the code path
This is a bit to hard for gcc to see the condition can't
be triggered, so make it easier and initialize to 0.
---
tools/lvconvert.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 11ee21a..87eb643 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1803,8 +1803,7 @@ static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, int *replace_dev
static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp)
{
- int replace = 0;
- int uninitialized_var(image_count);
+ int replace = 0, image_count = 0;
struct dm_list *failed_pvs;
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *seg = first_seg(lv);
10 years, 3 months
master - lvmetad: remove unused override variables
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ac6cd9baa7dac6...
Commit: ac6cd9baa7dac621cae58d545080599dcc281413
Parent: b6d3fd62fc87bcdc6a12b7751e36a6a84b0bb62d
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Dec 5 01:13:18 2013 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Dec 5 01:13:18 2013 +0000
lvmetad: remove unused override variables
---
daemons/lvmetad/lvmetad-core.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 2810faf..bc306f3 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1197,8 +1197,6 @@ int main(int argc, char *argv[])
{
signed char opt;
lvmetad_state ls;
- int _pidfile_override = 1;
- int _socket_override = 1;
daemon_state s = {
.daemon_fini = fini,
.daemon_init = init,
@@ -1211,15 +1209,11 @@ int main(int argc, char *argv[])
.socket_path = getenv("LVM_LVMETAD_SOCKET"),
};
- if (!s.pidfile) {
- _pidfile_override = 0;
+ if (!s.pidfile)
s.pidfile = LVMETAD_PIDFILE;
- }
- if (!s.socket_path) {
- _socket_override = 0;
+ if (!s.socket_path)
s.socket_path = LVMETAD_SOCKET;
- }
ls.log_config = "";
@@ -1240,11 +1234,9 @@ int main(int argc, char *argv[])
break;
case 'p':
s.pidfile = optarg;
- _pidfile_override = 1;
break;
case 's': // --socket
s.socket_path = optarg;
- _socket_override = 1;
break;
case 'V':
printf("lvmetad version: " LVM_VERSION "\n");
10 years, 3 months
master - libdm: prevent empty config file section names
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b6d3fd62fc87bc...
Commit: b6d3fd62fc87bcdc6a12b7751e36a6a84b0bb62d
Parent: 76ca82df827c83c475a4eb8edb7bb670528cf6e7
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Dec 5 01:09:03 2013 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Dec 5 01:09:03 2013 +0000
libdm: prevent empty config file section names
Change c35394959758ec17389529f95a33bf7f5b15c56b to use existing
_dup_string_tok(). alloca() doesn't fail cleanly (and needs
replacing.)
---
WHATS_NEW_DM | 1 +
libdm/libdm-config.c | 40 ++++++++++++++++++++++++++--------------
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 1f1cde1..b737a3e 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.84 -
====================================
+ Allow section names in config file data to be quoted strings.
Close fifos before exiting in dmeventd restart() error path.
Move printf format string directly into dm_asprintf args list.
Catch invalid use of string sort values when reporting numerical fields.
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index fbee007..ea1af2f 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -253,11 +253,7 @@ static int _write_value(struct config_output *out, const struct dm_config_value
switch (v->type) {
case DM_CFG_STRING:
- if (!(buf = alloca(dm_escaped_len(v->v.str)))) {
- log_error("temporary stack allocation for a config "
- "string failed");
- return 0;
- }
+ buf = alloca(dm_escaped_len(v->v.str));
line_append("\"%s\"", dm_escape_double_quotes(buf, v->v.str));
break;
@@ -440,24 +436,40 @@ static struct dm_config_node *_file(struct parser *p)
static struct dm_config_node *_section(struct parser *p)
{
/* IDENTIFIER SECTION_B_CHAR VALUE* SECTION_E_CHAR */
+
struct dm_config_node *root, *n, *l = NULL;
- char *token;
+ char *str;
+
if (!(root = _create_node(p->mem))) {
log_error("Failed to allocate section node");
return NULL;
}
- if (!(root->key = token = _dup_tok(p)))
- return_NULL;
-
if (p->t == TOK_STRING_ESCAPED) {
- token ++; /* OK as the token is pool-allocated */
- token[strlen(token) - 1] = 0;
- dm_unescape_double_quotes(token);
- root->key = token;
+ if (!(str = _dup_string_tok(p)))
+ return_NULL;
+ dm_unescape_double_quotes(str);
+ root->key = str;
+
match(TOK_STRING_ESCAPED);
- } else
+ } else if (p->t == TOK_STRING) {
+ if (!(str = _dup_string_tok(p)))
+ return_NULL;
+ root->key = str;
+
+ match(TOK_STRING);
+ } else {
+ if (!(root->key = _dup_tok(p)))
+ return_NULL;
+
match(TOK_IDENTIFIER);
+ }
+
+ if (!strlen(root->key)) {
+ log_error("Parse error at byte %" PRIptrdiff_t " (line %d): empty section identifier",
+ p->tb - p->fb + 1, p->line);
+ return NULL;
+ }
if (p->t == TOK_SECTION_B) {
match(TOK_SECTION_B);
10 years, 3 months
master - tests: drop RUN... already have this var elsewhere
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76ca82df827c83...
Commit: 76ca82df827c83c475a4eb8edb7bb670528cf6e7
Parent: d9461ae89bd725c24448ce84c7e5c7ea9cb7e29e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Dec 4 21:37:33 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Dec 4 21:37:33 2013 +0100
tests: drop RUN... already have this var elsewhere
---
test/lib/harness.c | 4 +---
test/lib/test.sh | 1 -
2 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/test/lib/harness.c b/test/lib/harness.c
index bcc6b97..4b7686d 100644
--- a/test/lib/harness.c
+++ b/test/lib/harness.c
@@ -98,13 +98,11 @@ static int outline(FILE *out, char *buf, int start, int force) {
subst[0].key = "@TESTDIR@";
free(subst[0].value);
subst[0].value = strndup(from + 9, next - from - 9 - 1);
+ snprintf(testdirdebug, sizeof(testdirdebug), "%s/debug.log", subst[0].value);
} else if (!strncmp(from, "@PREFIX=", 8)) {
subst[1].key = "@PREFIX@";
free(subst[1].value);
subst[1].value = strndup(from + 8, next - from - 8 - 1);
- } else if (!testdirdebug[0] && !strncmp(from, "RUNTESTDIR=", 11)) {
- from[strlen(from) - 1] = '\0'; /* Cut \n */
- snprintf(testdirdebug, sizeof(testdirdebug), "%s/debug.log", from + 11);
} else {
char *line = strndup(from, next - from);
char *a = line, *b;
diff --git a/test/lib/test.sh b/test/lib/test.sh
index 9e25e26..265d61d 100644
--- a/test/lib/test.sh
+++ b/test/lib/test.sh
@@ -39,7 +39,6 @@ test -n "$BASH" && trap 'set +vx; STACKTRACE; set -vx' ERR
trap 'aux teardown' EXIT # don't forget to clean up
cd "$TESTDIR"
-echo "RUNTESTDIR=$TESTDIR"
if test -n "$LVM_TEST_FLAVOUR"; then
touch flavour_overrides
10 years, 3 months
master - tests: replace built-in popen
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d9461ae89bd725...
Commit: d9461ae89bd725c24448ce84c7e5c7ea9cb7e29e
Parent: e06cfd74373ae7928ef2a340b00e9bc3da8753ca
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Dec 4 19:50:53 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Dec 4 19:50:53 2013 +0100
tests: replace built-in popen
It seems some older bashes have problems to properly execute
both pipes - so replace this code with separate temporary files.
---
test/lib/check.sh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 4847de1..84604e3 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -65,7 +65,9 @@ lv_on_diff_() {
local diff_e
# Find diff between 2 shell arrays, print them as stdin files
- diff_e=$(diff <(printf "%s\n" "${expect[@]}" | sort | uniq ) <(printf "%s\n" "${devs[@]}") ) ||
+ printf "%s\n" "${expect[@]}" | sort | uniq >_lv_on_diff1
+ printf "%s\n" "${devs[@]}" >_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")."
}
10 years, 3 months
master - tests: reuse timeout code for too long debug.log
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e06cfd74373ae7...
Commit: e06cfd74373ae7928ef2a340b00e9bc3da8753ca
Parent: c144305d3e6b68bc9f85641a5038013fdc07b5a2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Dec 4 19:48:29 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Dec 4 19:48:29 2013 +0100
tests: reuse timeout code for too long debug.log
Jump to the same code used for timeout when no output
is made for long time.
Increase the allowed debug.log size to 32MB.
---
test/lib/harness.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/test/lib/harness.c b/test/lib/harness.c
index 47a331d..bcc6b97 100644
--- a/test/lib/harness.c
+++ b/test/lib/harness.c
@@ -401,6 +401,7 @@ static void run(int i, char *f) {
(no_write > 180 * 2)) /* a 3 minute timeout */
{
system("echo t > /proc/sysrq-trigger");
+ timeout:
kill(pid, SIGINT);
sleep(5); /* wait a bit for a reaction */
if ((w = waitpid(pid, &st, WNOHANG)) == 0) {
@@ -418,10 +419,10 @@ static void run(int i, char *f) {
if (select(fds[0] + 1, &set, NULL, NULL, &selectwait) <= 0) {
/* Still checking debug log size if it's not growing too much */
if (testdirdebug[0] && (stat(testdirdebug, &statbuf) == 0) &&
- statbuf.st_size > 8 * 1024 * 1024) { /* 8MB command log size */
- fprintf(stderr, "Killing test since debug.log has gone wild (size %ld)\n",
- statbuf.st_size);
- kill(-pid, SIGINT);
+ statbuf.st_size > 32 * 1024 * 1024) { /* 32MB command log size */
+ printf("Killing test since debug.log has gone wild (size %ld)\n",
+ statbuf.st_size);
+ goto timeout;
}
no_write++;
10 years, 3 months