Current Path : /usr/share/apport/testsuite/ |
Current File : //usr/share/apport/testsuite/test_crash_digger.pyc |
ó ˆ5„Oc @ su d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d e j f d „ ƒ YZ e j ƒ d S( s Test crash-diggeriÿÿÿÿNt Tc B sY e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( c C s^ t j ƒ | _ t j j | j d ƒ } t | d ƒ j d t j j | j d ƒ ƒ t j j | j d ƒ | _ t j | j ƒ t j t j j | j d ƒ ƒ t j t j j | j d ƒ ƒ t j j | j d ƒ | _ t j j | j d ƒ | _ t | j d ƒ j d | j ƒ t j | j d ƒ t j j | j d ƒ | _ | t j d <d t j d <d S( s9 Set up dummy config dir, crashdb.conf, and apport-retraces crashdb.conft ws‚ default = 'memory' databases = { 'memory': { 'impl': 'memory', 'distro': 'Testux', 'dummy_data': '1', 'dupdb_url': '%s'} }t dupdbt configs Testux 1.0s Testux 2.2s apport-retrace.logs apport-retraces #!/bin/sh echo "$@" >> %sií t lockt APPORT_CRASHDB_CONFt .t PYTHONPATHN( t tempfilet mkdtempt workdirt ost patht joint opent writet config_dirt mkdirt apport_retrace_logt apport_retracet chmodt lock_filet environ( t selft crashdb_conf( ( s0 /usr/share/apport/testsuite/test_crash_digger.pyt setUp s c C s t j | j ƒ d S( N( t shutilt rmtreeR ( R ( ( s0 /usr/share/apport/testsuite/test_crash_digger.pyt tearDown- s c C sM t j d d | j g | d t j d t j ƒ} | j ƒ \ } } | | f S( sY Call crash-digger with given arguments. Return a pair (stdout, stderr). s crash-diggers --apport-retracet stdoutt stderr( t subprocesst PopenR t PIPEt communicate( R t argst st outt err( ( s0 /usr/share/apport/testsuite/test_crash_digger.pyt call0 s c C s² | j d | j d d d t j j | j d ƒ d | j g ƒ \ } } | j | d d | ƒ | j d | k ƒ | j d | k ƒ | j d | k ƒ | j d | k ƒ | j d | k ƒ | j d | k ƒ | j d | k d ƒ | j d | k d ƒ t | j ƒ j ƒ } | j t | j ƒ ƒ d ƒ | j d | k ƒ | j d | k ƒ | j d | k ƒ | j t j j | j ƒ ƒ | j t j j t j j | j d d ƒ ƒ ƒ d S( s Crash retracings -cs -as /dev/zeros -ds dup.dbs -vlt s no error messages: s0 Available releases: ['Testux 1.0', 'Testux 2.2']s retracing #0s retracing #1s retracing #2sE crash is release FooLinux Pi/2 which does not have a config availables failed with statuss #3s! dupcheck crashes are not retraceds #4i s dup.db -v 0 s dup.db -v 1 s dup.db -v 2 R t sigN( R' R R R R R R t assertEqualt assertTruet assertFalseR R t readt lent splitlinest existst isdir( R R% R&