QA:Testcase ABRT python addon

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(proof)
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 [[Features/ABRT|ABRT]] Python exception handler.
 
|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|su -c 'yum 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>
+
# 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>
# Restart service <pre>service abrtd restart</pre>
+
# 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>
# 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>
+
# 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-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/}}
 
# Now, edit the file {{filename|/usr/share/doc/smolt-1.?/lite2my.py}} to contain some invalid Python code.  For example,
 
# Now, edit the file {{filename|/usr/share/doc/smolt-1.?/lite2my.py}} to contain some invalid Python code.  For example,
 
#: <pre>#!/usr/bin/python
 
#: <pre>#!/usr/bin/python
 
#: "11" + 11</pre>
 
#: "11" + 11</pre>
# Next, execute the modified file using python.  For example, in terminal type: <pre>python /usr/share/doc/smolt-1.?/lite2my.py</pre>
+
# Next, execute the modified file using python.  For example, in terminal type: {{command|python /usr/share/doc/smolt-1.?/lite2my.py}}
# Revert the modified python file <pre>cp /tmp/lite2my.py /usr/share/doc/smolt-1.?/lite2my.py</pre>
+
# Revert the modified python file: {{command|cp /tmp/lite2my.py /usr/share/doc/smolt-1.?/lite2my.py}}
 
|results=
 
|results=
 
# Python traceback should be generated
 
# Python traceback should be generated
# ABRT catches it, check the report via ''abrt-gui'' whether the trace in report window is the same as in terminal
+
# 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 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.
+
# The ABRT plugin should not cause any unintended behaviour in python scripts when installed
 
}}
 
}}
 
[[Category:ABRT_Test_Cases]]
 
[[Category:ABRT_Test_Cases]]

Revision as of 05:50, 1 April 2010

Description

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


How to test

  1. Ensure the package is installed: su -c 'yum install abrt-addon-python'
  2. Confirm in /etc/abrt/plugins/Python.conf that the Python addon is enabled. The conf file should contain this line: Enabled = Yes
  3. Next, ensure that /etc/abrt/abrt.conf has at least one reporter defined for the Python addon. For example, Python = Logger, Mailx
  4. Restart ABRT with the command su -c 'service abrtd restart'
  5. Find a python .py file which is part of an official Fedora package. For example, /usr/share/doc/smolt-1.?/lite2my.py which is provided by the Package-x-generic-16.pngsmolt package. First, save a back-up of the file: cp /usr/share/doc/smolt-1.?/lite2my.py /tmp/
  6. Now, edit the file /usr/share/doc/smolt-1.?/lite2my.py to contain some invalid Python code. For example,
    #!/usr/bin/python
    
    "11" + 11
  7. Next, execute the modified file using python. For example, in terminal type: python /usr/share/doc/smolt-1.?/lite2my.py
  8. Revert the modified python file: cp /tmp/lite2my.py /usr/share/doc/smolt-1.?/lite2my.py

Expected Results

  1. Python traceback should be generated
  2. 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
  3. The ABRT plugin should not cause any unintended behaviour in python scripts when installed