Skip to content

Commit

Permalink
testsuite: add ccpp-plugin-hook-unwind
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
  • Loading branch information
sorki committed Jul 1, 2015
1 parent 58c4398 commit f83fe5d
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/runtests/aux/test_order
Expand Up @@ -20,6 +20,7 @@ abrt-auto-reporting-sanity
ccpp-plugin
ccpp-plugin-java
ccpp-plugin-config
ccpp-plugin-hook-unwind
python-addon
python3-addon

Expand Down
1 change: 1 addition & 0 deletions tests/runtests/aux/test_order.rhel7
Expand Up @@ -21,6 +21,7 @@ abrt-auto-reporting-sanity-authenticated
ccpp-plugin
ccpp-plugin-java
ccpp-plugin-config
ccpp-plugin-hook-unwind
python-addon

# - tools tests
Expand Down
3 changes: 3 additions & 0 deletions tests/runtests/ccpp-plugin-hook-unwind/PURPOSE
@@ -0,0 +1,3 @@
PURPOSE of ccpp-plugin-hook-unwind
Description: Tests ccpp-plugin's unwinding from core hook
Author: Richard Marko <rmarko@redhat.com>
91 changes: 91 additions & 0 deletions tests/runtests/ccpp-plugin-hook-unwind/runtest.sh
@@ -0,0 +1,91 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of ccpp-plugin-hook-unwind
# Description: Tests ccpp-plugin's unwinding from core hook
# Author: Richard Marko <rmarko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

. /usr/share/beakerlib/beakerlib.sh
. ../aux/lib.sh

TEST="ccpp-plugin-hook-unwind"
PACKAGE="abrt"

CFG_FILE="/etc/abrt/plugins/CCpp.conf"

rlJournalStart
rlPhaseStartSetup
check_prior_crashes

old_ulimit=$(ulimit -c)
rlRun "ulimit -c unlimited" 0

TmpDir=$(mktemp -d)
pushd $TmpDir

rlFileBackup $CFG_FILE
rlPhaseEnd

rlPhaseStartTest "CreateCoreBacktrace enabled"
rlLogInfo "CreateCoreBacktrace = yes"
rlRun "echo 'CreateCoreBacktrace = yes' > $CFG_FILE" 0 "Set CreateCoreBacktrace = yes"

prepare
generate_crash
get_crash_path
wait_for_hooks

rlAssertExists "$crash_PATH/core_backtrace"
rlAssertExists "$crash_PATH/coredump"

rlRun "abrt-cli rm $crash_PATH" 0 "Remove crash directory"
rlPhaseEnd

rlPhaseStartTest "SaveFullCore disabled"
rlLogInfo "CreateCoreBacktrace = yes"
rlLogInfo "SaveFullCore = no"
rlRun "echo 'CreateCoreBacktrace = yes' > $CFG_FILE" 0 "Set CreateCoreBacktrace = yes"
rlRun "echo 'SaveFullCore = no' >> $CFG_FILE" 0 "Set SaveFullCore = no"

prepare
generate_crash
get_crash_path
wait_for_hooks

rlAssertExists "$crash_PATH/core_backtrace"
rlAssertNotExists "$crash_PATH/coredump"

rlRun "abrt-cli rm $crash_PATH" 0 "Remove crash directory"
rlPhaseEnd

rlPhaseStartCleanup
rlFileRestore # CFG_FILE

rlRun "ulimit -c $old_ulimit" 0

popd # TmpDir
rm -rf $TmpDir
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

0 comments on commit f83fe5d

Please sign in to comment.