Compare commits

...

No commits in common. "c8" and "a10s" have entirely different histories.
c8 ... a10s

42 changed files with 668 additions and 17 deletions

View File

@ -1 +0,0 @@
8447e6b5d2604815a4156e891936a4c76316f3f4 SOURCES/abrt-2.10.9.tar.gz

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/abrt-2.10.9.tar.gz
/abrt-2.10.5.tar.gz
/abrt-2.10.9.tar.gz

View File

@ -0,0 +1,88 @@
From 0f61c017f2d0c8a11b12abec774aa94d45ec8116 Mon Sep 17 00:00:00 2001
From: Daniil Leonov <dleonov@cloudlinux.com>
Date: Tue, 9 Feb 2021 15:17:59 +0300
Subject: [PATCH] Add GPG subkeys support.
---
src/daemon/rpm.c | 46 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/src/daemon/rpm.c b/src/daemon/rpm.c
index af9a7be..c28c047 100644
--- a/src/daemon/rpm.c
+++ b/src/daemon/rpm.c
@@ -24,6 +24,19 @@
#include <rpm/rpmcli.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmpgp.h>
+#include <rpm/rpmkeyring.h>
+
+struct rpmPubkey_s {
+ uint8_t *pkt;
+ size_t pktlen;
+ pgpKeyID_t keyid;
+ pgpDigParams pgpkey;
+ int nrefs;
+ pthread_rwlock_t lock;
+};
+
+typedef struct rpmPubkey_s * rpmPubkey;
+
#endif
/**
@@ -93,8 +106,13 @@ void rpm_destroy()
void rpm_load_gpgkey(const char* filename)
{
#ifdef HAVE_LIBRPM
+ rpmPubkey pubkey = NULL;
+ rpmPubkey *subkeys = NULL;
+ char *fingerprint = NULL;
+ int subkeysCount = 0;
uint8_t *pkt = NULL;
- size_t pklen;
+ size_t pklen = 0;
+
if (pgpReadPkts(filename, &pkt, &pklen) != PGPARMOR_PUBKEY)
{
free(pkt);
@@ -102,17 +120,29 @@ void rpm_load_gpgkey(const char* filename)
return;
}
- uint8_t keyID[8];
-#if 0
- if (pgpPubkeyFingerprint(pkt, pklen, keyID) == 0)
-#else
- if (pgpPubkeyKeyID(pkt, pklen, keyID) == 0)
-#endif
+ pubkey = rpmPubkeyNew(pkt, pklen);
+ if (pubkey != NULL)
{
- char *fingerprint = pgpHexStr(keyID, sizeof(keyID));
+ fingerprint = pgpHexStr(pubkey->keyid, sizeof(pubkey->keyid));
if (fingerprint != NULL)
list_fingerprints = g_list_append(list_fingerprints, fingerprint);
+
+ subkeys = rpmGetSubkeys(pubkey, &subkeysCount);
+ for (int i = 0; i < subkeysCount; i++)
+ {
+ rpmPubkey subkey = subkeys[i];
+ if (subkey != NULL)
+ {
+ fingerprint = pgpHexStr(subkey->keyid, sizeof(subkey->keyid));
+ if (fingerprint != NULL)
+ list_fingerprints = g_list_append(list_fingerprints, fingerprint);
+ }
+ rpmPubkeyFree(subkey);
+ }
+ free(subkeys);
}
+
+ rpmPubkeyFree(pubkey);
free(pkt);
#else
return;
--
2.25.1

View File

@ -88,9 +88,9 @@ Patch0009: 0009-lib-Correct-the-syntax-for-gdb-backtrace-command.patch
Patch0024: 0024-dbus-Add-configuration-for-Python3.patch
Patch0025: 0025-daemon-Fix-double-closed-fd-race-condition.patch
#git format-patch 1725bd258 -N --start-number 26 --topo-order
Patch0026: 0026-cli-list-show-a-hint-about-creating-a-case-in-RHTS.patch
Patch0027: 0027-cli-mark-the-suggestion-text-for-translation.patch
Patch0028: 0028-cli-get-list-of-possible-workflows-for-problem_data_.patch
#Patch0026: 0026-cli-list-show-a-hint-about-creating-a-case-in-RHTS.patch
#Patch0027: 0027-cli-mark-the-suggestion-text-for-translation.patch
#Patch0028: 0028-cli-get-list-of-possible-workflows-for-problem_data_.patch
#Patch0029: 0029-spec-Add-explicit-package-version-requirement-of-abr.patch
#git format-patch 2.10.9-10.el8 -N --start-number 30 --topo-order
#Patch030: 0030-testsuite-dbus-element-handling-Use-external-script.patch
@ -166,6 +166,9 @@ Patch0092: 0092-abrt-dump-oops-Fix-vmcore-call-trace-parsing.patch
# autogen.sh is need to regenerate all the Makefile files
Patch1000: 1000-Add-autogen.sh.patch
# AlmaLinux patches
Patch9100: 9100-add_gpg_subkeys_support.patch
BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel
BuildRequires: glib2-devel >= 2.43
@ -227,9 +230,6 @@ Requires: python3-dbus
Requires: dmidecode
%endif
Requires: libreport-plugin-ureport
%if 0%{?rhel}
Requires: libreport-plugin-rhtsupport
%endif
%if 0%{?fedora}
Requires: libreport-plugin-systemd-journal
%endif
@ -538,10 +538,7 @@ Requires: python2-abrt-addon
Requires: python3-abrt-addon
%endif # with python3
Requires: abrt-addon-xorg
%if 0%{?rhel}
Requires: libreport-rhel >= %{libreport_ver}
Requires: libreport-plugin-rhtsupport >= %{libreport_ver}
%else
%if 0%{!?rhel}
Requires: abrt-retrace-client
%if %{with bodhi}
Requires: abrt-plugin-bodhi
@ -582,10 +579,7 @@ Requires: abrt-addon-xorg
Requires: gdb-headless
Requires: abrt-gui
Requires: gnome-abrt
%if 0%{?rhel}
Requires: libreport-rhel >= %{libreport_ver}
Requires: libreport-plugin-rhtsupport >= %{libreport_ver}
%else
%if 0%{!?rhel}
Requires: abrt-retrace-client
%if %{with bodhi}
Requires: abrt-plugin-bodhi
@ -735,7 +729,6 @@ CFLAGS="%{optflags} -Werror" %configure \
%endif
%if 0%{?rhel}
--enable-suggest-autoreporting \
--enable-authenticated-autoreporting \
%endif
%ifnarch %{arm}
--enable-native-unwinder \
@ -1380,6 +1373,10 @@ killall abrt-dbus >/dev/null 2>&1 || :
%config(noreplace) %{_sysconfdir}/profile.d/abrt-console-notification.sh
%changelog
* Wed Sep 25 2024 Eduard Abdullin <eabdullin@almalinux.org> - 2.10.9-24.alma.1
- Disable rhtsupport
- Add support for GPG subkeys
* Thu Feb 16 2023 Matěj Grabovský <mgrabovs@redhat.com> - 2.10.9-24
- Revert part of patch for rhbz#2137499
- Resolves: rhbz#2137499

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (abrt-2.10.9.tar.gz) = aff498ba52402593a853bb1e6d20c2c97137a5643d4f346a4568849d2fb5f3bb231e2c9f5c1f9742e3bb14de18de415ceede080fa089f8aa93955868bb6d5ad0

62
tests/aux/lib.sh Normal file
View File

@ -0,0 +1,62 @@
#!/bin/bash
function check_prior_crashes() {
rlAssert0 "No prior crashes recorded" $(abrt-cli list 2> /dev/null | wc -l)
if [ ! "_$(abrt-cli list 2> /dev/null | wc -l)" == "_0" ]; then
abrt-cli list
rlDie "Won't proceed"
fi
}
function create_custom_event() {
rlLog "Creating custom test event"
cat > /etc/libreport/events.d/test_event.conf << _EOF_
EVENT=notify
echo "ABRT tests - EVENT=notify - $DUMP_DIR"
touch /tmp/abrt-done
true
EVENT=notify-dup
echo "ABRT tests - EVENT=notify-dup - $DUMP_DIR"
touch /tmp/abrt-done
true
_EOF_
}
function remove_custom_event() {
rlLog "Removing custom test event"
rm -f /etc/libreport/events.d/test_event.conf
rm -f /tmp/abrt-done
}
function wait_for_hooks() {
rlLog "Waiting for all hooks to end"
# Wait at least 1 second
sleep 1
local c=0
while [ ! -f "/tmp/abrt-done" ]; do
sleep 0.1
let c=$c+1
if [ $c -gt 3000 ]; then
rlFail "Timeout"
break
fi
done
t=$( echo "scale=2; ($c/10)+1" | bc )
rlLog "Hooks ended in $t seconds"
}
function get_crash_path() {
rlLog "Get crash path"
rlAssertGreater "Crash recorded" $(abrt-cli list 2> /dev/null | wc -l) 0
crash_PATH="$(abrt-cli list 2> /dev/null | grep Directory | awk '{ print $2 }' | tail -n1)"
if [ ! -d "$crash_PATH" ]; then
echo "Dump location listing:"
ls -l $ABRT_CONF_DUMP_LOCATION
echo "abrt-cli list:"
abrt-cli list
echo "Syslog:"
print_syslog 10
rlFail "No crash dir generated, this shouldn't happen"
fi
rlLog "PATH = $crash_PATH"
}

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/abrt/Sanity/cli-ng-sanity
# Description: Test basic abrt-cli-ng funcionality
# Author: Martin Kutlak <mkutlak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/abrt/Sanity/cli-ng-sanity
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Kutlak <mkutlak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test basic abrt-cli-ng funcionality" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: abrt" >> $(METADATA)
@echo "Requires: abrt abrt-cli-ng coreutils libreport-plugin-logger" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of cli-ng-sanity
Description: does sanity on abrt-cli-ng
Author: Richard Marko <rmarko@redhat.com>

View File

@ -0,0 +1,138 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of cli-ng-sanity
# Description: does sanity on abrt-cli-ng
# Author: Richard Marko <rmarko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 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="cli-ng-sanity"
PACKAGE="abrt"
rlJournalStart
rlPhaseStartSetup
LANG=""
export LANG
# Since we send SIGSEGV to sleep(1) and coreutils will be unsigned.
rlRun "augtool set /files/etc/abrt/abrt-action-save-package-data.conf/OpenGPGCheck no" 0
check_prior_crashes
create_custom_event
rlServiceStart abrtd abrt-journal-core
TmpDir=$(mktemp -d)
pushd $TmpDir
rlPhaseEnd
rlPhaseStartTest "--version"
rlRun "abrt -v 2>&1 | grep 'abrt'"
rlRun "abrt --version 2>&1 | grep 'abrt'"
rlPhaseEnd
rlPhaseStartTest "--help"
rlRun "abrt --help" 0
rlRun "abrt --help 2>&1 | grep 'usage: abrt'"
rlPhaseEnd
rlPhaseStartTest "list"
timeout --signal=SEGV 1 sleep 10
wait_for_hooks
get_crash_path
rlRun "abrt list | grep -i 'Id'"
rlRun "abrt list | grep -i 'Component'"
rlRun "abrt list --pretty full | grep -i 'Command line'"
rlPhaseEnd
rlPhaseStartTest "list -n" # list not-reported
rlRun "abrt list -n | grep -i 'Id'"
rlRun "abrt list -n | grep -i 'Component'"
rlPhaseEnd
rlPhaseStartTest "status"
rlRun "abrt status | grep 'has detected 1 problem'"
rlPhaseEnd
rlPhaseStartTest "report NONEXISTENT"
rlRun "abrt report NONEXISTENT" 1
rlPhaseEnd
rlPhaseStartTest "report not-reportable"
rlRun "touch $crash_PATH/not-reportable"
cp $crash_PATH/{type,analyzer} ./
echo "cli_sanity_test_not_reportable" > $crash_PATH/type
echo "cli_sanity_test_not_reportable" > $crash_PATH/analyzer
PROBLEM_ID=$(abrt list --fmt {short_id})
rlRun "abrt report 2>&1 | tee abrt-cli-report-not-reportable.log" 0
rlAssertGrep "Problem '$PROBLEM_ID' cannot be reported" abrt-cli-report-not-reportable.log
cp -f type analyzer $crash_PATH
rlRun "rm -f $crash_PATH/not-reportable"
rlPhaseEnd
rlPhaseStartTest "info DIR"
rlRun "abrt info"
rlRun "abrt info --pretty email > info.out"
rlPhaseEnd
rlPhaseStartTest "list (after reporting)"
DIR=$( abrt list --pretty full | grep 'Path' | head -n1 | awk '{ print $2 }' )
# this should ensure that ABRT will consider the problem as reported
rlRun "reporter-print -r -d $DIR -o /dev/null"
# this expects that reporter-print works and adds an URL to
# the output file to the problem's data
rlRun "abrt list | grep -i 'file:///dev/null'"
rlPhaseEnd
rlPhaseStartTest "list -n (after reporting)" # list not-reported
rlRun "abrt list -n | grep 'No problems'"
rlPhaseEnd
rlPhaseStartTest "info NONEXISTENT"
rlRun "abrt info NONEXISTENT" 1
rlPhaseEnd
rlPhaseStartTest "remove NONEXISTENT"
rlRun "abrt remove NONEXISTENT" 1
rlPhaseEnd
rlPhaseStartTest "remove DIR"
rlRun "abrt remove -f"
rlPhaseEnd
rlPhaseStartCleanup
remove_custom_event
popd # TmpDir
rm -rf $TmpDir
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

63
tests/cli-sanity/Makefile Normal file
View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/abrt/Sanity/cli-sanity
# Description: Test basic abrt-cli funcionality
# Author: Martin Kutlak <mkutlak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/abrt/Sanity/cli-sanity
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Kutlak <mkutlak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test basic abrt-cli funcionality" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: abrt" >> $(METADATA)
@echo "Requires: abrt abrt-cli coreutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

3
tests/cli-sanity/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of cli-sanity
Description: does sanity on abrt-cli
Author: Michal Nowak <mnowak@redhat.com>

210
tests/cli-sanity/runtest.sh Executable file
View File

@ -0,0 +1,210 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of cli-sanity
# Description: does sanity on report-cli
# Author: Michal Nowak <mnowak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2011 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="cli-sanity"
PACKAGE="abrt"
rlJournalStart
rlPhaseStartSetup
LANG=""
export LANG
# Since we send SIGSEGV to sleep(1) and coreutils will be unsigned.
rlRun "augtool set /files/etc/abrt/abrt-action-save-package-data.conf/OpenGPGCheck no" 0
check_prior_crashes
create_custom_event
rlServiceStart abrtd abrt-journal-core
TmpDir=$(mktemp -d)
pushd $TmpDir
rlPhaseEnd
rlPhaseStartTest "--version"
rlRun "abrt-cli --version | grep 'abrt-cli'"
# rlAssertEquals "abrt-cli and abrt-cli RPM claim the same version" "$(abrt-cli -V | awk '{ print $2 }')" "$(rpmquery --qf='%{VERSION}' abrt-cli)"
rlPhaseEnd
rlPhaseStartTest "--help"
rlRun "abrt-cli --help" 0
rlRun "abrt-cli --help 2>&1 | grep 'Usage: abrt-cli'"
rlPhaseEnd
rlPhaseStartTest "list the same as ls"
abrt-cli list &> param_cmd
abrt-cli ls &> param_abbrev
rlAssertNotDiffer param_cmd param_abbrev
rlPhaseEnd
rlPhaseStartTest "remove the same as rm"
abrt-cli remove &> param_cmd
abrt-cli rm &> param_abbrev
rlAssertNotDiffer param_cmd param_abbrev
rlPhaseEnd
rlPhaseStartTest "report the same as e"
abrt-cli report &> param_cmd
abrt-cli e &> param_abbrev
rlAssertNotDiffer param_cmd param_abbrev
rlPhaseEnd
rlPhaseStartTest "info the same as i"
abrt-cli info &> param_cmd
abrt-cli i &> param_abbrev
rlAssertNotDiffer param_cmd param_abbrev
rlPhaseEnd
rlPhaseStartTest "status the same as st"
abrt-cli status &> param_cmd
abrt-cli st &> param_abbrev
rlAssertNotDiffer param_cmd param_abbrev
rlPhaseEnd
rlPhaseStartTest "process the same as p"
abrt-cli process &> param_cmd
abrt-cli p &> param_abbrev
rlAssertNotDiffer param_cmd param_abbrev
rlPhaseEnd
rlPhaseStartTest "list"
timeout --signal=SEGV 1 sleep 10
wait_for_hooks
get_crash_path
rlRun "abrt-cli list | grep -i 'cmdline'"
rlRun "abrt-cli list | grep -i 'Package'"
rlPhaseEnd
rlPhaseStartTest "list -n" # list not-reported
rlRun "abrt-cli list -n | grep -i 'cmdline'"
rlRun "abrt-cli list -n | grep -i 'Package'"
rlPhaseEnd
rlPhaseStartTest "report FAKEDIR"
rlRun "abrt-cli report FAKEDIR" 1
rlPhaseEnd
rlPhaseStartTest "report not-reportable"
rlRun "touch $crash_PATH/not-reportable"
cp $crash_PATH/{type,analyzer} ./
echo "cli_sanity_test_not_reportable" > $crash_PATH/type
echo "cli_sanity_test_not_reportable" > $crash_PATH/analyzer
rlRun "abrt-cli report $crash_PATH 2>&1 | tee abrt-cli-report-not-reportable.log" 0
rlAssertGrep "Problem '$crash_PATH' cannot be reported" abrt-cli-report-not-reportable.log
cp -f type analyzer $crash_PATH
rlRun "rm -f $crash_PATH/not-reportable"
rlPhaseEnd
rlPhaseStartTest "report not-reportable --unsafe parameter"
rlRun "touch $crash_PATH/not-reportable"
cp $crash_PATH/{type,analyzer} ./
echo "cli_sanity_test_not_reportable_unsafe" > $crash_PATH/type
echo "cli_sanity_test_not_reportable_unsafe" > $crash_PATH/analyzer
rlRun "abrt-cli report --unsafe $crash_PATH 2>&1 | tee abrt-cli-report-not-reportable-unsafe.log" 0
rlAssertNotGrep "Problem '$crash_PATH' cannot be reported" abrt-cli-report-not-reportable-unsafe.log
rlAssertGrep "Error: no processing is specified for event 'report-cli'" abrt-cli-report-not-reportable-unsafe.log
cp -f type analyzer $crash_PATH
rlRun "rm -f $crash_PATH/not-reportable"
rlPhaseEnd
# This test used to select 1st analyzer (Local GNU Debugger)
# and run it, then "edit" data with cat (this merely prints data to stdout)
# and terminate. This was far from reliable (what if analyzer would change?).
#
# With the changed CLI, it probably can be emulated by running
# "report-cli -e analyze_LocalGDB $DIR"
# ...except that analyze_LocalGDB has <gui-review-elements>no</gui-review-elements>!
# Need to think about this...
#
#rlPhaseStartTest "report DIR"
# DIR=$(abrt-cli list -n | grep 'Directory' | head -n1 | awk '{ print $2 }')
# echo -e "1\n" | VISUAL="cat" EDITOR="cat" abrt-cli report $DIR > output.out 2>&1
#
# rlAssertGrep "\-cmdline" output.out
# rlAssertGrep "\-kernel" output.out
#rlPhaseEnd
rlPhaseStartTest "info DIR"
DIR=$(abrt-cli list | grep 'Directory' | head -n1 | awk '{ print $2 }')
rlRun "abrt-cli info $DIR"
rlRun "abrt-cli info -d $DIR > info.out"
rlPhaseEnd
rlPhaseStartTest "list (after reporting)"
DIR=$(abrt-cli list | grep 'Directory' | head -n1 | awk '{ print $2 }')
# this should ensure that ABRT will consider the problem as reported
rlRun "reporter-print -r -d $DIR -o /dev/null"
rlRun "abrt-cli list | grep -i 'cmdline'"
rlRun "abrt-cli list | grep -i 'Package'"
# this expects that reporter-print works and adds an URL to
# the output file to the problem's data
rlRun "abrt-cli list | grep -i 'file:///dev/null'"
rlPhaseEnd
rlPhaseStartTest "list -n (after reporting)" # list not-reported
BYTESNUM=$(abrt-cli list -n | wc -c)
rlAssert0 "No not-reported problem" "$BYTESNUM"
rlPhaseEnd
rlPhaseStartTest "info FAKEDIR"
rlRun "abrt-cli info FAKEDIR" 1
rlRun "abrt-cli info -d FAKEDIR" 1
rlPhaseEnd
rlPhaseStartTest "rm FAKEDIR"
rlRun "abrt-cli rm FAKEDIR" 1
rlPhaseEnd
rlPhaseStartTest "rm DIR"
DIR_DELETE=$(abrt-cli list | grep 'Directory' | head -n1 | awk '{ print $2 }')
rlRun "abrt-cli rm $DIR_DELETE"
rlPhaseEnd
rlPhaseStartCleanup
remove_custom_event
popd # TmpDir
rm -rf $TmpDir
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

16
tests/tests.yml Normal file
View File

@ -0,0 +1,16 @@
---
# Tests that run in all contexts
- hosts: localhost
become: true
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- cli-sanity
- cli-ng-sanity
required_packages:
- augeas # unsetting OpenGPGCheck in the config
- libreport-plugin-logger # cli-ng-sanity requires
- coreutils # tests require sleep, timeout
- bc # bc command in timeout