From Fedora Project Wiki

No edit summary
No edit summary
 
(14 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=Check that the ''abrt'' handles Python exceptions.
|description=This test case tests the functionality of the ABRT Python exception handler.
|setup=Install will-crash
|actions=
|actions=
# First, confirm in {{filename|/etc/abrt/plugins/Python.conf}} that the '''Python''' addon is enabled. The conf file should contain this line: <pre>Enabled = Yes</pre>
# Ensure the package is installed: {{command|sudo dnf install abrt-addon-python}}
# Next, ensure that {{filename|/etc/abrt/abrt.conf}} has at least one reporter defined for the '''Python''' addon.  For example, <pre>Python = Logger, Mailx</pre>
# Generate an uncaught python exception: {{command|will_python_raise}}
# Restart service <pre>service abrtd restart</pre>
# A python traceback should be generated at the command line:
# Find a python {{filename|.py}} file in system originally installed via RPM.  For this test, we will choose {{filename|/usr/share/doc/smolt-1.?/lite2my.py}} which is provided by the {{package|smolt}} package. First, save a back-up of the file: <pre>cp /usr/share/doc/smolt-1.?/lite2my.py /tmp/</pre>
<pre>
# Now, edit the file {{filename|/usr/share/doc/smolt-1.?/lite2my.py}} to contain some invalid Python code. For example,
Will raise.
#: <pre>#!/usr/bin/python
Traceback (most recent call last):
#: "11" + 11</pre>
  File "/bin/will_python_raise", line 3, in <module>
# Next, execute the modified file using python.  For example, in terminal type: <pre>python /usr/share/doc/smolt-1.?/lite2my.py</pre>
    0/0
# Revert the modified python file <pre>cp /tmp/lite2my.py /usr/share/doc/smolt-1.?/lite2my.py</pre>
ZeroDivisionError: integer division or modulo by zero
</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 catches it, check the report via ''abrt-gui'' whether the trace in report window is the same as in terminal
# The ABRT plugin should not cause any unintended behaviour in python scripts when installed
# The python is run with every python script, so any bug in the hook may have bad consequences for all python app. So please pay attention to any weird behaviour of python scripts
after abrt's pyhook is 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