[netfilter-cvslog] r3529 - trunk/nfsim/core
rusty at netfilter.org
rusty at netfilter.org
Fri Dec 31 09:32:29 CET 2004
Author: rusty at netfilter.org
Date: 2004-12-31 09:32:28 +0100 (Fri, 31 Dec 2004)
New Revision: 3529
Modified:
trunk/nfsim/core/core.c
trunk/nfsim/core/core.h
trunk/nfsim/core/failtest.c
Log:
Various --failtest fixes:
1) When warning about failures being ignored, print line in correct format for --failpattern.
2) When wanring about failures being ignored, only print each line once.
3) When warning about failures being ignored, print test name if available.
4) Suppress failtest for --ignore-proc-issues: obviously causes chaos.
Modified: trunk/nfsim/core/core.c
===================================================================
--- trunk/nfsim/core/core.c 2004-12-31 07:06:48 UTC (rev 3528)
+++ trunk/nfsim/core/core.c 2004-12-31 08:32:28 UTC (rev 3529)
@@ -38,6 +38,7 @@
};
char nf_retval_error[100];
+const char *nfsim_testname;
const char *nf_retval(int retval)
{
@@ -376,6 +377,7 @@
int input = open(argv[optind], O_RDONLY);
if (input < 0)
barf_perror("Opening %s", argv[optind]);
+ nfsim_testname = argv[optind];
dup2(input, STDIN_FILENO);
close(input);
}
@@ -430,6 +432,7 @@
message_cleanup();
unload_all_modules();
+ suppress_failtest++;
check_allocations();
return 0;
Modified: trunk/nfsim/core/core.h
===================================================================
--- trunk/nfsim/core/core.h 2004-12-31 07:06:48 UTC (rev 3528)
+++ trunk/nfsim/core/core.h 2004-12-31 08:32:28 UTC (rev 3529)
@@ -290,6 +290,9 @@
/* Root for all kernel code allocations (so we check memory leaks) */
extern void *nfsim_tallocs;
+/* If the test has a name, this is it. */
+extern const char *nfsim_testname;
+
enum exitcodes
{
/* EXIT_SUCCESS, EXIT_FAILURE is in stdlib.h */
Modified: trunk/nfsim/core/failtest.c
===================================================================
--- trunk/nfsim/core/failtest.c 2004-12-31 07:06:48 UTC (rev 3528)
+++ trunk/nfsim/core/failtest.c 2004-12-31 08:32:28 UTC (rev 3529)
@@ -150,7 +150,7 @@
list_for_each_entry(i, &prev->list, list) {
if (i->tui_line != linenum)
break;
- ret = talloc_asprintf_append(ret, "[%s]:%c",
+ ret = talloc_asprintf_append(ret, "[%s]%c",
i->location,
i->failed ? 'F' : 'S');
}
@@ -161,15 +161,18 @@
{
char *warning;
struct fail_decision *i;
+ int last_warning = 0;
- nfsim_log(LOG_ALWAYS, "WARNING: test ignores failures");
+ nfsim_log(LOG_ALWAYS, "WARNING: test %s ignores failures",
+ nfsim_testname ?: "");
list_for_each_entry(i, &decisions, list) {
- if (i->failed) {
+ if (i->failed && i->tui_line > last_warning) {
warning = failpath_string_for_line(i);
nfsim_log(LOG_ALWAYS, " Line %i: %s",
i->tui_line, warning);
talloc_free(warning);
+ last_warning = i->tui_line;
}
}
}
More information about the netfilter-cvslog
mailing list