Denys Vlasenko
2013-08-22 11:14:41 UTC
Signed-off-by: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
Makefile.am | 4 +-
doc/Makefile.am | 4 +-
doc/abrt-harvest-pstoreoops.txt | 25 +++++
doc/abrt-harvest-uefioops.txt | 25 -----
doc/abrt-merge-pstoreoops.txt | 30 ++++++
doc/abrt-merge-uefioops.txt | 30 ------
init-scripts/abrt-pstoreoops | 79 ++++++++++++++
init-scripts/abrt-pstoreoops.service | 13 +++
init-scripts/abrt-uefioops | 79 --------------
init-scripts/abrt-uefioops.service | 13 ---
po/POTFILES.in | 2 +-
src/hooks/Makefile.am | 18 ++--
src/hooks/abrt-harvest-pstoreoops.in | 44 ++++++++
src/hooks/abrt-harvest-uefioops.in | 44 --------
src/hooks/abrt-merge-pstoreoops.c | 148 ++++++++++++++++++++++++++
src/hooks/abrt-merge-uefioops.c | 148 --------------------------
tests/runtests/aux/test_order | 4 +-
tests/runtests/aux/test_order.rhel7 | 2 +-
tests/runtests/pstoreoops-harvest/PURPOSE | 3 +
tests/runtests/pstoreoops-harvest/dmesg-efi-1 | 29 +++++
tests/runtests/pstoreoops-harvest/dmesg-efi-2 | 14 +++
tests/runtests/pstoreoops-harvest/runtest.sh | 52 +++++++++
tests/runtests/pstoreoops/dmesg-efi-1 | 29 +++++
tests/runtests/pstoreoops/dmesg-efi-2 | 14 +++
tests/runtests/pstoreoops/runtest.sh | 56 ++++++++++
tests/runtests/uefioops-harvest/PURPOSE | 3 -
tests/runtests/uefioops-harvest/dmesg-efi-1 | 29 -----
tests/runtests/uefioops-harvest/dmesg-efi-2 | 14 ---
tests/runtests/uefioops-harvest/runtest.sh | 52 ---------
tests/runtests/uefioops/dmesg-efi-1 | 29 -----
tests/runtests/uefioops/dmesg-efi-2 | 14 ---
tests/runtests/uefioops/runtest.sh | 56 ----------
32 files changed, 553 insertions(+), 553 deletions(-)
create mode 100644 doc/abrt-harvest-pstoreoops.txt
delete mode 100644 doc/abrt-harvest-uefioops.txt
create mode 100644 doc/abrt-merge-pstoreoops.txt
delete mode 100644 doc/abrt-merge-uefioops.txt
create mode 100644 init-scripts/abrt-pstoreoops
create mode 100644 init-scripts/abrt-pstoreoops.service
delete mode 100644 init-scripts/abrt-uefioops
delete mode 100644 init-scripts/abrt-uefioops.service
create mode 100644 src/hooks/abrt-harvest-pstoreoops.in
delete mode 100644 src/hooks/abrt-harvest-uefioops.in
create mode 100644 src/hooks/abrt-merge-pstoreoops.c
delete mode 100644 src/hooks/abrt-merge-uefioops.c
create mode 100644 tests/runtests/pstoreoops-harvest/PURPOSE
create mode 100644 tests/runtests/pstoreoops-harvest/dmesg-efi-1
create mode 100644 tests/runtests/pstoreoops-harvest/dmesg-efi-2
create mode 100755 tests/runtests/pstoreoops-harvest/runtest.sh
create mode 100644 tests/runtests/pstoreoops/dmesg-efi-1
create mode 100644 tests/runtests/pstoreoops/dmesg-efi-2
create mode 100755 tests/runtests/pstoreoops/runtest.sh
delete mode 100644 tests/runtests/uefioops-harvest/PURPOSE
delete mode 100644 tests/runtests/uefioops-harvest/dmesg-efi-1
delete mode 100644 tests/runtests/uefioops-harvest/dmesg-efi-2
delete mode 100755 tests/runtests/uefioops-harvest/runtest.sh
delete mode 100644 tests/runtests/uefioops/dmesg-efi-1
delete mode 100644 tests/runtests/uefioops/dmesg-efi-2
delete mode 100755 tests/runtests/uefioops/runtest.sh
diff --git a/Makefile.am b/Makefile.am
index a67659e..f0b0e1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,7 @@ if HAVE_SYSTEMD
init-scripts/abrt-oops.service \
init-scripts/abrt-xorg.service \
init-scripts/abrt-vmcore.service \
- init-scripts/abrt-uefioops.service \
+ init-scripts/abrt-pstoreoops.service \
init-scripts/abrt-upload-watch.service
else
sysv_initdir = $(sysconfdir)/rc.d/init.d/
@@ -49,7 +49,7 @@ else
init-scripts/abrt-oops \
init-scripts/abrt-xorg \
init-scripts/abrt-vmcore \
- init-scripts/abrt-uefioops \
+ init-scripts/abrt-pstoreoops \
init-scripts/abrt-upload-watch
endif
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e0c50ff..74834b0 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -21,9 +21,9 @@ MAN1_TXT += abrt-dump-oops.txt
MAN1_TXT += abrt-dump-xorg.txt
MAN1_TXT += abrt-retrace-client.txt
MAN1_TXT += abrt-handle-upload.txt
-MAN1_TXT += abrt-harvest-uefioops.txt
+MAN1_TXT += abrt-harvest-pstoreoops.txt
MAN1_TXT += abrt-harvest-vmcore.txt
-MAN1_TXT += abrt-merge-uefioops.txt
+MAN1_TXT += abrt-merge-pstoreoops.txt
MAN1_TXT += abrt-server.txt
MAN1_TXT += abrt-dedup-client.txt
MAN1_TXT += abrt-cli.txt
diff --git a/doc/abrt-harvest-pstoreoops.txt b/doc/abrt-harvest-pstoreoops.txt
new file mode 100644
index 0000000..1c8f6aa
--- /dev/null
+++ b/doc/abrt-harvest-pstoreoops.txt
@@ -0,0 +1,25 @@
+abrt-harvest-pstoreoops(1)
+==========================
+
+NAME
+----
+abrt-harvest-pstoreoops - Reconstruct oops from /sys/fs/pstore/* files, create ABRT problems and remove the files
+
+SYNOPSIS
+--------
+'abrt-harvest-pstoreoops'
+
+DESCRIPTION
+-----------
+This script is meant to be run once at system startup after abrtd is up and
+running. It scans /sys/fs/pstore/*, reconstructs oops text(s) from these files,
+creates ABRT problem directories from them, then removes the files (pstore
+storage is a limited resource).
+
+SEE ALSO
+--------
+abrt-merge-pstoreoops(1)
+
+AUTHORS
+-------
+* ABRT team
diff --git a/doc/abrt-harvest-uefioops.txt b/doc/abrt-harvest-uefioops.txt
deleted file mode 100644
index efd6f3f..0000000
--- a/doc/abrt-harvest-uefioops.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-abrt-harvest-uefioops(1)
-======================
-
-NAME
-----
-abrt-harvest-uefioops - Reconstruct oops from /sys/fs/pstore/* files, create ABRT problems and remove the files
-
-SYNOPSIS
---------
-'abrt-harvest-uefioops'
-
-DESCRIPTION
------------
-This script is meant to be run once at system startup after abrtd is up and
-running. It scans /sys/fs/pstore/*, reconstructs oops text(s) from these files,
-creates ABRT problem directories from them, then removes the files (UEFI
-storage is a limited resource).
-
-SEE ALSO
---------
-abrt-merge-uefioops(1)
-
-AUTHORS
--------
-* ABRT team
diff --git a/doc/abrt-merge-pstoreoops.txt b/doc/abrt-merge-pstoreoops.txt
new file mode 100644
index 0000000..2d1c31d
--- /dev/null
+++ b/doc/abrt-merge-pstoreoops.txt
@@ -0,0 +1,30 @@
+abrt-merge-pstoreoops(1)
+========================
+
+NAME
+----
+abrt-merge-pstoreoops - Scans files for split oops message. Can print and/or delete them.
+
+SYNOPSIS
+--------
+'abrt-merge-pstoreoops' [-v] [-od] FILE...
+
+DESCRIPTION
+-----------
+This tool takes list of files, reads all of the files, scans them for split
+oops messages and join oops parts to original oops message.
+
+OPTIONS
+-------
+-o::
+ Print found oopses
+
+-d::
+ Delete files with found oopses
+
+-v, --verbose::
+ Be more verbose. Can be given multiple times.
+
+AUTHORS
+-------
+* ABRT team
diff --git a/doc/abrt-merge-uefioops.txt b/doc/abrt-merge-uefioops.txt
deleted file mode 100644
index 8f7de86..0000000
--- a/doc/abrt-merge-uefioops.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-abrt-merge-uefioops(1)
-====================
-
-NAME
-----
-abrt-merge-uefioops - Scans files for split oops message. Can print and/or delete them.
-
-SYNOPSIS
---------
-'abrt-merge-uefioops' [-v] [-od] FILE...
-
-DESCRIPTION
------------
-This tool takes list of files, reads all of the files, scans them for split
-oops messages and join oops parts to original oops message.
-
-OPTIONS
--------
--o::
- Print found oopses
-
--d::
- Delete files with found oopses
-
--v, --verbose::
- Be more verbose. Can be given multiple times.
-
-AUTHORS
--------
-* ABRT team
diff --git a/init-scripts/abrt-pstoreoops b/init-scripts/abrt-pstoreoops
new file mode 100644
index 0000000..fe9890d
--- /dev/null
+++ b/init-scripts/abrt-pstoreoops
@@ -0,0 +1,79 @@
+#!/bin/bash
+# Harvest UEFI-saved oopses for ABRT
+#
+# chkconfig: 35 82 16
+# description: Collects pstore-saved oopses for ABRT
+### BEGIN INIT INFO
+# Provides: abrt-pstoreoops
+# Required-Start: $abrtd
+# Default-Stop: 0 1 2 6
+# Default-Start: 3 5
+# Short-Description: Collects pstore-saved oopses for ABRT
+# Description: Collects pstore-saved oopses for ABRT
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+LOCK="/var/lock/subsys/abrt-pstoreoops"
+HARVEST_CMD="/usr/sbin/abrt-harvest-pstoreoops"
+
+RETVAL=0
+
+check() {
+ # Check that we're a privileged user
+ [ "`id -u`" = 0 ] || exit 4
+}
+
+start() {
+ check
+ "$HARVEST_CMD"
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch -- "$LOCK"
+ return $RETVAL
+}
+
+stop() {
+ check
+ rm -f -- "$LOCK"
+ return 0
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+reload)
+ reload
+ ;;
+force-reload)
+ echo "$0: Unimplemented feature."
+ RETVAL=3
+ ;;
+restart)
+ restart
+ ;;
+condrestart)
+ test -f "$LOCK" && restart
+ ;;
+status)
+ test -f "$LOCK" && RETVAL=0 || RETVAL=3
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+ RETVAL=2
+esac
+
+exit $RETVAL
diff --git a/init-scripts/abrt-pstoreoops.service b/init-scripts/abrt-pstoreoops.service
new file mode 100644
index 0000000..50cb6ee
--- /dev/null
+++ b/init-scripts/abrt-pstoreoops.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Collect UEFI-saved oopses for ABRT
+After=abrtd.service
+Requisite=abrtd.service
+ConditionDirectoryNotEmpty=/sys/fs/pstore
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/abrt-harvest-pstoreoops
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/init-scripts/abrt-uefioops b/init-scripts/abrt-uefioops
deleted file mode 100644
index 663e24a..0000000
--- a/init-scripts/abrt-uefioops
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-# Harvest UEFI-saved oopses for ABRT
-#
-# chkconfig: 35 82 16
-# description: Collects UEFI-saved oopses for ABRT
-### BEGIN INIT INFO
-# Provides: abrt-uefioops
-# Required-Start: $abrtd
-# Default-Stop: 0 1 2 6
-# Default-Start: 3 5
-# Short-Description: Collects UEFI-saved oopses for ABRT
-# Description: Collects UEFI-saved oopses for ABRT
-### END INIT INFO
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-LOCK="/var/lock/subsys/abrt-uefioops"
-HARVEST_CMD="/usr/sbin/abrt-harvest-uefioops"
-
-RETVAL=0
-
-check() {
- # Check that we're a privileged user
- [ "`id -u`" = 0 ] || exit 4
-}
-
-start() {
- check
- "$HARVEST_CMD"
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch -- "$LOCK"
- return $RETVAL
-}
-
-stop() {
- check
- rm -f -- "$LOCK"
- return 0
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-case "$1" in
-start)
- start
- ;;
-stop)
- stop
- ;;
-reload)
- reload
- ;;
-force-reload)
- echo "$0: Unimplemented feature."
- RETVAL=3
- ;;
-restart)
- restart
- ;;
-condrestart)
- test -f "$LOCK" && restart
- ;;
-status)
- test -f "$LOCK" && RETVAL=0 || RETVAL=3
- ;;
-*)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
- RETVAL=2
-esac
-
-exit $RETVAL
diff --git a/init-scripts/abrt-uefioops.service b/init-scripts/abrt-uefioops.service
deleted file mode 100644
index 1481782..0000000
--- a/init-scripts/abrt-uefioops.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Collect UEFI-saved oopses for ABRT
-After=abrtd.service
-Requisite=abrtd.service
-ConditionDirectoryNotEmpty=/sys/fs/pstore
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/abrt-harvest-uefioops
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8d22e35..cd0a887 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -40,7 +40,7 @@ src/plugins/collect_xsession_errors.xml.in
src/plugins/https-utils.c
src/plugins/bodhi.c
-src/hooks/abrt-merge-uefioops.c
+src/hooks/abrt-merge-pstoreoops.c
src/cli/abrt-cli.c
src/cli/list.c
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am
index dfa791c..567da6a 100644
--- a/src/hooks/Makefile.am
+++ b/src/hooks/Makefile.am
@@ -13,10 +13,10 @@ dist_pluginsconf_DATA = \
sbin_SCRIPTS = \
abrt-install-ccpp-hook \
abrt-harvest-vmcore \
- abrt-harvest-uefioops
+ abrt-harvest-pstoreoops
bin_PROGRAMS = \
- abrt-merge-uefioops
+ abrt-merge-pstoreoops
libexec_PROGRAMS = abrt-hook-ccpp
@@ -36,10 +36,10 @@ abrt_hook_ccpp_LDADD = \
../lib/libabrt.la \
$(LIBREPORT_LIBS)
-# abrt-merge-uefioops
-abrt_merge_uefioops_SOURCES = \
- abrt-merge-uefioops.c
-abrt_merge_uefioops_CPPFLAGS = \
+# abrt-merge-pstoreoops
+abrt_merge_pstoreoops_SOURCES = \
+ abrt-merge-pstoreoops.c
+abrt_merge_pstoreoops_CPPFLAGS = \
-I$(srcdir)/../include \
-I$(srcdir)/../lib \
-DVAR_RUN=\"$(VAR_RUN)\" \
@@ -48,7 +48,7 @@ abrt_merge_uefioops_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
-D_GNU_SOURCE
-abrt_merge_uefioops_LDADD = \
+abrt_merge_pstoreoops_LDADD = \
../lib/libabrt.la \
$(LIBREPORT_LIBS)
@@ -61,7 +61,7 @@ pyhook_PYTHON = \
EXTRA_DIST = abrt_exception_handler.py.in \
abrt-install-ccpp-hook.in \
abrt_harvest_vmcore.py.in \
- abrt-harvest-uefioops.in
+ abrt-harvest-pstoreoops.in
CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc)) $(man1_MANS)
@@ -90,7 +90,7 @@ abrt-harvest-vmcore: abrt_harvest_vmcore.py.in
-e s,\@DEFAULT_DUMP_LOCATION\@,$(DEFAULT_DUMP_LOCATION),g \
$< >$@
-abrt-harvest-uefioops: abrt-harvest-uefioops.in
+abrt-harvest-pstoreoops: abrt-harvest-pstoreoops.in
sed -e s,\@CONF_DIR\@,\$(CONF_DIR)\,g \
-e s,\@DEFAULT_DUMP_LOCATION\@,$(DEFAULT_DUMP_LOCATION),g \
$< >$@
diff --git a/src/hooks/abrt-harvest-pstoreoops.in b/src/hooks/abrt-harvest-pstoreoops.in
new file mode 100644
index 0000000..050f103
--- /dev/null
+++ b/src/hooks/abrt-harvest-pstoreoops.in
@@ -0,0 +1,44 @@
+#! /usr/bin/python
+#
+# This script is meant to be run once at system startup
+# It scans /sys/fs/pstore/*, reconstructs oops text(s)
+# from these files, creates ABRT problem directories from them,
+# then removes the files (UEFI storage is a limited resource).
+#
+
+import os
+import sys
+from subprocess import Popen
+
+if __name__ == "__main__":
+ # need to allow setting the pstore oops storage dir
+ # to make this script testable
+ pstoredir = "/sys/fs/pstore"
+ dryrun = False
+
+ for arg in sys.argv:
+ if arg == "dryrun":
+ dryrun = True
+ continue
+
+ if arg.startswith("--pstoredir"):
+ pstoredir = arg.split('=')[1]
+
+ try:
+ os.chdir(pstoredir)
+ except OSError, ex:
+ # silently ignore if the pstore doesn't exist, because that usually
+ # means that we're on the system where pstore boot is not supported
+ sys.stderr.write("Can't chdir to {0}: {1}".format(pstoredir, ex))
+ sys.exit(0)
+
+ merge_status = Popen(
+ ["-c", "abrt-merge-pstoreoops -o * | abrt-dump-oops {0}"
+ .format("-o" if dryrun else "-D")],
+ shell=True,
+ bufsize=-1
+ ).wait()
+ if merge_status == 0:
+ Popen(["abrt-merge-pstoreoops -d *"], shell=True, bufsize=-1)
+ else:
+ sys.stderr.write("Failed to merge pstore oops")
diff --git a/src/hooks/abrt-harvest-uefioops.in b/src/hooks/abrt-harvest-uefioops.in
deleted file mode 100644
index 6c3f18a..0000000
--- a/src/hooks/abrt-harvest-uefioops.in
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /usr/bin/python
-#
-# This script is meant to be run once at system startup
-# It scans /sys/fs/pstore/*, reconstructs oops text(s)
-# from these files, creates ABRT problem directories from them,
-# then removes the files (UEFI storage is a limited resource).
-#
-
-import os
-import sys
-from subprocess import Popen
-
-if __name__ == "__main__":
- # need to allow setting the uefi oops storage dir
- # to make this script testable
- uefidir = "/sys/fs/pstore"
- dryrun = False
-
- for arg in sys.argv:
- if arg == "dryrun":
- dryrun = True
- continue
-
- if arg.startswith("--uefidir"):
- uefidir = arg.split('=')[1]
-
- try:
- os.chdir(uefidir)
- except OSError, ex:
- # silently ignore if the pstore doesn't exist, because that usually
- # means that we're on the system where uefi boot is not supported
- sys.stderr.write("Can't chdir to {0}: {1}".format(uefidir, ex))
- sys.exit(0)
-
- merge_status = Popen(
- ["-c", "abrt-merge-uefioops -o * | abrt-dump-oops {0}"
- .format("-o" if dryrun else "-D")],
- shell=True,
- bufsize=-1
- ).wait()
- if merge_status == 0:
- Popen(["abrt-merge-uefioops -d *"], shell=True, bufsize=-1)
- else:
- sys.stderr.write("Failed to merge uefi oops")
diff --git a/src/hooks/abrt-merge-pstoreoops.c b/src/hooks/abrt-merge-pstoreoops.c
new file mode 100644
index 0000000..6fc3109
--- /dev/null
+++ b/src/hooks/abrt-merge-pstoreoops.c
@@ -0,0 +1,148 @@
+/*
+ Copyright (C) 2013 Red Hat, 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 "libabrt.h"
+
+struct oops_text {
+ unsigned panic_no;
+ unsigned part_no;
+ const char *filename;
+ char *text;
+};
+
+static
+struct oops_text *parse_file(const char *filename)
+{
+ FILE *fp = fopen(filename, "r");
+ if (!fp)
+ return NULL;
+
+ char buffer[16 * 1024];
+
+ struct oops_text *ot = NULL;
+
+ if (!fgets(buffer, sizeof(buffer), fp))
+ goto ret;
+ unsigned n1, n2;
+ int n = sscanf(buffer, "Panic#%u Part%u\n", &n1, &n2);
+ if (n != 2)
+ goto ret;
+
+ ot = xzalloc(sizeof(*ot));
+ ot->filename = filename;
+ ot->panic_no = n1;
+ ot->part_no = n2;
+
+ size_t sz = fread(buffer, 1, sizeof(buffer), fp);
+ ot->text = strndup(buffer, sz);
+
+ ret:
+ fclose(fp);
+ return ot;
+}
+
+static
+int compare_oops_texts(const void *a, const void *b)
+{
+ struct oops_text *aa = *(struct oops_text **)a;
+ struct oops_text *bb = *(struct oops_text **)b;
+ if (aa->panic_no < bb->panic_no)
+ return -1;
+ if (aa->panic_no > bb->panic_no)
+ return 1;
+ if (aa->part_no < bb->part_no)
+ return -1;
+ return (aa->part_no > bb->part_no);
+}
+
+int main(int argc, char **argv)
+{
+ /* I18n */
+ setlocale(LC_ALL, "");
+#if ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
+ abrt_init(argv);
+
+ /* Can't keep these strings/structs static: _() doesn't support that */
+ const char *program_usage_string = _(
+ "& [-v] [-od] FILE...\n"
+ "\n"
+ "Scans files for split oops message. Can print and/or delete them."
+ );
+ enum {
+ OPT_v = 1 << 0,
+ OPT_o = 1 << 1,
+ OPT_d = 1 << 2,
+ };
+ /* Keep enum above and order of options below in sync! */
+ struct options program_options[] = {
+ OPT__VERBOSE(&g_verbose),
+ OPT_BOOL('o', NULL, NULL, _("Print found oopses")),
+ OPT_BOOL('d', NULL, NULL, _("Delete files with found oopses")),
+ OPT_END()
+ };
+ unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
+
+ export_abrt_envvars(0);
+
+ struct oops_text **v = xzalloc(sizeof(v[0]));
+ int i = 0;
+
+ while (*argv)
+ {
+ v[i] = parse_file(*argv);
+ if (v[i])
+ {
+ v = xrealloc(v, (++i + 1) * sizeof(v[0]));
+ v[i] = NULL;
+ }
+ argv++;
+ }
+
+ if (i == 0) /* nothing was found */
+ return 0;
+
+ qsort(v, i, sizeof(v[0]), compare_oops_texts);
+
+ if (opts & OPT_o)
+ {
+ struct oops_text **vv = v;
+ while (*vv)
+ {
+ struct oops_text *cur_oops = *vv;
+ fputs(cur_oops->text, stdout);
+ vv++;
+ }
+ }
+
+ if (opts & OPT_d)
+ {
+ struct oops_text **vv = v;
+ while (*vv)
+ {
+ struct oops_text *cur_oops = *vv;
+ if (unlink(cur_oops->filename) != 0)
+ perror_msg("Can't unlink '%s'", cur_oops->filename);
+ vv++;
+ }
+ }
+
+ return 0;
+}
diff --git a/src/hooks/abrt-merge-uefioops.c b/src/hooks/abrt-merge-uefioops.c
deleted file mode 100644
index 6fc3109..0000000
--- a/src/hooks/abrt-merge-uefioops.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- Copyright (C) 2013 Red Hat, 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 "libabrt.h"
-
-struct oops_text {
- unsigned panic_no;
- unsigned part_no;
- const char *filename;
- char *text;
-};
-
-static
-struct oops_text *parse_file(const char *filename)
-{
- FILE *fp = fopen(filename, "r");
- if (!fp)
- return NULL;
-
- char buffer[16 * 1024];
-
- struct oops_text *ot = NULL;
-
- if (!fgets(buffer, sizeof(buffer), fp))
- goto ret;
- unsigned n1, n2;
- int n = sscanf(buffer, "Panic#%u Part%u\n", &n1, &n2);
- if (n != 2)
- goto ret;
-
- ot = xzalloc(sizeof(*ot));
- ot->filename = filename;
- ot->panic_no = n1;
- ot->part_no = n2;
-
- size_t sz = fread(buffer, 1, sizeof(buffer), fp);
- ot->text = strndup(buffer, sz);
-
- ret:
- fclose(fp);
- return ot;
-}
-
-static
-int compare_oops_texts(const void *a, const void *b)
-{
- struct oops_text *aa = *(struct oops_text **)a;
- struct oops_text *bb = *(struct oops_text **)b;
- if (aa->panic_no < bb->panic_no)
- return -1;
- if (aa->panic_no > bb->panic_no)
- return 1;
- if (aa->part_no < bb->part_no)
- return -1;
- return (aa->part_no > bb->part_no);
-}
-
-int main(int argc, char **argv)
-{
- /* I18n */
- setlocale(LC_ALL, "");
-#if ENABLE_NLS
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-#endif
-
- abrt_init(argv);
-
- /* Can't keep these strings/structs static: _() doesn't support that */
- const char *program_usage_string = _(
- "& [-v] [-od] FILE...\n"
- "\n"
- "Scans files for split oops message. Can print and/or delete them."
- );
- enum {
- OPT_v = 1 << 0,
- OPT_o = 1 << 1,
- OPT_d = 1 << 2,
- };
- /* Keep enum above and order of options below in sync! */
- struct options program_options[] = {
- OPT__VERBOSE(&g_verbose),
- OPT_BOOL('o', NULL, NULL, _("Print found oopses")),
- OPT_BOOL('d', NULL, NULL, _("Delete files with found oopses")),
- OPT_END()
- };
- unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
-
- export_abrt_envvars(0);
-
- struct oops_text **v = xzalloc(sizeof(v[0]));
- int i = 0;
-
- while (*argv)
- {
- v[i] = parse_file(*argv);
- if (v[i])
- {
- v = xrealloc(v, (++i + 1) * sizeof(v[0]));
- v[i] = NULL;
- }
- argv++;
- }
-
- if (i == 0) /* nothing was found */
- return 0;
-
- qsort(v, i, sizeof(v[0]), compare_oops_texts);
-
- if (opts & OPT_o)
- {
- struct oops_text **vv = v;
- while (*vv)
- {
- struct oops_text *cur_oops = *vv;
- fputs(cur_oops->text, stdout);
- vv++;
- }
- }
-
- if (opts & OPT_d)
- {
- struct oops_text **vv = v;
- while (*vv)
- {
- struct oops_text *cur_oops = *vv;
- if (unlink(cur_oops->filename) != 0)
- perror_msg("Can't unlink '%s'", cur_oops->filename);
- vv++;
- }
- }
-
- return 0;
-}
diff --git a/tests/runtests/aux/test_order b/tests/runtests/aux/test_order
index 44d8fa6..c29ae19 100644
--- a/tests/runtests/aux/test_order
+++ b/tests/runtests/aux/test_order
@@ -67,8 +67,8 @@ bz783450-setuid-core-owned-by-root
systemd-init
-uefioops
-uefioops-harvest
+pstoreoops
+pstoreoops-harvest
# - more or less destructive tests
diff --git a/tests/runtests/aux/test_order.rhel7 b/tests/runtests/aux/test_order.rhel7
index 935b8fd..ab388be 100644
--- a/tests/runtests/aux/test_order.rhel7
+++ b/tests/runtests/aux/test_order.rhel7
@@ -66,7 +66,7 @@ bz783450-setuid-core-owned-by-root
systemd-init
-uefioops
+pstoreoops
# - more or less destructive tests
diff --git a/tests/runtests/pstoreoops-harvest/PURPOSE b/tests/runtests/pstoreoops-harvest/PURPOSE
new file mode 100644
index 0000000..ed8ba9c
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of pstoreoops-harvest
+Description: Tests the pstore oops init script
+Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
diff --git a/tests/runtests/pstoreoops-harvest/dmesg-efi-1 b/tests/runtests/pstoreoops-harvest/dmesg-efi-1
new file mode 100644
index 0000000..416e660
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/dmesg-efi-1
@@ -0,0 +1,29 @@
+Panic#2 Part1
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
+<4> [drm] Loading RS690/RS740 Microcode
+<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
+<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
+<4> *pde = 6f5c6067
+<4> Oops: 0000 [#1] SMP.
+<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
+<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
+<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
+<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
+<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
+<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
+<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
+<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
+<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
+<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
+<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/pstoreoops-harvest/dmesg-efi-2 b/tests/runtests/pstoreoops-harvest/dmesg-efi-2
new file mode 100644
index 0000000..ef564c6
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/dmesg-efi-2
@@ -0,0 +1,14 @@
+Panic#2 Part2
+<4> Call Trace:
+<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
+<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
+<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
+<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
+<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
+<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
+<4> [<c049b460>] sys_ioctl+0x40/0x5c
+<4> [<c0403c76>] syscall_call+0x7/0xb
+<4> =======================
+<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
+<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
+<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/pstoreoops-harvest/runtest.sh b/tests/runtests/pstoreoops-harvest/runtest.sh
new file mode 100755
index 0000000..c5fc1cb
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/runtest.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# runtest.sh of pstoreoops
+# Description: Tests abrt pstore harvesting
+# Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
+#
+# 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 3 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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="pstoreoops"
+PACKAGE="abrt"
+
+rlJournalStart
+ rlPhaseStartSetup
+ TmpDir=$(mktemp -d)
+ cp -R -- dmesg-efi-* "$TmpDir"
+ pushd -- "$TmpDir"
+ rlPhaseEnd
+
+ rlPhaseStartTest "Harvesting oops"
+ rlRun "abrt-harvest-pstoreoops --pstoredir=$TmpDir dryrun 2>&1 | grep 'abrt-dump-oops: Found oopses: 1'" 0 "Testing harvesting"
+ rlAssertNotExists dmesg-efi-1
+ rlAssertNotExists dmesg-efi-2
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rm -rf -- "$TmpDir"
+ rlPhaseEnd
+ rlJournalPrintText
+rlJournalEnd
diff --git a/tests/runtests/pstoreoops/dmesg-efi-1 b/tests/runtests/pstoreoops/dmesg-efi-1
new file mode 100644
index 0000000..416e660
--- /dev/null
+++ b/tests/runtests/pstoreoops/dmesg-efi-1
@@ -0,0 +1,29 @@
+Panic#2 Part1
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
+<4> [drm] Loading RS690/RS740 Microcode
+<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
+<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
+<4> *pde = 6f5c6067
+<4> Oops: 0000 [#1] SMP.
+<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
+<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
+<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
+<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
+<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
+<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
+<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
+<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
+<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
+<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
+<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/pstoreoops/dmesg-efi-2 b/tests/runtests/pstoreoops/dmesg-efi-2
new file mode 100644
index 0000000..ef564c6
--- /dev/null
+++ b/tests/runtests/pstoreoops/dmesg-efi-2
@@ -0,0 +1,14 @@
+Panic#2 Part2
+<4> Call Trace:
+<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
+<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
+<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
+<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
+<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
+<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
+<4> [<c049b460>] sys_ioctl+0x40/0x5c
+<4> [<c0403c76>] syscall_call+0x7/0xb
+<4> =======================
+<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
+<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
+<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/pstoreoops/runtest.sh b/tests/runtests/pstoreoops/runtest.sh
new file mode 100755
index 0000000..d8a7075
--- /dev/null
+++ b/tests/runtests/pstoreoops/runtest.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# runtest.sh of pstoreoops
+# Description: Test abrt-merge-pstoreoops
+# Author: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
+#
+# 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 3 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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="pstoreoops"
+PACKAGE="abrt"
+
+rlJournalStart
+ rlPhaseStartSetup
+ TmpDir=$(mktemp -d)
+ cp -R -- dmesg-efi-* "$TmpDir"
+ pushd -- "$TmpDir"
+ rlPhaseEnd
+
+ rlPhaseStartTest "merge pstore oops"
+ rlRun "abrt-merge-pstoreoops -o dmesg-efi-* | grep 'Process Xorg'" 0 "Testing merging"
+ rlPhaseEnd
+
+ rlPhaseStartTest "delete pstore oops"
+ rlRun "abrt-merge-pstoreoops -d dmesg-efi-*" 0 "Testing deleting"
+ rlAssertNotExists dmesg-efi-1
+ rlAssertNotExists dmesg-efi-2
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rm -rf -- "$TmpDir"
+ rlPhaseEnd
+ rlJournalPrintText
+rlJournalEnd
diff --git a/tests/runtests/uefioops-harvest/PURPOSE b/tests/runtests/uefioops-harvest/PURPOSE
deleted file mode 100644
index d198c99..0000000
--- a/tests/runtests/uefioops-harvest/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of uefioops-harvest
-Description: Tests the uefi oops init script
-Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
diff --git a/tests/runtests/uefioops-harvest/dmesg-efi-1 b/tests/runtests/uefioops-harvest/dmesg-efi-1
deleted file mode 100644
index 416e660..0000000
--- a/tests/runtests/uefioops-harvest/dmesg-efi-1
+++ /dev/null
@@ -1,29 +0,0 @@
-Panic#2 Part1
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
-<4> [drm] Loading RS690/RS740 Microcode
-<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
-<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
-<4> *pde = 6f5c6067
-<4> Oops: 0000 [#1] SMP.
-<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
-<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
-<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
-<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
-<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
-<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
-<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
-<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
-<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
-<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
-<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/uefioops-harvest/dmesg-efi-2 b/tests/runtests/uefioops-harvest/dmesg-efi-2
deleted file mode 100644
index ef564c6..0000000
--- a/tests/runtests/uefioops-harvest/dmesg-efi-2
+++ /dev/null
@@ -1,14 +0,0 @@
-Panic#2 Part2
-<4> Call Trace:
-<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
-<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
-<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
-<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
-<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
-<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
-<4> [<c049b460>] sys_ioctl+0x40/0x5c
-<4> [<c0403c76>] syscall_call+0x7/0xb
-<4> =======================
-<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
-<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
-<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/uefioops-harvest/runtest.sh b/tests/runtests/uefioops-harvest/runtest.sh
deleted file mode 100755
index 5a01fac..0000000
--- a/tests/runtests/uefioops-harvest/runtest.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# runtest.sh of uefioops
-# Description: Tests abrt uefi harvesting
-# Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
-#
-# 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 3 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, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-. /usr/share/beakerlib/beakerlib.sh
-. ../aux/lib.sh
-
-TEST="uefioops"
-PACKAGE="abrt"
-
-rlJournalStart
- rlPhaseStartSetup
- TmpDir=$(mktemp -d)
- cp -R -- dmesg-efi-* "$TmpDir"
- pushd -- "$TmpDir"
- rlPhaseEnd
-
- rlPhaseStartTest "Harvesting oops"
- rlRun "abrt-harvest-uefioops --uefidir=$TmpDir dryrun 2>&1 | grep 'abrt-dump-oops: Found oopses: 1'" 0 "Testing harvesting"
- rlAssertNotExists dmesg-efi-1
- rlAssertNotExists dmesg-efi-2
- rlPhaseEnd
-
- rlPhaseStartCleanup
- popd
- rm -rf -- "$TmpDir"
- rlPhaseEnd
- rlJournalPrintText
-rlJournalEnd
diff --git a/tests/runtests/uefioops/dmesg-efi-1 b/tests/runtests/uefioops/dmesg-efi-1
deleted file mode 100644
index 416e660..0000000
--- a/tests/runtests/uefioops/dmesg-efi-1
+++ /dev/null
@@ -1,29 +0,0 @@
-Panic#2 Part1
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
-<4> [drm] Loading RS690/RS740 Microcode
-<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
-<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
-<4> *pde = 6f5c6067
-<4> Oops: 0000 [#1] SMP.
-<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
-<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
-<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
-<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
-<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
-<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
-<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
-<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
-<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
-<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
-<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/uefioops/dmesg-efi-2 b/tests/runtests/uefioops/dmesg-efi-2
deleted file mode 100644
index ef564c6..0000000
--- a/tests/runtests/uefioops/dmesg-efi-2
+++ /dev/null
@@ -1,14 +0,0 @@
-Panic#2 Part2
-<4> Call Trace:
-<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
-<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
-<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
-<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
-<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
-<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
-<4> [<c049b460>] sys_ioctl+0x40/0x5c
-<4> [<c0403c76>] syscall_call+0x7/0xb
-<4> =======================
-<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
-<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
-<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/uefioops/runtest.sh b/tests/runtests/uefioops/runtest.sh
deleted file mode 100755
index 0daed4e..0000000
--- a/tests/runtests/uefioops/runtest.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# runtest.sh of uefioops
-# Description: Test abrt-merge-uefioops
-# Author: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
-#
-# 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 3 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, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-. /usr/share/beakerlib/beakerlib.sh
-. ../aux/lib.sh
-
-TEST="uefioops"
-PACKAGE="abrt"
-
-rlJournalStart
- rlPhaseStartSetup
- TmpDir=$(mktemp -d)
- cp -R -- dmesg-efi-* "$TmpDir"
- pushd -- "$TmpDir"
- rlPhaseEnd
-
- rlPhaseStartTest "merge uefi oops"
- rlRun "abrt-merge-uefioops -o dmesg-efi-* | grep 'Process Xorg'" 0 "Testing merging"
- rlPhaseEnd
-
- rlPhaseStartTest "delete uefi oops"
- rlRun "abrt-merge-uefioops -d dmesg-efi-*" 0 "Testing deleting"
- rlAssertNotExists dmesg-efi-1
- rlAssertNotExists dmesg-efi-2
- rlPhaseEnd
-
- rlPhaseStartCleanup
- popd
- rm -rf -- "$TmpDir"
- rlPhaseEnd
- rlJournalPrintText
-rlJournalEnd
---
Makefile.am | 4 +-
doc/Makefile.am | 4 +-
doc/abrt-harvest-pstoreoops.txt | 25 +++++
doc/abrt-harvest-uefioops.txt | 25 -----
doc/abrt-merge-pstoreoops.txt | 30 ++++++
doc/abrt-merge-uefioops.txt | 30 ------
init-scripts/abrt-pstoreoops | 79 ++++++++++++++
init-scripts/abrt-pstoreoops.service | 13 +++
init-scripts/abrt-uefioops | 79 --------------
init-scripts/abrt-uefioops.service | 13 ---
po/POTFILES.in | 2 +-
src/hooks/Makefile.am | 18 ++--
src/hooks/abrt-harvest-pstoreoops.in | 44 ++++++++
src/hooks/abrt-harvest-uefioops.in | 44 --------
src/hooks/abrt-merge-pstoreoops.c | 148 ++++++++++++++++++++++++++
src/hooks/abrt-merge-uefioops.c | 148 --------------------------
tests/runtests/aux/test_order | 4 +-
tests/runtests/aux/test_order.rhel7 | 2 +-
tests/runtests/pstoreoops-harvest/PURPOSE | 3 +
tests/runtests/pstoreoops-harvest/dmesg-efi-1 | 29 +++++
tests/runtests/pstoreoops-harvest/dmesg-efi-2 | 14 +++
tests/runtests/pstoreoops-harvest/runtest.sh | 52 +++++++++
tests/runtests/pstoreoops/dmesg-efi-1 | 29 +++++
tests/runtests/pstoreoops/dmesg-efi-2 | 14 +++
tests/runtests/pstoreoops/runtest.sh | 56 ++++++++++
tests/runtests/uefioops-harvest/PURPOSE | 3 -
tests/runtests/uefioops-harvest/dmesg-efi-1 | 29 -----
tests/runtests/uefioops-harvest/dmesg-efi-2 | 14 ---
tests/runtests/uefioops-harvest/runtest.sh | 52 ---------
tests/runtests/uefioops/dmesg-efi-1 | 29 -----
tests/runtests/uefioops/dmesg-efi-2 | 14 ---
tests/runtests/uefioops/runtest.sh | 56 ----------
32 files changed, 553 insertions(+), 553 deletions(-)
create mode 100644 doc/abrt-harvest-pstoreoops.txt
delete mode 100644 doc/abrt-harvest-uefioops.txt
create mode 100644 doc/abrt-merge-pstoreoops.txt
delete mode 100644 doc/abrt-merge-uefioops.txt
create mode 100644 init-scripts/abrt-pstoreoops
create mode 100644 init-scripts/abrt-pstoreoops.service
delete mode 100644 init-scripts/abrt-uefioops
delete mode 100644 init-scripts/abrt-uefioops.service
create mode 100644 src/hooks/abrt-harvest-pstoreoops.in
delete mode 100644 src/hooks/abrt-harvest-uefioops.in
create mode 100644 src/hooks/abrt-merge-pstoreoops.c
delete mode 100644 src/hooks/abrt-merge-uefioops.c
create mode 100644 tests/runtests/pstoreoops-harvest/PURPOSE
create mode 100644 tests/runtests/pstoreoops-harvest/dmesg-efi-1
create mode 100644 tests/runtests/pstoreoops-harvest/dmesg-efi-2
create mode 100755 tests/runtests/pstoreoops-harvest/runtest.sh
create mode 100644 tests/runtests/pstoreoops/dmesg-efi-1
create mode 100644 tests/runtests/pstoreoops/dmesg-efi-2
create mode 100755 tests/runtests/pstoreoops/runtest.sh
delete mode 100644 tests/runtests/uefioops-harvest/PURPOSE
delete mode 100644 tests/runtests/uefioops-harvest/dmesg-efi-1
delete mode 100644 tests/runtests/uefioops-harvest/dmesg-efi-2
delete mode 100755 tests/runtests/uefioops-harvest/runtest.sh
delete mode 100644 tests/runtests/uefioops/dmesg-efi-1
delete mode 100644 tests/runtests/uefioops/dmesg-efi-2
delete mode 100755 tests/runtests/uefioops/runtest.sh
diff --git a/Makefile.am b/Makefile.am
index a67659e..f0b0e1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,7 @@ if HAVE_SYSTEMD
init-scripts/abrt-oops.service \
init-scripts/abrt-xorg.service \
init-scripts/abrt-vmcore.service \
- init-scripts/abrt-uefioops.service \
+ init-scripts/abrt-pstoreoops.service \
init-scripts/abrt-upload-watch.service
else
sysv_initdir = $(sysconfdir)/rc.d/init.d/
@@ -49,7 +49,7 @@ else
init-scripts/abrt-oops \
init-scripts/abrt-xorg \
init-scripts/abrt-vmcore \
- init-scripts/abrt-uefioops \
+ init-scripts/abrt-pstoreoops \
init-scripts/abrt-upload-watch
endif
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e0c50ff..74834b0 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -21,9 +21,9 @@ MAN1_TXT += abrt-dump-oops.txt
MAN1_TXT += abrt-dump-xorg.txt
MAN1_TXT += abrt-retrace-client.txt
MAN1_TXT += abrt-handle-upload.txt
-MAN1_TXT += abrt-harvest-uefioops.txt
+MAN1_TXT += abrt-harvest-pstoreoops.txt
MAN1_TXT += abrt-harvest-vmcore.txt
-MAN1_TXT += abrt-merge-uefioops.txt
+MAN1_TXT += abrt-merge-pstoreoops.txt
MAN1_TXT += abrt-server.txt
MAN1_TXT += abrt-dedup-client.txt
MAN1_TXT += abrt-cli.txt
diff --git a/doc/abrt-harvest-pstoreoops.txt b/doc/abrt-harvest-pstoreoops.txt
new file mode 100644
index 0000000..1c8f6aa
--- /dev/null
+++ b/doc/abrt-harvest-pstoreoops.txt
@@ -0,0 +1,25 @@
+abrt-harvest-pstoreoops(1)
+==========================
+
+NAME
+----
+abrt-harvest-pstoreoops - Reconstruct oops from /sys/fs/pstore/* files, create ABRT problems and remove the files
+
+SYNOPSIS
+--------
+'abrt-harvest-pstoreoops'
+
+DESCRIPTION
+-----------
+This script is meant to be run once at system startup after abrtd is up and
+running. It scans /sys/fs/pstore/*, reconstructs oops text(s) from these files,
+creates ABRT problem directories from them, then removes the files (pstore
+storage is a limited resource).
+
+SEE ALSO
+--------
+abrt-merge-pstoreoops(1)
+
+AUTHORS
+-------
+* ABRT team
diff --git a/doc/abrt-harvest-uefioops.txt b/doc/abrt-harvest-uefioops.txt
deleted file mode 100644
index efd6f3f..0000000
--- a/doc/abrt-harvest-uefioops.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-abrt-harvest-uefioops(1)
-======================
-
-NAME
-----
-abrt-harvest-uefioops - Reconstruct oops from /sys/fs/pstore/* files, create ABRT problems and remove the files
-
-SYNOPSIS
---------
-'abrt-harvest-uefioops'
-
-DESCRIPTION
------------
-This script is meant to be run once at system startup after abrtd is up and
-running. It scans /sys/fs/pstore/*, reconstructs oops text(s) from these files,
-creates ABRT problem directories from them, then removes the files (UEFI
-storage is a limited resource).
-
-SEE ALSO
---------
-abrt-merge-uefioops(1)
-
-AUTHORS
--------
-* ABRT team
diff --git a/doc/abrt-merge-pstoreoops.txt b/doc/abrt-merge-pstoreoops.txt
new file mode 100644
index 0000000..2d1c31d
--- /dev/null
+++ b/doc/abrt-merge-pstoreoops.txt
@@ -0,0 +1,30 @@
+abrt-merge-pstoreoops(1)
+========================
+
+NAME
+----
+abrt-merge-pstoreoops - Scans files for split oops message. Can print and/or delete them.
+
+SYNOPSIS
+--------
+'abrt-merge-pstoreoops' [-v] [-od] FILE...
+
+DESCRIPTION
+-----------
+This tool takes list of files, reads all of the files, scans them for split
+oops messages and join oops parts to original oops message.
+
+OPTIONS
+-------
+-o::
+ Print found oopses
+
+-d::
+ Delete files with found oopses
+
+-v, --verbose::
+ Be more verbose. Can be given multiple times.
+
+AUTHORS
+-------
+* ABRT team
diff --git a/doc/abrt-merge-uefioops.txt b/doc/abrt-merge-uefioops.txt
deleted file mode 100644
index 8f7de86..0000000
--- a/doc/abrt-merge-uefioops.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-abrt-merge-uefioops(1)
-====================
-
-NAME
-----
-abrt-merge-uefioops - Scans files for split oops message. Can print and/or delete them.
-
-SYNOPSIS
---------
-'abrt-merge-uefioops' [-v] [-od] FILE...
-
-DESCRIPTION
------------
-This tool takes list of files, reads all of the files, scans them for split
-oops messages and join oops parts to original oops message.
-
-OPTIONS
--------
--o::
- Print found oopses
-
--d::
- Delete files with found oopses
-
--v, --verbose::
- Be more verbose. Can be given multiple times.
-
-AUTHORS
--------
-* ABRT team
diff --git a/init-scripts/abrt-pstoreoops b/init-scripts/abrt-pstoreoops
new file mode 100644
index 0000000..fe9890d
--- /dev/null
+++ b/init-scripts/abrt-pstoreoops
@@ -0,0 +1,79 @@
+#!/bin/bash
+# Harvest UEFI-saved oopses for ABRT
+#
+# chkconfig: 35 82 16
+# description: Collects pstore-saved oopses for ABRT
+### BEGIN INIT INFO
+# Provides: abrt-pstoreoops
+# Required-Start: $abrtd
+# Default-Stop: 0 1 2 6
+# Default-Start: 3 5
+# Short-Description: Collects pstore-saved oopses for ABRT
+# Description: Collects pstore-saved oopses for ABRT
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+LOCK="/var/lock/subsys/abrt-pstoreoops"
+HARVEST_CMD="/usr/sbin/abrt-harvest-pstoreoops"
+
+RETVAL=0
+
+check() {
+ # Check that we're a privileged user
+ [ "`id -u`" = 0 ] || exit 4
+}
+
+start() {
+ check
+ "$HARVEST_CMD"
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch -- "$LOCK"
+ return $RETVAL
+}
+
+stop() {
+ check
+ rm -f -- "$LOCK"
+ return 0
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+reload)
+ reload
+ ;;
+force-reload)
+ echo "$0: Unimplemented feature."
+ RETVAL=3
+ ;;
+restart)
+ restart
+ ;;
+condrestart)
+ test -f "$LOCK" && restart
+ ;;
+status)
+ test -f "$LOCK" && RETVAL=0 || RETVAL=3
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+ RETVAL=2
+esac
+
+exit $RETVAL
diff --git a/init-scripts/abrt-pstoreoops.service b/init-scripts/abrt-pstoreoops.service
new file mode 100644
index 0000000..50cb6ee
--- /dev/null
+++ b/init-scripts/abrt-pstoreoops.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Collect UEFI-saved oopses for ABRT
+After=abrtd.service
+Requisite=abrtd.service
+ConditionDirectoryNotEmpty=/sys/fs/pstore
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/abrt-harvest-pstoreoops
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/init-scripts/abrt-uefioops b/init-scripts/abrt-uefioops
deleted file mode 100644
index 663e24a..0000000
--- a/init-scripts/abrt-uefioops
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-# Harvest UEFI-saved oopses for ABRT
-#
-# chkconfig: 35 82 16
-# description: Collects UEFI-saved oopses for ABRT
-### BEGIN INIT INFO
-# Provides: abrt-uefioops
-# Required-Start: $abrtd
-# Default-Stop: 0 1 2 6
-# Default-Start: 3 5
-# Short-Description: Collects UEFI-saved oopses for ABRT
-# Description: Collects UEFI-saved oopses for ABRT
-### END INIT INFO
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-LOCK="/var/lock/subsys/abrt-uefioops"
-HARVEST_CMD="/usr/sbin/abrt-harvest-uefioops"
-
-RETVAL=0
-
-check() {
- # Check that we're a privileged user
- [ "`id -u`" = 0 ] || exit 4
-}
-
-start() {
- check
- "$HARVEST_CMD"
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch -- "$LOCK"
- return $RETVAL
-}
-
-stop() {
- check
- rm -f -- "$LOCK"
- return 0
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-case "$1" in
-start)
- start
- ;;
-stop)
- stop
- ;;
-reload)
- reload
- ;;
-force-reload)
- echo "$0: Unimplemented feature."
- RETVAL=3
- ;;
-restart)
- restart
- ;;
-condrestart)
- test -f "$LOCK" && restart
- ;;
-status)
- test -f "$LOCK" && RETVAL=0 || RETVAL=3
- ;;
-*)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
- RETVAL=2
-esac
-
-exit $RETVAL
diff --git a/init-scripts/abrt-uefioops.service b/init-scripts/abrt-uefioops.service
deleted file mode 100644
index 1481782..0000000
--- a/init-scripts/abrt-uefioops.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Collect UEFI-saved oopses for ABRT
-After=abrtd.service
-Requisite=abrtd.service
-ConditionDirectoryNotEmpty=/sys/fs/pstore
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/abrt-harvest-uefioops
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8d22e35..cd0a887 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -40,7 +40,7 @@ src/plugins/collect_xsession_errors.xml.in
src/plugins/https-utils.c
src/plugins/bodhi.c
-src/hooks/abrt-merge-uefioops.c
+src/hooks/abrt-merge-pstoreoops.c
src/cli/abrt-cli.c
src/cli/list.c
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am
index dfa791c..567da6a 100644
--- a/src/hooks/Makefile.am
+++ b/src/hooks/Makefile.am
@@ -13,10 +13,10 @@ dist_pluginsconf_DATA = \
sbin_SCRIPTS = \
abrt-install-ccpp-hook \
abrt-harvest-vmcore \
- abrt-harvest-uefioops
+ abrt-harvest-pstoreoops
bin_PROGRAMS = \
- abrt-merge-uefioops
+ abrt-merge-pstoreoops
libexec_PROGRAMS = abrt-hook-ccpp
@@ -36,10 +36,10 @@ abrt_hook_ccpp_LDADD = \
../lib/libabrt.la \
$(LIBREPORT_LIBS)
-# abrt-merge-uefioops
-abrt_merge_uefioops_SOURCES = \
- abrt-merge-uefioops.c
-abrt_merge_uefioops_CPPFLAGS = \
+# abrt-merge-pstoreoops
+abrt_merge_pstoreoops_SOURCES = \
+ abrt-merge-pstoreoops.c
+abrt_merge_pstoreoops_CPPFLAGS = \
-I$(srcdir)/../include \
-I$(srcdir)/../lib \
-DVAR_RUN=\"$(VAR_RUN)\" \
@@ -48,7 +48,7 @@ abrt_merge_uefioops_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
-D_GNU_SOURCE
-abrt_merge_uefioops_LDADD = \
+abrt_merge_pstoreoops_LDADD = \
../lib/libabrt.la \
$(LIBREPORT_LIBS)
@@ -61,7 +61,7 @@ pyhook_PYTHON = \
EXTRA_DIST = abrt_exception_handler.py.in \
abrt-install-ccpp-hook.in \
abrt_harvest_vmcore.py.in \
- abrt-harvest-uefioops.in
+ abrt-harvest-pstoreoops.in
CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc)) $(man1_MANS)
@@ -90,7 +90,7 @@ abrt-harvest-vmcore: abrt_harvest_vmcore.py.in
-e s,\@DEFAULT_DUMP_LOCATION\@,$(DEFAULT_DUMP_LOCATION),g \
$< >$@
-abrt-harvest-uefioops: abrt-harvest-uefioops.in
+abrt-harvest-pstoreoops: abrt-harvest-pstoreoops.in
sed -e s,\@CONF_DIR\@,\$(CONF_DIR)\,g \
-e s,\@DEFAULT_DUMP_LOCATION\@,$(DEFAULT_DUMP_LOCATION),g \
$< >$@
diff --git a/src/hooks/abrt-harvest-pstoreoops.in b/src/hooks/abrt-harvest-pstoreoops.in
new file mode 100644
index 0000000..050f103
--- /dev/null
+++ b/src/hooks/abrt-harvest-pstoreoops.in
@@ -0,0 +1,44 @@
+#! /usr/bin/python
+#
+# This script is meant to be run once at system startup
+# It scans /sys/fs/pstore/*, reconstructs oops text(s)
+# from these files, creates ABRT problem directories from them,
+# then removes the files (UEFI storage is a limited resource).
+#
+
+import os
+import sys
+from subprocess import Popen
+
+if __name__ == "__main__":
+ # need to allow setting the pstore oops storage dir
+ # to make this script testable
+ pstoredir = "/sys/fs/pstore"
+ dryrun = False
+
+ for arg in sys.argv:
+ if arg == "dryrun":
+ dryrun = True
+ continue
+
+ if arg.startswith("--pstoredir"):
+ pstoredir = arg.split('=')[1]
+
+ try:
+ os.chdir(pstoredir)
+ except OSError, ex:
+ # silently ignore if the pstore doesn't exist, because that usually
+ # means that we're on the system where pstore boot is not supported
+ sys.stderr.write("Can't chdir to {0}: {1}".format(pstoredir, ex))
+ sys.exit(0)
+
+ merge_status = Popen(
+ ["-c", "abrt-merge-pstoreoops -o * | abrt-dump-oops {0}"
+ .format("-o" if dryrun else "-D")],
+ shell=True,
+ bufsize=-1
+ ).wait()
+ if merge_status == 0:
+ Popen(["abrt-merge-pstoreoops -d *"], shell=True, bufsize=-1)
+ else:
+ sys.stderr.write("Failed to merge pstore oops")
diff --git a/src/hooks/abrt-harvest-uefioops.in b/src/hooks/abrt-harvest-uefioops.in
deleted file mode 100644
index 6c3f18a..0000000
--- a/src/hooks/abrt-harvest-uefioops.in
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /usr/bin/python
-#
-# This script is meant to be run once at system startup
-# It scans /sys/fs/pstore/*, reconstructs oops text(s)
-# from these files, creates ABRT problem directories from them,
-# then removes the files (UEFI storage is a limited resource).
-#
-
-import os
-import sys
-from subprocess import Popen
-
-if __name__ == "__main__":
- # need to allow setting the uefi oops storage dir
- # to make this script testable
- uefidir = "/sys/fs/pstore"
- dryrun = False
-
- for arg in sys.argv:
- if arg == "dryrun":
- dryrun = True
- continue
-
- if arg.startswith("--uefidir"):
- uefidir = arg.split('=')[1]
-
- try:
- os.chdir(uefidir)
- except OSError, ex:
- # silently ignore if the pstore doesn't exist, because that usually
- # means that we're on the system where uefi boot is not supported
- sys.stderr.write("Can't chdir to {0}: {1}".format(uefidir, ex))
- sys.exit(0)
-
- merge_status = Popen(
- ["-c", "abrt-merge-uefioops -o * | abrt-dump-oops {0}"
- .format("-o" if dryrun else "-D")],
- shell=True,
- bufsize=-1
- ).wait()
- if merge_status == 0:
- Popen(["abrt-merge-uefioops -d *"], shell=True, bufsize=-1)
- else:
- sys.stderr.write("Failed to merge uefi oops")
diff --git a/src/hooks/abrt-merge-pstoreoops.c b/src/hooks/abrt-merge-pstoreoops.c
new file mode 100644
index 0000000..6fc3109
--- /dev/null
+++ b/src/hooks/abrt-merge-pstoreoops.c
@@ -0,0 +1,148 @@
+/*
+ Copyright (C) 2013 Red Hat, 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 "libabrt.h"
+
+struct oops_text {
+ unsigned panic_no;
+ unsigned part_no;
+ const char *filename;
+ char *text;
+};
+
+static
+struct oops_text *parse_file(const char *filename)
+{
+ FILE *fp = fopen(filename, "r");
+ if (!fp)
+ return NULL;
+
+ char buffer[16 * 1024];
+
+ struct oops_text *ot = NULL;
+
+ if (!fgets(buffer, sizeof(buffer), fp))
+ goto ret;
+ unsigned n1, n2;
+ int n = sscanf(buffer, "Panic#%u Part%u\n", &n1, &n2);
+ if (n != 2)
+ goto ret;
+
+ ot = xzalloc(sizeof(*ot));
+ ot->filename = filename;
+ ot->panic_no = n1;
+ ot->part_no = n2;
+
+ size_t sz = fread(buffer, 1, sizeof(buffer), fp);
+ ot->text = strndup(buffer, sz);
+
+ ret:
+ fclose(fp);
+ return ot;
+}
+
+static
+int compare_oops_texts(const void *a, const void *b)
+{
+ struct oops_text *aa = *(struct oops_text **)a;
+ struct oops_text *bb = *(struct oops_text **)b;
+ if (aa->panic_no < bb->panic_no)
+ return -1;
+ if (aa->panic_no > bb->panic_no)
+ return 1;
+ if (aa->part_no < bb->part_no)
+ return -1;
+ return (aa->part_no > bb->part_no);
+}
+
+int main(int argc, char **argv)
+{
+ /* I18n */
+ setlocale(LC_ALL, "");
+#if ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
+ abrt_init(argv);
+
+ /* Can't keep these strings/structs static: _() doesn't support that */
+ const char *program_usage_string = _(
+ "& [-v] [-od] FILE...\n"
+ "\n"
+ "Scans files for split oops message. Can print and/or delete them."
+ );
+ enum {
+ OPT_v = 1 << 0,
+ OPT_o = 1 << 1,
+ OPT_d = 1 << 2,
+ };
+ /* Keep enum above and order of options below in sync! */
+ struct options program_options[] = {
+ OPT__VERBOSE(&g_verbose),
+ OPT_BOOL('o', NULL, NULL, _("Print found oopses")),
+ OPT_BOOL('d', NULL, NULL, _("Delete files with found oopses")),
+ OPT_END()
+ };
+ unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
+
+ export_abrt_envvars(0);
+
+ struct oops_text **v = xzalloc(sizeof(v[0]));
+ int i = 0;
+
+ while (*argv)
+ {
+ v[i] = parse_file(*argv);
+ if (v[i])
+ {
+ v = xrealloc(v, (++i + 1) * sizeof(v[0]));
+ v[i] = NULL;
+ }
+ argv++;
+ }
+
+ if (i == 0) /* nothing was found */
+ return 0;
+
+ qsort(v, i, sizeof(v[0]), compare_oops_texts);
+
+ if (opts & OPT_o)
+ {
+ struct oops_text **vv = v;
+ while (*vv)
+ {
+ struct oops_text *cur_oops = *vv;
+ fputs(cur_oops->text, stdout);
+ vv++;
+ }
+ }
+
+ if (opts & OPT_d)
+ {
+ struct oops_text **vv = v;
+ while (*vv)
+ {
+ struct oops_text *cur_oops = *vv;
+ if (unlink(cur_oops->filename) != 0)
+ perror_msg("Can't unlink '%s'", cur_oops->filename);
+ vv++;
+ }
+ }
+
+ return 0;
+}
diff --git a/src/hooks/abrt-merge-uefioops.c b/src/hooks/abrt-merge-uefioops.c
deleted file mode 100644
index 6fc3109..0000000
--- a/src/hooks/abrt-merge-uefioops.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- Copyright (C) 2013 Red Hat, 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 "libabrt.h"
-
-struct oops_text {
- unsigned panic_no;
- unsigned part_no;
- const char *filename;
- char *text;
-};
-
-static
-struct oops_text *parse_file(const char *filename)
-{
- FILE *fp = fopen(filename, "r");
- if (!fp)
- return NULL;
-
- char buffer[16 * 1024];
-
- struct oops_text *ot = NULL;
-
- if (!fgets(buffer, sizeof(buffer), fp))
- goto ret;
- unsigned n1, n2;
- int n = sscanf(buffer, "Panic#%u Part%u\n", &n1, &n2);
- if (n != 2)
- goto ret;
-
- ot = xzalloc(sizeof(*ot));
- ot->filename = filename;
- ot->panic_no = n1;
- ot->part_no = n2;
-
- size_t sz = fread(buffer, 1, sizeof(buffer), fp);
- ot->text = strndup(buffer, sz);
-
- ret:
- fclose(fp);
- return ot;
-}
-
-static
-int compare_oops_texts(const void *a, const void *b)
-{
- struct oops_text *aa = *(struct oops_text **)a;
- struct oops_text *bb = *(struct oops_text **)b;
- if (aa->panic_no < bb->panic_no)
- return -1;
- if (aa->panic_no > bb->panic_no)
- return 1;
- if (aa->part_no < bb->part_no)
- return -1;
- return (aa->part_no > bb->part_no);
-}
-
-int main(int argc, char **argv)
-{
- /* I18n */
- setlocale(LC_ALL, "");
-#if ENABLE_NLS
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-#endif
-
- abrt_init(argv);
-
- /* Can't keep these strings/structs static: _() doesn't support that */
- const char *program_usage_string = _(
- "& [-v] [-od] FILE...\n"
- "\n"
- "Scans files for split oops message. Can print and/or delete them."
- );
- enum {
- OPT_v = 1 << 0,
- OPT_o = 1 << 1,
- OPT_d = 1 << 2,
- };
- /* Keep enum above and order of options below in sync! */
- struct options program_options[] = {
- OPT__VERBOSE(&g_verbose),
- OPT_BOOL('o', NULL, NULL, _("Print found oopses")),
- OPT_BOOL('d', NULL, NULL, _("Delete files with found oopses")),
- OPT_END()
- };
- unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
-
- export_abrt_envvars(0);
-
- struct oops_text **v = xzalloc(sizeof(v[0]));
- int i = 0;
-
- while (*argv)
- {
- v[i] = parse_file(*argv);
- if (v[i])
- {
- v = xrealloc(v, (++i + 1) * sizeof(v[0]));
- v[i] = NULL;
- }
- argv++;
- }
-
- if (i == 0) /* nothing was found */
- return 0;
-
- qsort(v, i, sizeof(v[0]), compare_oops_texts);
-
- if (opts & OPT_o)
- {
- struct oops_text **vv = v;
- while (*vv)
- {
- struct oops_text *cur_oops = *vv;
- fputs(cur_oops->text, stdout);
- vv++;
- }
- }
-
- if (opts & OPT_d)
- {
- struct oops_text **vv = v;
- while (*vv)
- {
- struct oops_text *cur_oops = *vv;
- if (unlink(cur_oops->filename) != 0)
- perror_msg("Can't unlink '%s'", cur_oops->filename);
- vv++;
- }
- }
-
- return 0;
-}
diff --git a/tests/runtests/aux/test_order b/tests/runtests/aux/test_order
index 44d8fa6..c29ae19 100644
--- a/tests/runtests/aux/test_order
+++ b/tests/runtests/aux/test_order
@@ -67,8 +67,8 @@ bz783450-setuid-core-owned-by-root
systemd-init
-uefioops
-uefioops-harvest
+pstoreoops
+pstoreoops-harvest
# - more or less destructive tests
diff --git a/tests/runtests/aux/test_order.rhel7 b/tests/runtests/aux/test_order.rhel7
index 935b8fd..ab388be 100644
--- a/tests/runtests/aux/test_order.rhel7
+++ b/tests/runtests/aux/test_order.rhel7
@@ -66,7 +66,7 @@ bz783450-setuid-core-owned-by-root
systemd-init
-uefioops
+pstoreoops
# - more or less destructive tests
diff --git a/tests/runtests/pstoreoops-harvest/PURPOSE b/tests/runtests/pstoreoops-harvest/PURPOSE
new file mode 100644
index 0000000..ed8ba9c
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of pstoreoops-harvest
+Description: Tests the pstore oops init script
+Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
diff --git a/tests/runtests/pstoreoops-harvest/dmesg-efi-1 b/tests/runtests/pstoreoops-harvest/dmesg-efi-1
new file mode 100644
index 0000000..416e660
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/dmesg-efi-1
@@ -0,0 +1,29 @@
+Panic#2 Part1
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
+<4> [drm] Loading RS690/RS740 Microcode
+<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
+<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
+<4> *pde = 6f5c6067
+<4> Oops: 0000 [#1] SMP.
+<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
+<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
+<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
+<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
+<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
+<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
+<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
+<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
+<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
+<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
+<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/pstoreoops-harvest/dmesg-efi-2 b/tests/runtests/pstoreoops-harvest/dmesg-efi-2
new file mode 100644
index 0000000..ef564c6
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/dmesg-efi-2
@@ -0,0 +1,14 @@
+Panic#2 Part2
+<4> Call Trace:
+<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
+<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
+<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
+<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
+<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
+<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
+<4> [<c049b460>] sys_ioctl+0x40/0x5c
+<4> [<c0403c76>] syscall_call+0x7/0xb
+<4> =======================
+<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
+<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
+<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/pstoreoops-harvest/runtest.sh b/tests/runtests/pstoreoops-harvest/runtest.sh
new file mode 100755
index 0000000..c5fc1cb
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/runtest.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# runtest.sh of pstoreoops
+# Description: Tests abrt pstore harvesting
+# Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
+#
+# 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 3 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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="pstoreoops"
+PACKAGE="abrt"
+
+rlJournalStart
+ rlPhaseStartSetup
+ TmpDir=$(mktemp -d)
+ cp -R -- dmesg-efi-* "$TmpDir"
+ pushd -- "$TmpDir"
+ rlPhaseEnd
+
+ rlPhaseStartTest "Harvesting oops"
+ rlRun "abrt-harvest-pstoreoops --pstoredir=$TmpDir dryrun 2>&1 | grep 'abrt-dump-oops: Found oopses: 1'" 0 "Testing harvesting"
+ rlAssertNotExists dmesg-efi-1
+ rlAssertNotExists dmesg-efi-2
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rm -rf -- "$TmpDir"
+ rlPhaseEnd
+ rlJournalPrintText
+rlJournalEnd
diff --git a/tests/runtests/pstoreoops/dmesg-efi-1 b/tests/runtests/pstoreoops/dmesg-efi-1
new file mode 100644
index 0000000..416e660
--- /dev/null
+++ b/tests/runtests/pstoreoops/dmesg-efi-1
@@ -0,0 +1,29 @@
+Panic#2 Part1
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
+<4> [drm] Loading RS690/RS740 Microcode
+<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
+<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
+<4> *pde = 6f5c6067
+<4> Oops: 0000 [#1] SMP.
+<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
+<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
+<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
+<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
+<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
+<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
+<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
+<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
+<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
+<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
+<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/pstoreoops/dmesg-efi-2 b/tests/runtests/pstoreoops/dmesg-efi-2
new file mode 100644
index 0000000..ef564c6
--- /dev/null
+++ b/tests/runtests/pstoreoops/dmesg-efi-2
@@ -0,0 +1,14 @@
+Panic#2 Part2
+<4> Call Trace:
+<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
+<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
+<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
+<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
+<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
+<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
+<4> [<c049b460>] sys_ioctl+0x40/0x5c
+<4> [<c0403c76>] syscall_call+0x7/0xb
+<4> =======================
+<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
+<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
+<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/pstoreoops/runtest.sh b/tests/runtests/pstoreoops/runtest.sh
new file mode 100755
index 0000000..d8a7075
--- /dev/null
+++ b/tests/runtests/pstoreoops/runtest.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# runtest.sh of pstoreoops
+# Description: Test abrt-merge-pstoreoops
+# Author: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
+#
+# 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 3 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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="pstoreoops"
+PACKAGE="abrt"
+
+rlJournalStart
+ rlPhaseStartSetup
+ TmpDir=$(mktemp -d)
+ cp -R -- dmesg-efi-* "$TmpDir"
+ pushd -- "$TmpDir"
+ rlPhaseEnd
+
+ rlPhaseStartTest "merge pstore oops"
+ rlRun "abrt-merge-pstoreoops -o dmesg-efi-* | grep 'Process Xorg'" 0 "Testing merging"
+ rlPhaseEnd
+
+ rlPhaseStartTest "delete pstore oops"
+ rlRun "abrt-merge-pstoreoops -d dmesg-efi-*" 0 "Testing deleting"
+ rlAssertNotExists dmesg-efi-1
+ rlAssertNotExists dmesg-efi-2
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rm -rf -- "$TmpDir"
+ rlPhaseEnd
+ rlJournalPrintText
+rlJournalEnd
diff --git a/tests/runtests/uefioops-harvest/PURPOSE b/tests/runtests/uefioops-harvest/PURPOSE
deleted file mode 100644
index d198c99..0000000
--- a/tests/runtests/uefioops-harvest/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of uefioops-harvest
-Description: Tests the uefi oops init script
-Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
diff --git a/tests/runtests/uefioops-harvest/dmesg-efi-1 b/tests/runtests/uefioops-harvest/dmesg-efi-1
deleted file mode 100644
index 416e660..0000000
--- a/tests/runtests/uefioops-harvest/dmesg-efi-1
+++ /dev/null
@@ -1,29 +0,0 @@
-Panic#2 Part1
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
-<4> [drm] Loading RS690/RS740 Microcode
-<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
-<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
-<4> *pde = 6f5c6067
-<4> Oops: 0000 [#1] SMP.
-<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
-<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
-<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
-<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
-<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
-<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
-<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
-<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
-<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
-<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
-<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/uefioops-harvest/dmesg-efi-2 b/tests/runtests/uefioops-harvest/dmesg-efi-2
deleted file mode 100644
index ef564c6..0000000
--- a/tests/runtests/uefioops-harvest/dmesg-efi-2
+++ /dev/null
@@ -1,14 +0,0 @@
-Panic#2 Part2
-<4> Call Trace:
-<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
-<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
-<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
-<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
-<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
-<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
-<4> [<c049b460>] sys_ioctl+0x40/0x5c
-<4> [<c0403c76>] syscall_call+0x7/0xb
-<4> =======================
-<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
-<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
-<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/uefioops-harvest/runtest.sh b/tests/runtests/uefioops-harvest/runtest.sh
deleted file mode 100755
index 5a01fac..0000000
--- a/tests/runtests/uefioops-harvest/runtest.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# runtest.sh of uefioops
-# Description: Tests abrt uefi harvesting
-# Author: Jiri Moskovcak <jmoskovc-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
-#
-# 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 3 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, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-. /usr/share/beakerlib/beakerlib.sh
-. ../aux/lib.sh
-
-TEST="uefioops"
-PACKAGE="abrt"
-
-rlJournalStart
- rlPhaseStartSetup
- TmpDir=$(mktemp -d)
- cp -R -- dmesg-efi-* "$TmpDir"
- pushd -- "$TmpDir"
- rlPhaseEnd
-
- rlPhaseStartTest "Harvesting oops"
- rlRun "abrt-harvest-uefioops --uefidir=$TmpDir dryrun 2>&1 | grep 'abrt-dump-oops: Found oopses: 1'" 0 "Testing harvesting"
- rlAssertNotExists dmesg-efi-1
- rlAssertNotExists dmesg-efi-2
- rlPhaseEnd
-
- rlPhaseStartCleanup
- popd
- rm -rf -- "$TmpDir"
- rlPhaseEnd
- rlJournalPrintText
-rlJournalEnd
diff --git a/tests/runtests/uefioops/dmesg-efi-1 b/tests/runtests/uefioops/dmesg-efi-1
deleted file mode 100644
index 416e660..0000000
--- a/tests/runtests/uefioops/dmesg-efi-1
+++ /dev/null
@@ -1,29 +0,0 @@
-Panic#2 Part1
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
-<4> [drm] Loading RS690/RS740 Microcode
-<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
-<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
-<4> *pde = 6f5c6067
-<4> Oops: 0000 [#1] SMP.
-<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
-<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
-<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
-<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
-<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
-<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
-<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
-<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
-<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
-<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
-<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/uefioops/dmesg-efi-2 b/tests/runtests/uefioops/dmesg-efi-2
deleted file mode 100644
index ef564c6..0000000
--- a/tests/runtests/uefioops/dmesg-efi-2
+++ /dev/null
@@ -1,14 +0,0 @@
-Panic#2 Part2
-<4> Call Trace:
-<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
-<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
-<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
-<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
-<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
-<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
-<4> [<c049b460>] sys_ioctl+0x40/0x5c
-<4> [<c0403c76>] syscall_call+0x7/0xb
-<4> =======================
-<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
-<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
-<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/uefioops/runtest.sh b/tests/runtests/uefioops/runtest.sh
deleted file mode 100755
index 0daed4e..0000000
--- a/tests/runtests/uefioops/runtest.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# runtest.sh of uefioops
-# Description: Test abrt-merge-uefioops
-# Author: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
-#
-# 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 3 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, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-. /usr/share/beakerlib/beakerlib.sh
-. ../aux/lib.sh
-
-TEST="uefioops"
-PACKAGE="abrt"
-
-rlJournalStart
- rlPhaseStartSetup
- TmpDir=$(mktemp -d)
- cp -R -- dmesg-efi-* "$TmpDir"
- pushd -- "$TmpDir"
- rlPhaseEnd
-
- rlPhaseStartTest "merge uefi oops"
- rlRun "abrt-merge-uefioops -o dmesg-efi-* | grep 'Process Xorg'" 0 "Testing merging"
- rlPhaseEnd
-
- rlPhaseStartTest "delete uefi oops"
- rlRun "abrt-merge-uefioops -d dmesg-efi-*" 0 "Testing deleting"
- rlAssertNotExists dmesg-efi-1
- rlAssertNotExists dmesg-efi-2
- rlPhaseEnd
-
- rlPhaseStartCleanup
- popd
- rm -rf -- "$TmpDir"
- rlPhaseEnd
- rlJournalPrintText
-rlJournalEnd
--
1.8.1.4
1.8.1.4