[PATCH] run_event_on_dir: fix double free
by Martin Milata
Run_event_on_dir freed the message buffer even if the logging callback
took ownership. Fix that.
---
src/lib/run_event.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/lib/run_event.c b/src/lib/run_event.c
index ba9920c..6f31884 100644
--- a/src/lib/run_event.c
+++ b/src/lib/run_event.c
@@ -512,7 +512,14 @@ int run_event_on_dir_name(struct run_event_state *state,
}
/* no special prefix -> forward to log if applicable */
else if (state->logging_callback)
+ {
msg = state->logging_callback(msg, state->logging_param);
+
+ /* callback took ownership of the buffer - don't free it */
+ if (!msg)
+ buf = NULL;
+ }
+
free(buf);
}
fclose(fp); /* Got EOF, close. This also closes state->command_out_fd */
--
1.7.6
12 years, 9 months
[PATCH] first part of the UI review: two pane UI
by Jiri Moskovcak
This patch splits the main UI into two panes reported/not-reported.
Known bugs:
- Submission result column needs some improvements, now it just shows
the last line from reported_to which looks weird...
-> should be clickable, if it's URL
-> all reporters which writes to some url (reportuploader, bugzilla,
logger, rhtsupport) should return the success message in the same
predefined format, so we can parse it in UI..
good example:
Bugzilla:
Bugzilla: URL=http://bugzilla.redhat.com/show_bug.cgi?id=696222
bad example:
logger:
file: /home/jmoskovc/abrt.log
How about a format:
<Event name> : <result>
event name:
- Bugzilla, Gnome Bugzilla, ...
result:
- if url:
URL=<url>
- if not url:
MSG=<generic message>
- if the line has a different format, it will be displayed in it's raw
format
- ticket https://fedorahosted.org/abrt/ticket/320
Please review and send me some feedback for the proposal (any volunteers
for implementing this are welcome ;))
J.
12 years, 9 months
[PATCH] fix abrt-gui regression (it doesn't see updates by wizard)
by Denys Vlasenko
The fix adds another reporting flag, LIBREPORT_GETPID,
which means "return the pid of reporting process".
IOW: LIBREPORT_NOWAIT will reparent reporter to init,
LIBREPORT_NOWAIT | LIBREPORT_GETPID will not.
By using LIBREPORT_NOWAIT | LIBREPORT_GETPID in abt-gui,
we make it so that reporter's SIGCHLD reaches abrt-gui
and lets it refresh the list.
Please review.
--
vda
diff -x '*.po' -d -urpN abrt.1/src/gui-gtk/main.c abrt.2/src/gui-gtk/main.c
--- abrt.1/src/gui-gtk/main.c 2011-07-20 19:26:26.026789417 +0200
+++ abrt.2/src/gui-gtk/main.c 2011-07-21 09:23:45.491335774 +0200
@@ -204,7 +204,7 @@ static void on_row_activated_cb(GtkTreeV
gtk_tree_model_get_value(store, &iter, COLUMN_DUMP_DIR, &d_dir);
const char *dirname = g_value_get_string(&d_dir);
- report_problem_in_dir(dirname, LIBREPORT_ANALYZE | LIBREPORT_NOWAIT);
+ report_problem_in_dir(dirname, LIBREPORT_ANALYZE | LIBREPORT_NOWAIT | LIBREPORT_GETPID);
}
}
}
@@ -293,8 +293,7 @@ static void on_button_send_cb(GtkWidget
/* why it doesn't want to hide before report ends? */
gtk_widget_destroy(s_report_window);
- int status = report_problem_in_memory(pd, LIBREPORT_NOWAIT);
- VERB1 log("Reporting finished with status %i", status);
+ report_problem_in_memory(pd, LIBREPORT_NOWAIT | LIBREPORT_GETPID);
free_problem_data(pd);
}
diff -x '*.po' -d -urpN libreport.4/src/include/report.h libreport.5/src/include/report.h
--- libreport.4/src/include/report.h 2011-07-19 11:48:22.000000000 +0200
+++ libreport.5/src/include/report.h 2011-07-21 09:21:34.913290086 +0200
@@ -28,10 +28,13 @@ extern "C" {
enum {
LIBREPORT_NOWAIT = 0,
LIBREPORT_WAIT = (1 << 0), /* wait for report to finish and reload the problem data */
- LIBREPORT_ANALYZE = (1 << 1), /* run analyzers? */
+ LIBREPORT_GETPID = (1 << 1), /* return pid of child. Use with LIBREPORT_NOWAIT. */
+ /* Note: without LIBREPORT_GETPID, child will be detached */
+ /* (reparented to init) */
+ LIBREPORT_ANALYZE = (1 << 2), /* run analyzers? */
/* ("run reporters" is always on, has no flag (for now?)) */
- LIBREPORT_RELOAD_DATA = (1 << 3), /* reload problem data after run (needs WAIT) */
- LIBREPORT_DEL_DIR = (1 << 4), /* delete directory after reporting */
+ LIBREPORT_RELOAD_DATA = (1 << 5), /* reload problem data after run (needs WAIT) */
+ LIBREPORT_DEL_DIR = (1 << 6), /* delete directory after reporting */
};
int report_problem_in_dir(const char *dirname, int flags);
diff -x '*.po' -d -urpN libreport.4/src/lib/report.c libreport.5/src/lib/report.c
--- libreport.4/src/lib/report.c 2011-07-19 11:48:22.000000000 +0200
+++ libreport.5/src/lib/report.c 2011-07-21 09:19:35.521766262 +0200
@@ -74,9 +74,10 @@ int report_problem_in_dir(const char *di
*/
signal(SIGCHLD, SIG_DFL);
- if (!(flags & LIBREPORT_WAIT))
+ if (!(flags & (LIBREPORT_WAIT | LIBREPORT_GETPID)))
{
- /* Caller doesn't want to wait for completion.
+ /* Caller doesn't want to wait for completion (!LIBREPORT_WAIT),
+ * and doesn't want to have pid returned (!LIBREPORT_GETPID).
* Create a grandchild, and then exit.
* This reparents grandchild to init, and makes waitpid
* in parent detect our exit and return almost immediately.
@@ -120,6 +121,13 @@ int report_problem_in_dir(const char *di
}
/* parent */
+ if (!(flags & LIBREPORT_WAIT) && (flags & LIBREPORT_GETPID))
+ return pid;
+
+ /* we are here either if LIBREPORT_WAIT (caller wants exitcode)
+ * or !LIBREPORT_GETPID (caller doesn't want to have a child).
+ * In both cases, we need to wait for child:
+ */
int status;
do
pid = waitpid(pid, &status, 0);
@@ -150,7 +158,7 @@ int report_problem_in_memory(problem_dat
dd_close(dd);
VERB2 log("Temp problem dir: '%s'", dir_name);
- if (!(flags & LIBREPORT_WAIT))
+ if (flags & LIBREPORT_NOWAIT)
flags |= LIBREPORT_DEL_DIR;
result = report_problem_in_dir(dir_name, flags);
diff -x '*.po' -d -urpN libreport.4/src/report-python/reportmodule.c libreport.5/src/report-python/reportmodule.c
--- libreport.4/src/report-python/reportmodule.c 2011-07-19 11:48:22.000000000 +0200
+++ libreport.5/src/report-python/reportmodule.c 2011-07-21 09:22:11.027762251 +0200
@@ -90,6 +90,7 @@ init_pyreport(void)
/* for include/report/report.h */
PyModule_AddObject(m, "LIBREPORT_NOWAIT" , Py_BuildValue("i", LIBREPORT_NOWAIT ));
PyModule_AddObject(m, "LIBREPORT_WAIT" , Py_BuildValue("i", LIBREPORT_WAIT ));
+ PyModule_AddObject(m, "LIBREPORT_GETPID" , Py_BuildValue("i", LIBREPORT_GETPID ));
PyModule_AddObject(m, "LIBREPORT_ANALYZE" , Py_BuildValue("i", LIBREPORT_ANALYZE ));
PyModule_AddObject(m, "LIBREPORT_RELOAD_DATA", Py_BuildValue("i", LIBREPORT_RELOAD_DATA));
PyModule_AddObject(m, "LIBREPORT_DEL_DIR" , Py_BuildValue("i", LIBREPORT_DEL_DIR ));
12 years, 9 months
[PATCH 1/2] [abrt] bring back to live abrt-cli
by Nikola Pajkovsky
getting infos about crash, deleting dump dirs and invoking reporting belongs to
abrt.git (abrt-gui does it too)
abrt-cli uses commands now instead of switches for main purpose like deleting,
reporting and getting information about crash.
second steps will be to add aliases for commands. If aliases won't be set for
commands, then abbreviation for commands comes to play.
Usage string for abrt-cli:
abrt-cli [--version] [--base-dir=DUMP_DIR] <command> [<args>]
--base-dir - change base dir for dump directories
--version - print out version and die
commands are:
list
rm
report
Each command can take it's own arguments.
list command
------------
Usage: abrt-cli list [options] [<dump-dir>]...
-v, --verbose Be verbose
-f, --full List even reported problems
-d, --detailed Show detailed report
Maybe option --detail is better then --detailed
rm command
----------
Usage: abrt-cli rm [options] [<dump-dir>]...
-v, --verbose Be verbose
note that you can do abrt-cli rm /path/to/base/dir/cpp-* so wildcard is working
out of box
report command
--------------
Usage: abrt-cli report [options] [<dump-dir>]...
-v, --verbose Be verbose
simply invoke report_problem_in_dir
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
.gitignore | 1 +
abrt.spec.in | 4 +-
configure.ac | 1 +
src/Makefile.am | 2 +-
src/cli/Makefile.am | 25 ++++++
src/cli/abrt-cli.c | 146 ++++++++++++++++++++++++++++++++++
src/cli/builtin-cmd.h | 27 +++++++
src/cli/list.c | 206 +++++++++++++++++++++++++++++++++++++++++++++++++
src/cli/report.c | 45 +++++++++++
src/cli/rm.c | 53 +++++++++++++
10 files changed, 507 insertions(+), 3 deletions(-)
create mode 100644 src/cli/Makefile.am
create mode 100644 src/cli/abrt-cli.c
create mode 100644 src/cli/builtin-cmd.h
create mode 100644 src/cli/list.c
create mode 100644 src/cli/report.c
create mode 100644 src/cli/rm.c
diff --git a/.gitignore b/.gitignore
index 745cb02..a60e543 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@ src/hooks/abrt_exception_handler.py
src/hooks/abrt-hook-ccpp
src/applet/abrt-applet.desktop
src/gui-gtk/abrt.desktop
+src/cli/abrt-cli
# cscope files
cscope.*
diff --git a/abrt.spec.in b/abrt.spec.in
index 00e37d4..3334b70 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -185,8 +185,6 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/abrt-di
mkdir -p $RPM_BUILD_ROOT/var/run/abrt
mkdir -p $RPM_BUILD_ROOT/var/spool/abrt
mkdir -p $RPM_BUILD_ROOT/var/spool/abrt-upload
-# compat before we split abrt-cli and report-cli
-ln -s %{_bindir}/report-cli $RPM_BUILD_ROOT/%{_bindir}/abrt-cli
desktop-file-install \
--dir ${RPM_BUILD_ROOT}%{_datadir}/applications \
@@ -429,6 +427,8 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files cli
%defattr(-,root,root,-)
%{_bindir}/abrt-cli
+# provide asap
+#% {_mandir}/man1/report-cli.1.gz
%files desktop
%defattr(-,root,root,-)
diff --git a/configure.ac b/configure.ac
index 1726093..8de55d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,6 +138,7 @@ AC_CONFIG_FILES([
src/hooks/Makefile
src/applet/Makefile
src/gui-gtk/Makefile
+ src/cli/Makefile
po/Makefile.in
icons/Makefile
])
diff --git a/src/Makefile.am b/src/Makefile.am
index b41b939..ab95ef7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1 +1 @@
-SUBDIRS = include lib hooks daemon applet gui-gtk plugins
+SUBDIRS = include lib hooks daemon applet gui-gtk plugins cli
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am
new file mode 100644
index 0000000..c5ebc14
--- /dev/null
+++ b/src/cli/Makefile.am
@@ -0,0 +1,25 @@
+-include ../../config.mak
+
+bin_PROGRAMS = abrt-cli
+
+CLI_C =
+CLI_C += abrt-cli.c
+
+BUILTIN_C =
+BUILTIN_C += list.c
+BUILTIN_C += rm.c
+BUILTIN_C += report.c
+
+abrt_cli_SOURCES = $(CLI_C) $(BUILTIN_C) builtin-cmd.h
+
+abrt_cli_CFLAGS = \
+ -I$(srcdir)/../include \
+ -I$(srcdir)/../lib \
+ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \
+ $(LIBREPORT_CFLAGS) \
+ -Wwrite-strings -Werror
+
+abrt_cli_LDADD = \
+ $(LIBREPORT_LIBS)
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
diff --git a/src/cli/abrt-cli.c b/src/cli/abrt-cli.c
new file mode 100644
index 0000000..79d17bb
--- /dev/null
+++ b/src/cli/abrt-cli.c
@@ -0,0 +1,146 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "abrtlib.h"
+#include "builtin-cmd.h"
+
+#define USAGE_OPTS_WIDTH 12
+#define USAGE_GAP 2
+
+/* TODO: add --pager(default) and --no-pager */
+
+/* better way to set <base-dir> as environ variable? */
+GList *D_list = NULL;
+
+const char abrt_cli_usage_string[] =
+ "abrt-cli [--version] [--base-dir=DUMP_DIR] <command> [<args>]";
+
+struct cmd_struct {
+ const char *cmd;
+ int (*fn)(int, const char **);
+ const char *help;
+};
+
+static void list_cmds_help(const struct cmd_struct *commands)
+{
+ for (const struct cmd_struct *p = commands; p->cmd; ++p)
+ {
+ size_t pos;
+ int pad;
+
+ pos = fprintf(stderr, " ");
+ pos += fprintf(stderr, "%s", p->cmd);
+
+ if (pos <= USAGE_OPTS_WIDTH)
+ pad = USAGE_OPTS_WIDTH - pos;
+ else
+ {
+ fputc('\n', stderr);
+ pad = USAGE_OPTS_WIDTH;
+ }
+
+ fprintf(stderr, "%*s%s\n", pad + USAGE_GAP, "", p->help);
+ }
+}
+
+static void handle_internal_options(int *argc, const char ***argv)
+{
+ while (*argc > 0)
+ {
+ const char *cmd = (*argv)[0];
+ if (cmd[0] != '-')
+ break;
+
+ if (strcmp(cmd, "--version") == 0)
+ {
+ puts(PACKAGE_VERSION);
+ exit(0);
+ }
+ else if (prefixcmp(cmd, "--base-dir=") == 0)
+ D_list = g_list_append(D_list, xstrdup(cmd + strlen("--base-dir=")));
+#if 0
+ else if (prefixcmp(cmd, "--list-events") == 0)
+ {
+ const char *pfx = cmd + strlen("--list-events");
+ if (pfx && *pfx)
+ pfx += 1; /* skip '=' */
+
+ char *events = list_possible_events(NULL, dump_dir_name, pfx);
+ if (!events)
+ exit(1); /* error msg is already logged */
+
+ fputs(events, stdout);
+ free(events);
+
+ exit(0);
+ }
+#endif
+ else
+ error_msg_and_die("usage: %s", abrt_cli_usage_string);
+
+ (*argv)++;
+ (*argc)--;
+ }
+}
+
+static void handle_internal_command(int argc, const char **argv,
+ const struct cmd_struct *commands)
+{
+ const char *cmd = argv[0];
+
+ for (const struct cmd_struct *p = commands; p->cmd; ++p)
+ {
+ if (strcmp(p->cmd, cmd))
+ continue;
+
+ exit(p->fn(argc, argv));
+ }
+}
+
+int main(int argc, const char **argv)
+{
+ abrt_init((char **)argv);
+
+ setlocale(LC_ALL, "");
+#if ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
+ argv++;
+ argc--;
+
+ const struct cmd_struct commands[] = {
+ {"list", cmd_list, _("List not yet reported problems")},
+ {"rm", cmd_rm, _("Remove files from problem directory")},
+ {"report", cmd_report, _("Analyze and report problem data in problem directory")},
+ {NULL, NULL, NULL}
+ };
+
+ handle_internal_options(&argc, &argv);
+ if (argc > 0)
+ handle_internal_command(argc, argv, commands);
+
+ /* user didn't specify command; print out help */
+ printf("%s\n\n", abrt_cli_usage_string);
+ list_cmds_help(commands);
+ printf("\n%s\n", _("See 'abrt-cli <command> -h' for more information"));
+
+ return 0;
+}
diff --git a/src/cli/builtin-cmd.h b/src/cli/builtin-cmd.h
new file mode 100644
index 0000000..28aa753
--- /dev/null
+++ b/src/cli/builtin-cmd.h
@@ -0,0 +1,27 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef _BUILTIN_CMD_H_
+#define _BUILTIN_CMD_H_
+
+extern int cmd_list(int argc, const char **argv);
+extern int cmd_rm(int argc, const char **argv);
+extern int cmd_report(int argc, const char **argv);
+
+#endif /* _BUILTIN-CMD_H_ */
diff --git a/src/cli/list.c b/src/cli/list.c
new file mode 100644
index 0000000..bdb371f
--- /dev/null
+++ b/src/cli/list.c
@@ -0,0 +1,206 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "abrtlib.h"
+#include "builtin-cmd.h"
+
+extern GList *D_list;
+
+/* TODO: npajkovs
+ * add --since
+ * add --until
+ * add --pretty=oneline|raw|normal|format="%a %b %c"
+ * add wildcard e.g. *-2011-04-01-10-* (list all problems in specific day)
+ *
+ * TODO?: remove base dir from list of crashes? is there a way that same crash can be in
+ * ~/.abrt/spool and /var/spool/abrt? needs more _meditation_.
+ */
+
+/* Vector of problems: */
+/* problem_data_vector[i] = { "name" = { "content", CD_FLAG_foo_bits } } */
+typedef GPtrArray vector_of_problem_data_t;
+
+static inline problem_data_t *get_problem_data(vector_of_problem_data_t *vector, unsigned i)
+{
+ return (problem_data_t *)g_ptr_array_index(vector, i);
+}
+
+static void free_vector_of_problem_data(vector_of_problem_data_t *vector)
+{
+ if (vector)
+ g_ptr_array_free(vector, TRUE);
+}
+
+static vector_of_problem_data_t *new_vector_of_problem_data(void)
+{
+ return g_ptr_array_new_with_free_func((void (*)(void*)) &free_problem_data);
+}
+
+static problem_data_t *fill_crash_info(const char *dump_dir_name)
+{
+ int sv_logmode = logmode;
+ logmode = 0; /* suppress EPERM/EACCES errors in opendir */
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ DD_OPEN_READONLY);
+ logmode = sv_logmode;
+
+ if (!dd)
+ return NULL;
+
+ problem_data_t *problem_data = create_problem_data_from_dump_dir(dd);
+ dd_close(dd);
+ add_to_problem_data_ext(problem_data, CD_DUMPDIR, dump_dir_name,
+ CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE + CD_FLAG_LIST);
+
+ return problem_data;
+}
+
+static void get_all_crash_infos(vector_of_problem_data_t *retval, const char *dir_name)
+{
+ VERB1 log("Loading dumps from '%s'", dir_name);
+
+ DIR *dir = opendir(dir_name);
+ if (dir != NULL)
+ {
+ struct dirent *dent;
+ while ((dent = readdir(dir)) != NULL)
+ {
+ if (dot_or_dotdot(dent->d_name))
+ continue; /* skip "." and ".." */
+
+ char *dump_dir_name = concat_path_file(dir_name, dent->d_name);
+
+ struct stat statbuf;
+ if (stat(dump_dir_name, &statbuf) == 0
+ && S_ISDIR(statbuf.st_mode))
+ {
+ problem_data_t *problem_data = fill_crash_info(dump_dir_name);
+ if (problem_data)
+ g_ptr_array_add(retval, problem_data);
+ }
+ free(dump_dir_name);
+ }
+ closedir(dir);
+ }
+}
+
+/** Prints basic information about a crash to stdout. */
+static void print_crash(problem_data_t *problem_data, int detailed)
+{
+ char *desc;
+ if (detailed)
+ {
+ int show_multiline = (detailed ? MAKEDESC_SHOW_MULTILINE : 0);
+ desc = make_description(problem_data,
+ /*names_to_skip:*/ NULL,
+ /*max_text_size:*/ CD_TEXT_ATT_SIZE,
+ MAKEDESC_SHOW_FILES | show_multiline);
+ }
+ else
+ {
+ desc = make_description(problem_data,
+ /*names_to_skip:*/ NULL,
+ /*max_text_size:*/ CD_TEXT_ATT_SIZE,
+ MAKEDESC_SHOW_ONLY_LIST);
+ }
+ fputs(desc, stdout);
+ free(desc);
+}
+
+/**
+ * Prints a list containing "crashes" to stdout.
+ * @param include_reported
+ * Do not skip entries marked as already reported.
+ */
+static void print_crash_list(vector_of_problem_data_t *crash_list, int include_reported,
+ int detailed)
+{
+ unsigned i;
+ for (i = 0; i < crash_list->len; ++i)
+ {
+ problem_data_t *crash = get_problem_data(crash_list, i);
+ if (!include_reported)
+ {
+ const char *msg = get_problem_item_content_or_NULL(crash, FILENAME_REPORTED_TO);
+ if (msg)
+ continue;
+ }
+ puts("");
+ print_crash(crash, detailed);
+ }
+}
+
+int cmd_list(int argc, const char **argv)
+{
+ const char *program_usage_string = _(
+ "\b list [options] [<dump-dir>]..."
+ );
+
+ static int opt_full, opt_detailed;
+ struct options program_options[] = {
+ OPT__VERBOSE(&g_verbose),
+ OPT_GROUP(""),
+ OPT_BOOL('f', "full" , &opt_full, _("List even reported problems")),
+ /* deprecate -d option with --pretty=full*/
+ OPT_BOOL('d', "detailed" , &opt_detailed, _("Show detailed report")),
+ OPT_END()
+ };
+
+ parse_opts(argc, (char **)argv, program_options, program_usage_string);
+
+ if (optind < argc)
+ {
+ while (optind < argc)
+ {
+ problem_data_t *problem = fill_crash_info(argv[optind++]);
+ print_crash(problem, opt_detailed);
+ free_problem_data(problem);
+ printf("\n");
+ }
+ exit(0);
+ }
+
+ if (!D_list)
+ {
+ char *home = getenv("HOME");
+ if (home)
+ D_list = g_list_append(D_list, concat_path_file(home, ".abrt/spool"));
+ D_list = g_list_append(D_list, xstrdup((void*)DEBUG_DUMPS_DIR));
+ }
+
+ VERB2
+ {
+ log("Base directory");
+ for (GList *li = D_list; li; li = li->next)
+ log("\t %s", (char *) li->data);
+ }
+
+ vector_of_problem_data_t *ci = new_vector_of_problem_data();
+ while (D_list)
+ {
+ char *dir = (char *)D_list->data;
+ get_all_crash_infos(ci, dir);
+ D_list = g_list_remove(D_list, dir);
+ free(dir);
+ }
+ print_crash_list(ci, opt_full, opt_detailed);
+ free_vector_of_problem_data(ci);
+ g_list_free(D_list);
+
+ return 0;
+}
diff --git a/src/cli/report.c b/src/cli/report.c
new file mode 100644
index 0000000..8d9f006
--- /dev/null
+++ b/src/cli/report.c
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "abrtlib.h"
+#include "builtin-cmd.h"
+
+int cmd_report(int argc, const char **argv)
+{
+ const char *program_usage_string = _(
+ "\b report [options] [<dump-dir>]..."
+ );
+
+ struct options program_options[] = {
+ OPT__VERBOSE(&g_verbose),
+ OPT_END()
+ };
+
+ parse_opts(argc, (char **)argv, program_options, program_usage_string);
+ if (optind < argc)
+ {
+ while (optind < argc)
+ {
+ report_problem_in_dir(argv[optind++], LIBREPORT_ANALYZE | LIBREPORT_NOWAIT);
+ log("report '%s'", argv[optind++]);
+ }
+ }
+
+ return 0;
+}
diff --git a/src/cli/rm.c b/src/cli/rm.c
new file mode 100644
index 0000000..eac01af
--- /dev/null
+++ b/src/cli/rm.c
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2011 ABRT Team
+ Copyright (C) 2011 RedHat inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "abrtlib.h"
+#include "builtin-cmd.h"
+
+/* TODO npajkovs:
+ * add -n, --dry-run
+ * add -q, --quite
+ */
+
+int cmd_rm(int argc, const char **argv)
+{
+ const char *program_usage_string = _(
+ "\b rm [options] [<dump-dir>]..."
+ );
+
+ struct options program_options[] = {
+ OPT__VERBOSE(&g_verbose),
+ OPT_END()
+ };
+
+ parse_opts(argc, (char **)argv, program_options, program_usage_string);
+ if (optind < argc)
+ {
+ int status;
+ while (optind < argc)
+ {
+ const char *rm_dir = argv[optind++];
+ status = delete_dump_dir_possibly_using_abrtd(rm_dir);
+ if (!status)
+ log("rm '%s'", rm_dir);
+ }
+ }
+
+ return 0;
+}
--
1.7.6.233.gd79bc
12 years, 9 months
[PATCH] abrt-gui: fix date column
by Martin Milata
The "Last occurence" column in abrt-gui showed month twice and no day.
---
src/gui-gtk/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index b62e8c0..732eed8 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -67,7 +67,7 @@ static void add_directory_to_dirlist(const char *dirname)
{
time_t t = strtol(time_str, NULL, 10); /* atoi won't work past 2038! */
struct tm *ptm = localtime(&t);
- size_t time_len = strftime(time_buf, sizeof(time_buf)-1, "%Y-%m-%m %H:%M", ptm);
+ size_t time_len = strftime(time_buf, sizeof(time_buf)-1, "%Y-%m-%d %H:%M", ptm);
time_buf[time_len] = '\0';
}
free(time_str);
--
1.7.6
12 years, 9 months
[PATCH] Interactive plugins
by Michal Toman
The patch consists of two parts:
1) Libreport - Handling messages in CLI and GUI
2) ABRT - example usage in abrt-retrace-client
Please review and comment
Michal
12 years, 9 months
Fwd: [2011-07-14] [FAIL] ABRT testsuite report
by Michal Nowak
This is a report from test suite being run on today's 12 o'clock Git.
----- Forwarded Message -----
From: abrt-testsuite-bot(a)example.com
To: mnowak(a)redhat.com
Sent: Thursday, July 14, 2011 12:12:05 PM
Subject: [2011-07-14] [FAIL] ABRT testsuite report
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : cNtfDXO
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 11:50:56 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:03:22 CEST
:: [ LOG ] :: Test name : abrt-nightly-build
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Cannot find the PURPOSE file of this test. Could be a missing, or
rlInitializeJournal wasn't called from appropriate location
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Kernel version: 2.6.38.8-35.fc15.x86_64
:: [ PASS ] :: Build libreport RPMs
:: [ PASS ] :: Clone abrt.git
:: [ LOG ] :: Duration: 3m 40s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Build ABRT
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running './autogen.sh'
:: [ PASS ] :: Configure
:: [ PASS ] :: Build ABRT in Mock
:: [ PASS ] :: Running 'make'
:: [ PASS ] :: Running 'make install'
:: [ LOG ] :: Duration: 8m 45s
:: [ LOG ] :: Assertions: 5 good, 0 bad
:: [ PASS ] :: RESULT: Build ABRT
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : MhvENAC
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:03:28 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:05:41 CEST
:: [ LOG ] :: Test name : abrt-make-check
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Cannot find the PURPOSE file of this test. Could be a missing, or
rlInitializeJournal wasn't called from appropriate location
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Kernel version: 2.6.38.8-35.fc15.x86_64
:: [ PASS ] :: Running 'yum install -y git yum-utils rpm-build libtool intltool btparser-devel make'
:: [ PASS ] :: Clone abrt.git
:: [ PASS ] :: Autogen
:: [ PASS ] :: Configure
:: [ PASS ] :: Build
:: [ LOG ] :: Duration: 1m 43s
:: [ LOG ] :: Assertions: 5 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Make check (Expected 0, got 2)
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 1 bad
:: [ FAIL ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Duration: 29s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : 8UEmCkP
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:06:04 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:06:14 CEST
:: [ LOG ] :: Test name : blacklisted-package
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of blacklisted-package
Description: tests if blacklisted package is not being catched by abrt
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Blacklisted packages: BlackList = nspluginwrapper,valgrind,strace
:: [ PASS ] :: File '/tmp/blacklisted.abrt' should contain 'strace'
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 1 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: strace process was killed with signal 11
:: [ PASS ] :: No strace in report-cli output
:: [ LOG ] :: Duration: 10s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : a4UhCb5
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:06:20 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:06:43 CEST
:: [ LOG ] :: Test name : btparser-make-check
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Cannot find the PURPOSE file of this test. Could be a missing, or
rlInitializeJournal wasn't called from appropriate location
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Kernel version: 2.6.38.8-35.fc15.x86_64
:: [ LOG ] :: Duration: 14s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Make check
:: [ LOG ] :: Duration: 9s
:: [ LOG ] :: Assertions: 1 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : KhP4JFo
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:06:49 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:08:51 CEST
:: [ LOG ] :: Test name : bz591504-sparse-core-files-performance-hit
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of bz591504-sparse-core-files-performance-hit
Description: test sparse core files performance hit
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Creating tmp directory
:: [ PASS ] :: Running 'pushd /tmp/tmp.7qQCkuSoEd'
:: [ LOG ] :: Duration: 1m 52s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running '/usr/bin/time -f '%e' -o bigcore-stop.time.1 runtest gdb.base/bigcore.exp'
:: [ PASS ] :: Running '/usr/bin/time -f '%e' -o bigcore-stop.time.2 runtest gdb.base/bigcore.exp'
:: [ PASS ] :: Running '/usr/bin/time -f '%e' -o bigcore-stop.time.3 runtest gdb.base/bigcore.exp'
:: [ LOG ] :: Runnning runtest gdb.base/bigcore.exp, with 0 seconds timeout
:: [ LOG ] :: Command ended itself, I am not killing it.
:: [ PASS ] :: runtest gdb.base/bigcore.exp performed fine
:: [ LOG ] :: Runnning runtest gdb.base/bigcore.exp, with 0 seconds timeout
:: [ LOG ] :: Command ended itself, I am not killing it.
:: [ PASS ] :: runtest gdb.base/bigcore.exp performed fine
:: [ LOG ] :: Runnning runtest gdb.base/bigcore.exp, with 0 seconds timeout
:: [ LOG ] :: Command ended itself, I am not killing it.
:: [ PASS ] :: runtest gdb.base/bigcore.exp performed fine
:: [ LOG ] :: Duration: 10s
:: [ LOG ] :: Assertions: 6 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Removing tmp directory
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 3 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : G9dryuZ
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:08:57 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:08:58 CEST
:: [ LOG ] :: Test name : bz618602-core_pattern-handler-truncates-parameters
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of bz618602-core_pattern-handler-truncates-parameters
Description: Tests max size of core_pattern
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Uninstall ABRT CCPP hook
:: [ LOG ] :: Former core_pattern was: core
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 1 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Set core_pattern to long garbage
:: [ FAIL ] :: core_pattern length should be >= 127 (Assert: "87" should be >= "127")
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 1 good, 1 bad
:: [ FAIL ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : wqJ3txS
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:09:03 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:09:06 CEST
:: [ LOG ] :: Test name : bz623142-abrt-should-not-report-bugs-against-systems-with-TAINT_HARDWARE_UNSUPPORTED-set
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of
bz623142-abrt-should-not-report-bugs-against-systems-with-TAINT_HARDWARE_UNSUPPORTED-set
Description: abrt should not report bugs against systems with
TAINT_HARDWARE_UNSUPPORTED set
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Creating tmp directory
:: [ PASS ] :: Extract file taint.tar
:: [ PASS ] :: Running 'pushd /tmp/tmp.iMVuwekIiP/taint'
:: [ PASS ] :: Build taint.ko
:: [ PASS ] :: File taint.ko should exist
:: [ PASS ] :: Kernel is not tained
:: [ LOG ] :: Duration: 2s
:: [ LOG ] :: Assertions: 6 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Loaded taint.ko
:: [ PASS ] :: taint.ko is loaded
:: [ PASS ] :: tainted is set to non-zero (1)
:: [ PASS ] :: Loaded taint.ko
:: [ INFO ] :: You should now restart this machine to ged rid of tained kernel
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 4 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Removing tmp directory
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : 4ujj3Yc
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:09:12 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:09:42 CEST
:: [ LOG ] :: Test name : bz636913-abrt-should-ignore-SystemExit-exception
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of bz636913-abrt-should-ignore-SystemExit-exception
Description: tests if abrt ignores SystemExit exception
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Crashes before our attempt: 0
:: [ PASS ] :: yum exits with SystemExit=1
:: [ LOG ] :: Crashes after our attempt: 0
:: [ PASS ] :: # of bugs before SystemExit=1 is the same after
:: [ LOG ] :: Duration: 30s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : DgTd2bg
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:09:48 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:09:58 CEST
:: [ LOG ] :: Test name : bz652338-removed-proc-PID
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of bz652338-removed-proc-PID
Description: Tests if abrt survives non-existent /proc/<PID>/ file
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Creating tmp directory
:: [ PASS ] :: Running 'pushd /tmp/tmp.xCOPAXUVj8'
:: [ PASS ] :: Set core_pipe_limit to 1 from previous 4
:: [ PASS ] :: Install locate & updatedb binaries
:: [ LOG ] :: Duration: 6s
:: [ LOG ] :: Assertions: 4 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Exec process #1
:: [ PASS ] :: Exec process #2
:: [ PASS ] :: List background jobs
:: [ PASS ] :: Kill process #1
:: [ PASS ] :: Kill process #2
:: [ PASS ] :: Running 'report-cli -l -f'
:: [ LOG ] :: var-log-messages output
:: [ PASS ] :: File 'var-log-messages' should contain 'Skipping core dump'
:: [ PASS ] :: abrt did not crashed
:: [ LOG ] ::
:: [ LOG ] :: Duration: 3s
:: [ LOG ] :: Assertions: 8 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Restore core_pipe_limit back to 4
:: [ LOG ] :: Bundling logs
:: [ INFO ] :: rlBundleLogs: Adding 'var-log-messages' as 'var-log-messages'
:: [ INFO ] :: Sending /tmp/abrt.__.tar.gz as tmp-abrt.__.tar.gz
:: [ LOG ] :: File '/tmp/tmp.85rbvGqG17/tmp-abrt.__.tar.gz' stored here: /tmp/BEAKERLIB_STORED_tmp-abrt.__.tar.gz
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Removing tmp directory
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 3 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : i9b5ACw
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:10:04 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:10:10 CEST
:: [ LOG ] :: Test name : cli-sanity
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of cli-sanity
Description: does sanity on abrt-cli
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --version
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running 'report-cli --version | grep 'report-cli''
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 1 good, 0 bad
:: [ PASS ] :: RESULT: --version
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --help
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Running 'report-cli --help' (Expected 0, got 1)
:: [ PASS ] :: Running 'report-cli --help 2>&1 | grep 'Usage: report-cli''
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 1 good, 1 bad
:: [ FAIL ] :: RESULT: --help
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --list
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Running 'report-cli -l | grep -i 'Executable'' (Expected 0, got 1)
:: [ FAIL ] :: Running 'report-cli -l | egrep -i 'Package.*bash|Package.*rpm'' (Expected 0, got 1)
:: [ LOG ] :: Duration: 4s
:: [ LOG ] :: Assertions: 0 good, 2 bad
:: [ FAIL ] :: RESULT: --list
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --list -f
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Running 'report-cli -l | grep -i 'Executable'' (Expected 0, got 1)
:: [ FAIL ] :: Running 'report-cli -l | egrep -i 'Package.*bash|Package.*rpm'' (Expected 0, got 1)
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 2 bad
:: [ FAIL ] :: RESULT: --list -f
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --report FAKEDIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Running 'report-cli --report FAKEDIR' (Expected 1, got 0)
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 0 good, 1 bad
:: [ FAIL ] :: RESULT: --report FAKEDIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --report always DIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: File 'output.out' should contain 'Email was sent to'
:: [ FAIL ] :: File 'output.out' should contain 'The report was appended to'
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 2 bad
:: [ FAIL ] :: RESULT: --report always DIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --delete FAKEDIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running 'report-cli --delete FAKEDIR'
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 1 good, 0 bad
:: [ PASS ] :: RESULT: --delete FAKEDIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: --delete DIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Running 'report-cli --delete ' (Expected 0, got 1)
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 0 good, 1 bad
:: [ FAIL ] :: RESULT: --delete DIR
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : LsExEnZ
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:10:15 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:10:17 CEST
:: [ LOG ] :: Test name : dumpoops
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of dumpoops
Description: looks for oops via dumpoops
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Creating tmp directory
:: [ PASS ] :: Running 'pushd /tmp/tmp.jurOvQvgPm/examples'
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: OOPS
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: [oops1.test] Found OOPS
:: [ PASS ] :: [oops2.test] Found OOPS
:: [ PASS ] :: [oops3.test] Found OOPS
:: [ PASS ] :: [oops4.test] Found OOPS
:: [ PASS ] :: [oops5.test] Found OOPS
:: [ PASS ] :: [oops6.test] Found OOPS
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 6 good, 0 bad
:: [ PASS ] :: RESULT: OOPS
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: not-OOPS
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: [not_oops1.test] Not found OOPS
:: [ PASS ] :: [not_oops2.test] Not found OOPS
:: [ PASS ] :: [not_oops3.test] Not found OOPS
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 3 good, 0 bad
:: [ PASS ] :: RESULT: not-OOPS
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Removing tmp directory
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : QP891U1
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:10:28 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:10:29 CEST
:: [ LOG ] :: Test name : localized-reporting
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of localized-reporting
Description: tests localized reporting via abrt-cli
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Creating tmp directory
:: [ PASS ] :: Running 'pushd /tmp/tmp.FUpImhW4Y0'
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ INFO ] ::
:: [ LOG ] :: DIR=
:: [ FAIL ] :: There were attempts to report the crash (Expected 0, got 1)
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 0 good, 1 bad
:: [ FAIL ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Bundling logs
:: [ INFO ] :: rlBundleLogs: Adding 'crash.log' as 'crash.log'
:: [ INFO ] :: Sending /tmp/crash.log.__.tar.gz as tmp-crash.log.__.tar.gz
:: [ LOG ] :: File '/tmp/tmp.5Lv5uztAEB/tmp-crash.log.__.tar.gz' stored here: /tmp/BEAKERLIB_STORED_tmp-crash.log.__.tar.gz
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Removing tmp directory
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : GpEoTVt
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:10:35 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:10:46 CEST
:: [ LOG ] :: Test name : mailx-reporting
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of mailx-reporting
Description: Tests Mailx
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Creating tmp directory
:: [ PASS ] :: Running 'pushd /tmp/tmp.5cUXtQ07bj'
:: [ LOG ] :: report-cli:
:: [ LOG ] :: PATH_D =
:: [ LOG ] :: Duration: 5s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Report via mailx (Expected 0, got 127)
:: [ FAIL ] :: File 'mail.out' should contain 'abrt@localhost'
:: [ LOG ] ::
:: [ LOG ] :: Duration: 6s
:: [ LOG ] :: Assertions: 0 good, 2 bad
:: [ FAIL ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Running 'popd'
:: [ PASS ] :: Removing tmp directory
:: [ FAIL ] :: Remove crash directory (Expected 0, got 1)
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 2 good, 1 bad
:: [ WARN ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : QxGwVuz
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:10:52 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:11:52 CEST
:: [ LOG ] :: Test name : run-abrtd
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of run-abrtd
Description: Starts abrtd
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Kernel version: 2.6.38.8-35.fc15.x86_64
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ PASS ] :: Start abrtd
:: [ INFO ] :: Zzz for 1 minute...
:: [ PASS ] :: abrtd runs after 1 minute
:: [ LOG ] :: Duration: 1m 0s
:: [ LOG ] :: Assertions: 2 good, 0 bad
:: [ PASS ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test run ID : XXT3pc5
:: [ LOG ] :: Package : abrt
:: [ LOG ] :: Test started : 2011-07-14 12:11:58 CEST
:: [ LOG ] :: Test finished : 2011-07-14 12:12:04 CEST
:: [ LOG ] :: Test name : verify-that-report-edits
:: [ LOG ] :: Distro: : Fedora release 15 (Lovelock)
:: [ LOG ] :: Hostname : localhost.localdomain
:: [ LOG ] :: Architecture : x86_64
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PURPOSE of verify-that-report-edits
Description: Make sure manual edits to reports actually make it into submitted
data.
Author: Michal Nowak <mnowak(a)redhat.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Duration: 5s
:: [ LOG ] :: Assertions: 0 good, 0 bad
:: [ PASS ] :: RESULT: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: PATH=
:: [ FAIL ] :: File 'out' should contain 'The report has been updated'
:: [ LOG ] :: smart_quote=Program was bored so exited
:: [ FAIL ] :: rlAssertGrep: failed to find file /tmp/abrt.log
:: [ LOG ] :: Duration: 1s
:: [ LOG ] :: Assertions: 0 good, 2 bad
:: [ FAIL ] :: RESULT: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ LOG ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [ FAIL ] :: Delete (Expected 0, got 1)
:: [ LOG ] :: Duration: 0s
:: [ LOG ] :: Assertions: 0 good, 1 bad
:: [ WARN ] :: RESULT: Cleanup
12 years, 9 months
[PATCH] [libreport] move code to abrt git
by Nikola Pajkovsky
code belongs to abrt.git. Getting infos about crash, deleting dump dirs
and invoking reporting belogs to abrt (abrt-gui doest it too)
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/cli/cli.c | 201 ++++-----------------------------------------------------
1 files changed, 12 insertions(+), 189 deletions(-)
diff --git a/src/cli/cli.c b/src/cli/cli.c
index 662b704..caec07f 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -23,126 +23,6 @@
#include "internal_libreport.h"
#include "cli-report.h"
-
-/* Vector of problems: */
-/* problem_data_vector[i] = { "name" = { "content", CD_FLAG_foo_bits } } */
-
-typedef GPtrArray vector_of_problem_data_t;
-
-static inline problem_data_t *get_problem_data(vector_of_problem_data_t *vector, unsigned i)
-{
- return (problem_data_t *)g_ptr_array_index(vector, i);
-}
-
-static void free_vector_of_problem_data(vector_of_problem_data_t *vector)
-{
- if (vector)
- g_ptr_array_free(vector, TRUE);
-}
-
-static vector_of_problem_data_t *new_vector_of_problem_data(void)
-{
- return g_ptr_array_new_with_free_func((void (*)(void*)) &free_problem_data);
-}
-
-
-static problem_data_t *FillCrashInfo(const char *dump_dir_name)
-{
- int sv_logmode = logmode;
- logmode = 0; /* suppress EPERM/EACCES errors in opendir */
- struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ DD_OPEN_READONLY);
- logmode = sv_logmode;
-
- if (!dd)
- return NULL;
-
- problem_data_t *problem_data = create_problem_data_from_dump_dir(dd);
- dd_close(dd);
- add_to_problem_data_ext(problem_data, CD_DUMPDIR, dump_dir_name, CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE + CD_FLAG_LIST);
-
- return problem_data;
-}
-
-static void GetCrashInfos(vector_of_problem_data_t *retval, const char *dir_name)
-{
- VERB1 log("Loading dumps from '%s'", dir_name);
-
- DIR *dir = opendir(dir_name);
- if (dir != NULL)
- {
- struct dirent *dent;
- while ((dent = readdir(dir)) != NULL)
- {
- if (dot_or_dotdot(dent->d_name))
- continue; /* skip "." and ".." */
-
- char *dump_dir_name = concat_path_file(dir_name, dent->d_name);
-
- struct stat statbuf;
- if (stat(dump_dir_name, &statbuf) == 0
- && S_ISDIR(statbuf.st_mode)
- ) {
- problem_data_t *problem_data = FillCrashInfo(dump_dir_name);
- if (problem_data)
- g_ptr_array_add(retval, problem_data);
- }
- free(dump_dir_name);
- }
- closedir(dir);
- }
-}
-
-/** Prints basic information about a crash to stdout. */
-static void print_crash(problem_data_t *problem_data)
-{
- char* desc = make_description(
- problem_data,
- /*names_to_skip:*/ NULL,
- /*max_text_size:*/ CD_TEXT_ATT_SIZE,
- MAKEDESC_SHOW_ONLY_LIST
- );
- fputs(desc, stdout);
- free(desc);
-}
-
-/**
- * Prints a list containing "crashes" to stdout.
- * @param include_reported
- * Do not skip entries marked as already reported.
- */
-static void print_crash_list(vector_of_problem_data_t *crash_list, bool include_reported)
-{
- unsigned i;
- for (i = 0; i < crash_list->len; ++i)
- {
- problem_data_t *crash = get_problem_data(crash_list, i);
- if (!include_reported)
- {
- const char *msg = get_problem_item_content_or_NULL(crash, FILENAME_REPORTED_TO);
- if (msg)
- continue;
- }
-
- printf("%u.\n", i);
- print_crash(crash);
- }
-}
-
-/**
- * Prints full information about a crash
- */
-static void print_crash_info(problem_data_t *problem_data, bool show_multiline)
-{
- char* desc = make_description(
- problem_data,
- /*names_to_skip:*/ NULL,
- /*max_text_size:*/ CD_TEXT_ATT_SIZE,
- MAKEDESC_SHOW_FILES | (show_multiline ? MAKEDESC_SHOW_MULTILINE : 0)
- );
- fputs(desc, stdout);
- free(desc);
-}
-
static char *do_log(char *log_line, void *param)
{
log("%s", log_line);
@@ -165,8 +45,6 @@ int main(int argc, char** argv)
/* Can't keep these strings/structs static: _() doesn't support that */
const char *program_usage_string = _(
- "\b [-vsp] -l[f] [-D BASE_DIR]...\n"
- "or: \b [-vsp] -i[f] DUMP_DIR\n"
"or: \b [-vsp] -L[PREFIX] [DUMP_DIR]\n"
"or: \b [-vsp] -e EVENT DUMP_DIR\n"
"or: \b [-vsp] -a[y] DUMP_DIR\n"
@@ -174,37 +52,27 @@ int main(int argc, char** argv)
"or: \b [-vsp] -d DUMP_DIR"
);
enum {
- OPT_list = 1 << 0,
- OPT_D = 1 << 1,
- OPT_info = 1 << 2,
- OPT_list_events = 1 << 3,
- OPT_run_event = 1 << 4,
- OPT_analyze = 1 << 5,
- OPT_report = 1 << 6,
- OPT_delete = 1 << 7,
- OPT_version = 1 << 8,
- OPTMASK_op = OPT_list|OPT_info|OPT_list_events|OPT_run_event|OPT_analyze|OPT_report|OPT_delete|OPT_version,
- OPTMASK_need_arg = OPT_info|OPT_run_event|OPT_analyze|OPT_report|OPT_delete,
- OPT_f = 1 << 9,
- OPT_y = 1 << 10,
- OPT_o = 1 << 11,
- OPT_v = 1 << 12,
- OPT_s = 1 << 13,
- OPT_p = 1 << 14,
+ OPT_list_events = 1 << 0,
+ OPT_run_event = 1 << 1,
+ OPT_analyze = 1 << 2,
+ OPT_report = 1 << 3,
+ OPT_version = 1 << 4,
+ OPTMASK_op = OPT_list_events|OPT_run_event|OPT_analyze|OPT_report|OPT_version,
+ OPTMASK_need_arg = OPT_run_event|OPT_analyze|OPT_report,
+ OPT_y = 1 << 5,
+ OPT_o = 1 << 6,
+ OPT_v = 1 << 7,
+ OPT_s = 1 << 8,
+ OPT_p = 1 << 9,
};
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
/* short_name long_name value parameter_name help */
- OPT_BOOL( 'l', "list" , NULL, _("List not yet reported problems, or all with -f")),
- OPT_LIST( 'D', NULL , &D_list, "BASE_DIR", _("Directory to list problems from (default: -D $HOME/.abrt/spool -D "DEBUG_DUMPS_DIR")")),
- OPT_BOOL( 'i', "info" , NULL, _("Print information about DUMP_DIR (detailed with -f)")),
OPT_OPTSTRING('L', NULL , &pfx, "PREFIX", _("List possible events [which start with PREFIX]")),
OPT_STRING( 'e', NULL , &event_name, "EVENT", _("Run EVENT on DUMP_DIR")),
OPT_BOOL( 'a', "analyze", NULL, _("Run analyze event(s) on DUMP_DIR")),
OPT_BOOL( 'r', "report" , NULL, _("Analyze and report problem data in DUMP_DIR")),
- OPT_BOOL( 'd', "delete" , NULL, _("Remove DUMP_DIR")),
OPT_BOOL( 'V', "version", NULL, _("Display version and exit")),
- OPT_BOOL( 'f', "full" , NULL, _("Full listing")),
OPT_BOOL( 'y', "always" , NULL, _("Noninteractive: don't ask questions, assume 'yes'")),
OPT_BOOL( 'o', "report-only" , NULL, _("With -r: do not run analyzers, run only reporters")),
OPT__VERBOSE(&g_verbose),
@@ -244,18 +112,9 @@ int main(int argc, char** argv)
}
char *dump_dir_name = argv[0];
- bool full = (opts & OPT_f);
bool always = (opts & OPT_y);
bool report_only = (opts & OPT_o);
- if (!D_list)
- {
- char *home = getenv("HOME");
- if (home)
- D_list = g_list_append(D_list, concat_path_file(home, ".abrt/spool"));
- D_list = g_list_append(D_list, (void*)DEBUG_DUMPS_DIR);
- }
-
/* Get settings */
load_event_config_data();
@@ -263,19 +122,6 @@ int main(int argc, char** argv)
int exitcode = 0;
switch (op)
{
- case OPT_list:
- {
- vector_of_problem_data_t *ci = new_vector_of_problem_data();
- while (D_list)
- {
- char *dir = (char *)D_list->data;
- GetCrashInfos(ci, dir);
- D_list = g_list_remove(D_list, dir);
- }
- print_crash_list(ci, full);
- free_vector_of_problem_data(ci);
- break;
- }
case OPT_list_events: /* -L[PREFIX] */
{
/* Note that dump_dir_name may be NULL here, it means "show all
@@ -345,29 +191,6 @@ int main(int argc, char** argv)
error_msg_and_die("Crash '%s' not found", dump_dir_name);
break;
}
- case OPT_delete:
- {
- exitcode = delete_dump_dir_possibly_using_abrtd(dump_dir_name);
- break;
- }
- case OPT_info:
- {
- /* Load problem_data from dump dir */
- struct dump_dir *dd = dd_opendir(dump_dir_name, DD_OPEN_READONLY);
- if (!dd)
- return -1;
-
- problem_data_t *problem_data = create_problem_data_from_dump_dir(dd);
- dd_close(dd);
-
- add_to_problem_data_ext(problem_data, CD_DUMPDIR, dump_dir_name,
- CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE);
-
- print_crash_info(problem_data, full);
- free_problem_data(problem_data);
-
- break;
- }
}
return exitcode;
--
1.7.6.49.g033c2
12 years, 9 months
[PATCH 1/6] [abrt] rhbz671354 - [RFE] Configurable core dump location
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/daemon/abrt.conf | 2 ++
src/hooks/abrt-install-ccpp-hook | 14 ++++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf
index c9a4333..94672e2 100644
--- a/src/daemon/abrt.conf
+++ b/src/daemon/abrt.conf
@@ -8,3 +8,5 @@
# Max size for crash storage [MiB] or 0 for unlimited
#
MaxCrashReportsSize = 1000
+
+DumpLocation = /var/spool/abrt
diff --git a/src/hooks/abrt-install-ccpp-hook b/src/hooks/abrt-install-ccpp-hook
index 12a443f..a245aa2 100755
--- a/src/hooks/abrt-install-ccpp-hook
+++ b/src/hooks/abrt-install-ccpp-hook
@@ -6,14 +6,24 @@
dry_run=false
verbose=false
+DEFAULT_LOCATION=/var/spool/abrt
+
+DUMP_LOCATION=`cat /etc/abrt/abrt.conf | grep '^[ ]*DumpLocation'`
+DUMP_LOCATION=${DUMP_LOCATION#*DumpLocation*=}
+DUMP_LOCATION=${DUMP_LOCATION// /}
+
+if [ "$DUMP_LOCATION" = "" ]; then
+ DUMP_LOCATION=$DEFAULT_LOCATION
+fi
+
PATTERN_FILE="/proc/sys/kernel/core_pattern"
SAVED_PATTERN_DIR="/var/run/abrt"
SAVED_PATTERN_FILE="/var/run/abrt/saved_core_pattern"
HOOK_BIN="/usr/libexec/abrt-hook-ccpp"
# Must match percent_specifiers[] order in abrt-hook-ccpp.c:
-PATTERN="|$HOOK_BIN /var/spool/abrt %s %c %p %u %g %t %e"
+PATTERN="|$HOOK_BIN $DUMP_LOCATION %s %c %p %u %g %t %e"
# Same, but with bogus "executable name" parameter
-PATTERN1="|$HOOK_BIN /var/spool/abrt %s %c %p %u %g %t e"
+PATTERN1="|$HOOK_BIN $DUMP_LOCATION %s %c %p %u %g %t e"
# core_pipe_limit specifies how many dump_helpers can run at the same time
# 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing
--
1.7.6.49.g033c2
12 years, 9 months