From Fedora Project Wiki

Revision as of 23:34, 1 April 2010 by Dmalcolm (talk | contribs) (tweak layout to avoid confusion about indentation, and specify you're expecting a TypeError; see


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.*/ which is provided by the Package-x-generic-16.pngsmolt package. First, save a back-up of the file: su -c 'cp -a /usr/share/doc/smolt-1.*/ /tmp/'
  6. Now, edit the file /usr/share/doc/smolt-1.*/ to contain some invalid Python code. For example,
    "11" + 11
  7. Next, execute the modified file using python. For example, in terminal type: python /usr/share/doc/smolt-1.*/
  8. Revert the modified python file: su -c 'cp -a /tmp/ /usr/share/doc/smolt-1.*/'

Expected Results

  1. A python traceback should be generated at the command line:
    Traceback (most recent call last):
    File "/usr/share/doc/smolt-", line 2, in <module>
    print "11" + 11
    TypeError: cannot concatenate 'str' and 'int' objects
  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