From Fedora Project Wiki
(convert to new category system) |
No edit summary |
||
Line 1: | Line 1: | ||
{{QA/Test_Case | {{QA/Test_Case | ||
|description=This test case tests the functionality of the | |description=This test case tests the functionality of the ABRT Python exception handler. | ||
|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'}} | ||
# 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> | # 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> | ||
# Next, ensure that {{filename|/etc/abrt/ | # Next, ensure that {{filename|/etc/abrt/abrt_event.conf}} has at least one reporter defined for the '''Python''' addon. For example, <tt>EVENT=post-create analyzer=Python abrt-action-analyze-python</tt> | ||
# Comment out <tt>BlackListedPaths = ...</tt> in {{filename|/etc/abrt/abrt.conf}} | |||
# Restart ABRT with the command {{command|su -c 'service abrtd restart'}} | # Restart ABRT with the command {{command|su -c 'service abrtd restart'}} | ||
# Find a python {{filename|.py}} file which is part of an official Fedora package. For example, {{filename|/usr/share/doc/smolt- | # Find a python {{filename|.py}} file which is part of an official Fedora package. For example, {{filename|/usr/share/doc/smolt-*/lite2my.py}} which is provided by the {{package|smolt}} package. First, save a back-up of the file: {{command|su -c 'cp -a /usr/share/doc/smolt-*/lite2my.py /tmp/'}} | ||
# Now, edit the file {{filename|/usr/share/doc/smolt- | # Now, edit the file {{filename|/usr/share/doc/smolt-*/lite2my.py}} to contain some invalid Python code. For example, | ||
#: #!/usr/bin/python | #: #!/usr/bin/python | ||
#: "11" + 11 | #: "11" + 11 | ||
# Next, execute the modified file using python. For example, in terminal type: {{command|python /usr/share/doc/smolt- | # Next, execute the modified file using python. For example, in terminal type: {{command|python /usr/share/doc/smolt-*/lite2my.py}} | ||
# Revert the modified python file: {{command|su -c 'cp -a /tmp/lite2my.py /usr/share/doc/smolt-1.*/lite2my.py'}} | # Revert the modified python file: {{command|su -c 'cp -a /tmp/lite2my.py /usr/share/doc/smolt-1.*/lite2my.py'}} or reinstall {{package|smolt}} package. | ||
|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/share/doc/smolt-1.4. | #: File "/usr/share/doc/smolt-1.4.3/lite2my.py", line 2, in <module> | ||
#: print "11" + 11 | #: print "11" + 11 | ||
#: TypeError: cannot concatenate 'str' and 'int' objects | #: TypeError: cannot concatenate 'str' and 'int' objects | ||
# 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 08:56, 15 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'
- Confirm in
/etc/abrt/plugins/Python.conf
that the Python addon is enabled. The conf file should contain this line: Enabled = Yes - Next, ensure that
/etc/abrt/abrt_event.conf
has at least one reporter defined for the Python addon. For example, EVENT=post-create analyzer=Python abrt-action-analyze-python - Comment out BlackListedPaths = ... in
/etc/abrt/abrt.conf
- Restart ABRT with the command
su -c 'service abrtd restart'
- Find a python
.py
file which is part of an official Fedora package. For example,/usr/share/doc/smolt-*/lite2my.py
which is provided by thesmolt
package. First, save a back-up of the file:su -c 'cp -a /usr/share/doc/smolt-*/lite2my.py /tmp/'
- Now, edit the file
/usr/share/doc/smolt-*/lite2my.py
to contain some invalid Python code. For example,- #!/usr/bin/python
- "11" + 11
- Next, execute the modified file using python. For example, in terminal type:
python /usr/share/doc/smolt-*/lite2my.py
- Revert the modified python file:
su -c 'cp -a /tmp/lite2my.py /usr/share/doc/smolt-1.*/lite2my.py'
or reinstallsmolt
package.
Expected Results
- A python traceback should be generated at the command line:
- Traceback (most recent call last):
- File "/usr/share/doc/smolt-1.4.3/lite2my.py", line 2, in <module>
- print "11" + 11
- TypeError: cannot concatenate 'str' and 'int' objects
- 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