From Fedora Project Wiki

(proof)
No edit summary
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=This test case tests the functionality of the [[Features/ABRT|ABRT]] Python exception handler.
|description=This test case tests the functionality of the ABRT Python exception handler.
|setup=Install will-crash
|actions=
|actions=
# Ensure the package is installed: {{command|su -c 'yum install abrt-addon-python'}}
# Ensure the package is installed: {{command|sudo dnf install abrt-addon-python}}
# Confirm in {{filename|/etc/abrt/plugins/Python.conf}} that the '''Python''' addon is enabled. The conf file should contain this line: <tt>Enabled = Yes</tt>
# Generate an uncaught python exception: {{command|will_python_raise}}
# Next, ensure that {{filename|/etc/abrt/abrt.conf}} has at least one reporter defined for the '''Python''' addon. For example, <tt>Python = Logger, Mailx</tt>
# A python traceback should be generated at the command line:
# Restart ABRT with the command {{command|su -c 'service abrtd restart'}}
<pre>
# Find a python {{filename|.py}} file which is part of an official Fedora package. For example, {{filename|/usr/share/doc/smolt-1.?/lite2my.py}} which is provided by the {{package|smolt}} package. First, save a back-up of the file: {{command|cp /usr/share/doc/smolt-1.?/lite2my.py /tmp/}}
Will raise.
# Now, edit the file {{filename|/usr/share/doc/smolt-1.?/lite2my.py}} to contain some invalid Python code.  For example,
Traceback (most recent call last):
#: <pre>#!/usr/bin/python
  File "/bin/will_python_raise", line 3, in <module>
#: "11" + 11</pre>
    0/0
# Next, execute the modified file using python.  For example, in terminal type: {{command|python /usr/share/doc/smolt-1.?/lite2my.py}}
ZeroDivisionError: integer division or modulo by zero
# Revert the modified python file: {{command|cp /tmp/lite2my.py /usr/share/doc/smolt-1.?/lite2my.py}}
</pre>
|results=
|results=
# Python traceback should be generated
# ABRT should catch the traceback, and if you inspect the report via {{command|gnome-abrt}}, the trace in report window should be the same as in the terminal where you executed the command
# ABRT should catch the traceback, and if you inspect the report via {{command|abrt-gui}}, the trace in report window should be the same as in the terminal where you executed the command
# The ABRT plugin should not cause any unintended behaviour in python scripts when installed
# The ABRT plugin should not cause any unintended behaviour in python scripts when installed
}}
}}
[[Category:ABRT_Test_Cases]]
[[Category:Package_abrt_test_cases]]

Latest revision as of 11:52, 10 April 2015

Description

This test case tests the functionality of the ABRT Python exception handler.

Setup

Install will-crash

How to test

  1. Ensure the package is installed: sudo dnf install abrt-addon-python
  2. Generate an uncaught python exception: will_python_raise
  3. A python traceback should be generated at the command line:
Will raise.
Traceback (most recent call last):
  File "/bin/will_python_raise", line 3, in <module>
    0/0
ZeroDivisionError: integer division or modulo by zero

Expected Results

  1. ABRT should catch the traceback, and if you inspect the report via gnome-abrt, the trace in report window should be the same as in the terminal where you executed the command
  2. The ABRT plugin should not cause any unintended behaviour in python scripts when installed