From Fedora Project Wiki

(updated to match current abrt)
No edit summary
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=This test case tests the functionality of the 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 yum install abrt-addon-python}}
# Find a python {{filename|.py}} file which is part of an official Fedora package. For example, {{filename|/usr/bin/pydoc}} which is provided by the {{package|python}} package. Other files you might use for experiments: /usr/bin/pygtk-demo, /usr/bin/yum, /usr/bin/fetch_file
# Generate an uncaught python exception: {{command|will_python_raise}}
# Make a back-up of the file: {{command|su -c 'cp -a /usr/bin/pydoc /usr/bin/pydoc.save'}}
# A python traceback should be generated at the command line:
# Edit the file to contain some invalid Python code.  Add "0/0" (without quotes) line near the top (after the line which begins with ''#'').
<pre>
# Execute the modified file.
Will raise.
# Revert the modified python file: {{command|su -c 'cp -a /usr/bin/pydoc.save /usr/bin/pydoc'}}
Traceback (most recent call last):
  File "/bin/will_python_raise", line 3, in <module>
    0/0
ZeroDivisionError: integer division or modulo by zero
</pre>
|results=
|results=
# A python traceback should be generated at the command line:
#:Traceback (most recent call last):
#:  File "/usr/bin/pydoc", line 3, in <module>
#:    0/0
# 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|gnome-abrt}}, 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:Package_abrt_test_cases]]
[[Category:Package_abrt_test_cases]]

Revision as of 10:22, 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 yum 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