From Fedora Project Wiki
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
|actions= | |actions= | ||
# Ensure the package is installed: {{command|su -c 'yum install abrt-addon-python'}} | # Ensure the package is installed: {{command|su -c '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. | |||
# Make a back-up of the file: {{command|su -c 'cp -a /usr/bin/pydoc /usr/bin/pydoc.save'}} | |||
# Edit the file to contain some invalid Python code. For example, add "'11' + 11" or "0/0" line. | |||
# Execute the modified file. | |||
# Find a python {{filename|.py}} file which is part of an official Fedora package. For example, {{filename|/usr/ | # Revert the modified python file: {{command|su -c 'cp -a /usr/bin/pydoc.save /usr/bin/pydoc'}} | ||
# | |||
# | |||
# Revert the modified python file: {{command|su -c 'cp -a / | |||
|results= | |results= | ||
# A python traceback should be generated at the command line: | # A python traceback should be generated at the command line: | ||
#: Traceback (most recent call last): | #: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|abrt-gui}}, 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:Package_abrt_test_cases]] | [[Category:Package_abrt_test_cases]] |
Revision as of 15:57, 16 March 2011
Description
This test case tests the functionality of the ABRT Python exception handler.
How to test
- Ensure the package is installed:
su -c 'yum install abrt-addon-python'
- Find a python
.py
file which is part of an official Fedora package. For example,/usr/bin/pydoc
which is provided by thepython
package. - Make a back-up of the file:
su -c 'cp -a /usr/bin/pydoc /usr/bin/pydoc.save'
- Edit the file to contain some invalid Python code. For example, add "'11' + 11" or "0/0" line.
- Execute the modified file.
- Revert the modified python file:
su -c 'cp -a /usr/bin/pydoc.save /usr/bin/pydoc'
Expected 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
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