ó ‰P[c@sOddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ej jdƒr¾ejddƒjZnddlmZd„Zee_dejfd „ƒYZy>ejd d gd ejd ejƒdkr6ejƒnWnek rJnXdS(iÿÿÿÿN(tapt_pkgtAPPORT_TEST_LOCALtsbackends/packaging-apt-dpkg.py(timplcCs•tjjdƒrtStjdkrŽtt_y=tjj dddƒ}|j ƒj dƒrjt t_nWqŽt tjjfk rŠqŽXntjS(s¶Return if there is sufficient network connection for the tests. This checks if http://ddebs.ubuntu.com/ can be downloaded from, to check if we can run the online tests. tSKIP_ONLINE_TESTSs.http://ddebs.ubuntu.com/dbgsym-release-key.ascttimeoutis-----BEGIN PGPN(tostenvirontgettFalset _has_internettcachetNoneturllibtrequestturlopentreadlinet startswithtTruetIOErrorterrortURLError(tf((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyR s tTcBs÷eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zejeƒdƒd„ƒZejeƒdƒd„ƒZejeƒdƒd„ƒZejeƒdƒd„ƒZejeƒdƒd„ƒZ ejeƒdƒd„ƒZ!ejeƒdƒej"e#j$ƒdkdƒd „ƒƒZ%ejeƒdƒd!„ƒZ&d"„Z'd#„Z(RS($cCshtj|_tjƒ|_dt_dt_ytj dƒt |_ Wnt k rct |_ nXdS(Nscoreutils-dbgsym(Rt configurationt orig_confttempfiletmkdtemptworkdirR t _apt_cachet_sandbox_apt_cachetget_available_versionRt has_dbgsymt ValueErrorR (tself((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pytsetUp!s      cCs |jt_tj|jƒdS(N(RRRtshutiltrmtreeR(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttearDown/s cCs=tjƒ}ztjj|dƒ}tjj|dƒ}tjj|dƒ}t|dƒ}|jdƒWdQXt|dƒ}|jdƒWdQXt|dƒN}|jd |d jƒd ƒ|jd |jƒd ƒ|jd ƒWdQX|jt j |ƒgdƒt|dƒ}|jdƒWdQX|jt j |ƒ|d gdƒt|dƒ}|jdƒWdQX|jt j |ƒ|d |gdƒt|dƒ}|jdƒWdQX|jt j |ƒ|gdƒt|dƒ,}|jt j |j ƒƒ|gdƒWdQXWdt j |ƒXdS(s_check_files_md5().s test 1.txts test:2.txtssums.txttws Some stuffNs More stufftwbs"2e41290da2fa3f68bd3313174467e3b5 is s"f6423dfbc4faf022e58b4d3f5ff71a70 s)deadbeef000001111110000011110000 /bin/äscorrect md5sumss Some stuff!s file 1 wrongs More stuff!sfiles 1 and 2 wrongs file 2 wrongtrb(RRRtpathtjointopentwritetencodet assertEqualRt_check_files_md5treadR$R%(R"ttdtf1tf2tsumfiletfd((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_check_files_md53s6 #&cCsO|jtjdƒjdƒƒ|jttjdƒ|jttjdƒdS(sget_version().tlibc6t2t nonexistingt wukrainianN(t assertTrueRt get_versionRt assertRaisesR!(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_versionXscCs9|jtjdƒjdƒƒ|jttjdƒdS(sget_available_version().R8R9R:N(R<RRRR>R!(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_available_version_scCstjdƒ}|jt|ƒdkƒ|jd|kƒx$|D]}|jtj|ƒƒqBWtjdƒ}|jt|ƒdkƒ|jd|kƒx$|D]}|jtj|ƒƒq¤Wtjdƒ}|jt|ƒdkƒx$|D]}|jtj|ƒƒqóWdS(sget_dependencies().tbashiR8t coreutilsiN(Rtget_dependenciesR<tlenR=(R"tdtdep((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_dependencieses   cCsO|jttjdƒ|jtjdƒdƒ|jdtjdƒkƒdS(s get_source().R:RAtglibcR8N(R>R!Rt get_sourceR/R<(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_source|scCsYtjƒd}|jttjdƒ|jttjdƒ|jtjdƒ|ƒdS(sget_package_origin().iR:s robocode-docRAN(Rtget_os_versionR>R!tget_package_originR/(R"tdistro((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_package_originƒscCs0|jttjdƒ|jtjdƒƒdS(sis_distro_package().R:RAN(R>R!Rtis_distro_packageR<(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_is_distro_packagescCs‚|jttjdƒtjddgdtjƒ}|jƒdjƒj ƒ}|j dkset ‚|j tjdƒ|ƒdS(sget_architecture().R:tdpkgs--print-architecturetstdoutiRAN( R>R!Rtget_architecturet subprocesstPopentPIPEt communicatetdecodetstript returncodetAssertionErrorR/(R"REt system_arch((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_architecture—s  cCs6|jttjdƒ|jdtjdƒkƒdS(s get_files().R:s /bin/bashRAN(R>R!Rt get_filesR<(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_files¢scCsh|jtjdƒdƒ|jtjdƒdƒ|jtjdƒdƒ|jtjdƒdƒdS( s&get_file_package() on installed files.s /bin/bashRAs/bin/catRBs/etc/blkid.tabt libblkid1s /nonexistingN(R/Rtget_file_packageR (R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_file_package¨scCs#tjƒ}ztjj|dtjƒƒ}tj|ƒtj tjj|dtj ƒƒdƒ}|j dƒWdQXtjj|dtjƒdƒ}tj|ƒtj tjj|dtj ƒƒdƒ}|j dƒWdQXtj d|ƒ|j tjd tƒdƒ|j tjd tƒd ƒ|j tjd tƒd ƒ|j tjd tƒdƒ|j tjd tƒd ƒtj dƒ|jttjd tƒtj d|ƒtjj|dƒ}tj|ƒ|j tjd t|ƒd ƒtj|ƒ}|j t|ƒdƒ|j tjdt|ƒdƒtj dƒ|j tjdt|ƒdƒ|j tjd t|ƒd ƒd|dkr¬|d}n |d}ttjƒƒ}tjtjj||ƒ||dfƒ|jttjdt|ƒWdtj|ƒXdS(s+get_file_package() on uninstalled packages.tdistssContents-%s.gzR's foo header FILE LOCATION usr/bin/frobnicate foo/frob usr/bin/frob foo/frob-utils bo/gu/s na/mypackage Ns-updatess› foo header FILE LOCATION lib/libnew.so.5 universe/libs/libnew5 sfile://s usr/bin/frobs frob-utilss /usr/bin/frobs/lib/libnew.so.5tlibnew5sfile:///foo/nonexistingR is/bo/gu/st mypackagetupdatesiii_(RRRR*R+Rtget_distro_codenametmakedirstgzipR,tget_system_architectureR-t set_mirrorR/RaR R RR>RtmkdirtlistdirRDtintttimetutimeR$R%(R"tbasedirtmapdirRt cache_dirtcache_dir_filest cache_filetnow((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyt!test_get_file_package_uninstalled°sN   "       ) c Csˆtj}d„t_tjƒ}zItjj|dtjƒƒ}tj|ƒt j tjj|dƒdƒ}|j dƒWdQXt j tjj|dƒdƒ}|j dƒWdQXtj tjj|dd ƒƒt j tjj|dd dƒdƒ}|j d ƒWdQXtj d |ƒ|jtjd tƒdƒ|jtjd td dƒdƒ|jtjd td dƒdƒ|jtjdtd dƒdƒ|jtjdtd dƒdƒ|jtjdtd dƒdƒ|jtjdtddd dƒdƒ|jtjdtddd dƒdƒ|jtjdtddd dƒdƒtj dƒ|jttjdtd dƒ|jttjdtddd dƒtj d |ƒtjj|dƒ}tj |ƒ|jtjdt|d dƒdƒ|jttj|ƒƒdƒtj|ƒd}|jtjdt|ddd dƒdƒ|jttj|ƒƒdƒtj dƒ|jtjd t|d dƒdƒ|jtjd t|ddd dƒdƒ|jttjd t|d dƒttjƒƒ}tjtjj||ƒ||dfƒ|jttjd t|d dƒWdtj|ƒ|t_XdS( s1get_file_package() on foreign arches and releasescSs|dkrdpdS(Ns Foonux 3.14tmocky(R (tr((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pytýsRcsContents-even.gzR'sÙ foo header FILE LOCATION usr/lib/even/libfrob.so.1 foo/libfrob1 usr/bin/frob foo/frob-utils NsContents-odd.gzsÙ foo header FILE LOCATION usr/lib/odd/libfrob.so.1 foo/libfrob1 usr/bin/frob foo/frob-utils RxsÓ foo header FILE LOCATION usr/lib/even/libfrob.so.0 foo/libfrob0 usr/bin/frob foo/frob sfile://s usr/bin/frobtarchtevens frob-utilstodds/usr/lib/even/libfrob.so.1tlibfrob1s/usr/lib/odd/libfrob.so.1treleases Foonux 3.14s/usr/lib/even/libfrob.so.0tlibfrob0s /usr/bin/frobtfrobsfile:///foo/nonexistingR iiii_(Rt_distro_release_to_codenameRRRR*R+RgRhRiR,R-RlRkR/RaR R RR>RRDRmRnRoRpR$R%(R"torig_distro_release_to_codenameRqRrRRsRuRv((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyt+test_get_file_package_uninstalled_multiarchøsˆ    $ $ *     ) cCs•tjddtdtjƒ}|jƒdjdƒ}|jdksLt‚|sXt‚|jƒ}|d}|d}|j t j |ƒ|ƒdS( s'get_file_package() for a diverted file.s'LC_ALL=C dpkg-divert --list | head -n 1tshellRRisUTF-8iiÿÿÿÿN( RTRURRVRWRXRZR[tsplitR/RRa(R"tptouttfieldstfiletpkg((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_file_package_diversionfs     cCsätjj|jdƒ}t|dƒ7}|jdƒ|jƒ|jtj |ƒdƒWdQXt|dƒ7}|jdƒ|jƒ|jtj |ƒdƒWdQXt|dƒ}|jƒWdQX|j t tj |ƒdS(Ns sources.listR's‰# some comment deb-src http://source.mirror/foo tuxy main deb http://binary.mirror/tuxy tuxy main deb http://secondary.mirror tuxy extra shttp://binary.mirror/tuxysŸ# some comment deb-src http://source.mirror/foo tuxy main deb [arch=flowerpc,leghf] http://binary.mirror/tuxy tuxy main deb http://secondary.mirror tuxy extra ( RR*R+RR,R-tflushR/Rt$_get_primary_mirror_from_apt_sourcesR>t SystemError(R"tsR((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_mirror_from_apt_sourcesus     cCss|jttjdƒƒtiƒƒ|jttjdƒƒtiƒƒ|jttjdƒƒtiƒƒdS(sget_modified_conffiles()RAtapportR:N(R/ttypeRtget_modified_conffiles(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_modified_conffiles“s%%cCs3tjƒ}|j|dƒ|jd|kƒdS(sget_system_architecture().Rs N(RRjtassertNotEqualR<(R"R{((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_system_architecture›s cCsYtjƒ}|j|dƒ|jd|kƒ|jd|kƒ|jd|kƒdS(sget_library_paths().Rt:s/libs N(Rtget_library_pathsR–R<(R"tpaths((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_library_paths£s  cCs¬|jtjddƒdƒ|jtjddƒdƒ|jtjddƒdƒ|jtjddƒdƒ|jtjdd ƒdƒ|jtjd dƒdƒd S( scompare_versions.t1R9iÿÿÿÿs 1.0-1ubuntu1s 1.0-1ubuntu2iis1:1.0-1s2007-2s 1:1.0-1~1N(R/Rtcompare_versions(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_compare_versions­s cCs"dt_|jtjƒtƒtjƒ}|jt_|jdj ƒƒ|j ƒ|jtjƒtƒ|j ƒtjƒ}|jt_|jdj ƒƒ|j ƒ|jtjƒt ƒ|j ƒtjƒ}|jt_|jdj ƒƒ|j ƒ|jtjƒtƒ|j ƒdS(senabled.s /nonexistings # configuration file enabled = 1s## configuration file enabled =0 s!# configuration file nothing hereN( RRR/tenabledRRtNamedTemporaryFiletnameR-R.RtcloseR (R"R((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyt test_enabled·s(            cCs|jdtjƒkƒdS(sget_kernel_package().tlinuxN(R<Rtget_kernel_package(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_kernel_packageÒscCsw|jttjdƒƒdkƒ|jdtjdƒkƒ|jtjdƒdgƒ|jtjdƒgƒdS(spackage_name_glob().sa*iRAsba*hsxzywef*N(R<RDRtpackage_name_globR/(R"((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_package_name_glob×s"s online testc Csï|jƒtj|j|jdd%d&d'gt|jƒ}|j|dƒ|jt j j t j j |jd ƒƒƒ|j t j j |jd ƒtjƒƒ|jt j j t j j |jd ƒƒƒ|jt j j t j j |jd ƒƒƒ|jt j j t j j |jd ƒƒƒ|jt j|jƒdgƒ|jtt jt j j |jdƒƒƒd ddgƒ|jt jt j j |jdd ƒƒdgƒt jt j j |jddddddƒƒ}g|D]}|jdƒd^qß}|jd|kƒ|jd|kƒ|jd|kƒ|jd|kƒ|jd|kƒt jt j j |jd ƒƒtj|j|jdd(gt|jƒ}|j|dƒ|jt j j t j j |jd ƒƒƒtj|j|jdd)gƒ}|jt|jƒƒdƒ|jd|kƒ|jd|kƒ|jt j j t j j |jdƒƒƒtj|j|jdd*gƒ}|jt|jƒƒdƒ|jd|kƒ|jd|kƒtjddd gd!tjƒ}|jƒdjƒ}|j|jdƒ|jtjd ƒ|ƒ|jttjdƒt jt j j |jd ƒƒtj|j|jdd+d,gt|jƒ|jt j j t j j |jd ƒƒƒ|jt j j t j j |jd#ƒƒƒd$S(-s/install_packages() with versions and with caches Foonux 1.2RBs 8.13-3ubuntu3R8s2.15-0ubuntu10ttzdatas2012b-1Rs usr/bin/statsusr/lib/debug/usr/bin/statsusr/share/zoneinfo/zone.tabsusr/share/doc/libc6/copyrighttarmhftcodenames sources.listtapttvarR tarchivest_iscoreutils-dbgsyms libc6-dbgs gnome-commons1.1isusr/bin/gnome-autogen.sht buggerboggers not exists dpkg-querys -Wf${Version}tdashRRRQs usr/bin/dpkgN(s coreutilss 8.13-3ubuntu3(slibc6s2.15-0ubuntu10(stzdatas2012b-1(s coreutilss 8.13-3ubuntu3(s gnome-commons1.1(R°N(s coreutilss 8.13-3ubuntu3(sdpkgN( t_setup_foonux_configRtinstall_packagestrootdirt configdirR tcachedirR/R<RR*texistsR+tassert_elf_archRjRmtsortedR†tunlinkRDt splitlinesR RTRURVRWRXRZR=R>R!R(R"tobsoleteR R‡t cache_namestresultRQtcoreutils_version((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_install_packages_versionedßs„      *' &   cCs—|jƒtj|j|jdd d gtd ƒ}|j|dƒ|jt j j t j j |jdƒƒƒ|j t j j |jdƒtjƒƒ|jt j j t j j |jdƒƒƒ|jt j j t j j |jdƒƒƒ|jt j|jƒdgƒ|jtt jt j j |jdƒƒƒdd d gƒ|jt jt j j |jddƒƒd gƒ|jt j|jƒgƒd S(s0install_packages() without versions and no caches Foonux 1.2RBR©Rs usr/bin/statsusr/lib/debug/usr/bin/statsusr/share/zoneinfo/zone.tabRªR«s sources.listN(s coreutilsN(stzdataN(R²RR³R´RµR R R/R<RR*R·R+R¸RjRmR¹R¶(R"R¼((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyt!test_install_packages_unversioned7s*      *' c Cstjdƒ|jƒtj|jdddtjdƒfdgt|jƒ}|jt j j t j j |jdƒƒƒ|jt j j t j j |jdƒƒƒ|j t|jƒƒdƒ|jd|kƒ|jd|kƒt jt j j |jdd d d d d ƒƒ}g|D]}|jd ƒd^q}|jd|kƒ|jd|k|jƒ|jd|kƒt jt j j |jdƒƒt jƒ}z3t j|jƒtjddddgtd ƒWdt j|ƒ|jt j j t j j |jdƒƒƒXdS(s,install_packages() with system configurationR±RBR©s1.1s usr/bin/statsusr/share/zoneinfo/zone.tabitsystemR¬R­R R®R¯iscoreutils-dbgsymtrootN(stzdatas1.1(s coreutilsN(RR=R²R³R´R R R¶R<RR*R·R+tassertGreaterEqualRDR»RmR†R/R RºtgetcwdtchdirR(R"R¾R R‡R½torig_cwd((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_install_packages_systemVs8    &  c Cs|jƒttjj|jddƒdƒ}|jdƒWdQXy9tj|j |jddgt |j ƒ|j dƒWnEtk rÄ}|jdt|ƒkƒ|jd t|ƒkƒnXttjj|jddƒdƒ}|jd ƒWdQXy9tj|j |jddgt |j ƒ|j d ƒWnNtk rˆ}|jd t|ƒkt|ƒƒ|jd t|ƒkƒnXdS(sinstall_packages() with errorss Foonux 1.2s sources.listR's bogus formatNR©sBinstall_packages() unexpectedly succeeded with broken sources.listtbogust Exceptions9deb http://archive.ubuntu.com/nosuchdistro/ precise main s@install_packages() unexpectedly succeeded with broken server URLt nosuchdistrosindex files failed to download(stzdataN(stzdataN(R²R,RR*R+RµR-RR³R´R R R¶tfailRR<tstrt assertFalse(R"Rte((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_install_packages_errorƒs& ''"c Cs|jƒtjj|jdƒ}tj|j|jddgt |j dt ƒt j jdƒ}tjtjj|dƒƒ}|s–|jdƒntjj|dƒ}tjj|ƒ}tj|j|jdddgt |j dt ƒtjtjj|d ƒƒsŠ|jd ƒ|jtjj|dƒ|d ƒ|j|tjj|ƒd ƒ|jtjjtjj|jdƒƒƒnt j jddƒ|jttj|j|jddgt |j dt ƒtj|j|jdddgt |j dt ƒt j jddƒdS(s+install_packages() with a permanent sandboxsusr/share/zoneinfo/zone.tabs Foonux 1.2R©tpermanent_rootdirsDir::Cache::archivess tzdata*.debstzdata was not downloadediRBscoreutils*.debscoreutils was not downloaded.stzdata downloaded twice.szonetab written twice.s usr/bin/statsAcquire::http::Proxyshttp://nonexistentR8RN(stzdataN(s coreutilsN(stzdataN(slibc6N(s coreutilsN(stzdataN(R²RR*R+R´RR³RµR R R¶RRtconfigtfind_dirtglobRÌtgetctimeR/R<R·tsetR>t SystemExit(R"tzonetabR®R©ttzdata_writtentzonetab_written((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyt'test_install_packages_permanent_sandbox s:  c Cs|jƒtjj|jdƒ}tj|j|jdd gt |j dt ƒ|j tj |ƒjdƒƒtj|j|jdd gt |j dt ƒ|j tj |ƒjdƒdƒtj|j|jdd gt |j dt ƒ|j tj |ƒjdƒd ƒdS( Nsusr/sbin/apache2s Foonux 1.2sapache2-mpm-workerRÑsmpm-worker/apache2sapache2-mpm-eventsmpm-event/apache2s5should have installed mpm-event, but have mpm-worker.s5should have installed mpm-worker, but have mpm-event.(sapache2-mpm-workerN(sapache2-mpm-eventN(sapache2-mpm-workerN(R²RR*R+R´RR³RµR R R¶RR<treadlinktendswith(R"tapache_bin_path((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyt.test_install_packages_permanent_sandbox_repackÊs  Rªsnative armhf architecturec Cs%|jƒtj|j|jdddgt|jddƒ}|j|dƒ|jt j j t j j |jd ƒƒƒ|j t j j |jd ƒdƒ|jt j j t j j |jd ƒƒƒt jt j j |jdd d d d dƒƒ}|jd|k|ƒ|jd|k|ƒdS(s1install_packages() for foreign architecture armhfs Foonux 1.2RBs 8.13-3ubuntu3R8s 2.15-0ubuntu9t architectureRªsFlibc6 version 2.15-0ubuntu9 required, but 2.15-0ubuntu10 is available s usr/bin/statsusr/share/doc/libc6/copyrightR¬R­R R®s!coreutils_8.13-3ubuntu3_armhf.debslibc6_2.15-0ubuntu10_armhf.debN(s coreutilss 8.13-3ubuntu3(slibc6s 2.15-0ubuntu9(R²RR³R´RµR R¶R/R<RR*R·R+R¸Rm(R"R¼R ((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_install_packages_armhfÝs     " cCsÎ|jƒtjj|jdƒ}tj|ƒtj|jtjj|j ddƒƒtj d|d|jdt ƒ}|j tjj tjj|dƒƒƒ|j |jdƒd |jd ƒd ƒdS( NRˆs Foonux 1.2s sources.lists base-filestsandboxt apt_updatetdebians/base-files-6.5ubuntu6sunexpected version: t/iÿÿÿÿ(R²RR*R+RRlRt_build_apt_sandboxR´Rµtget_source_treeRR<tisdirRÝR†(R"tout_dirtres((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyttest_get_source_tree_sandbox÷s  ( (cCs«tjj|jdƒ|_tjj|jdƒ|_tjj|jdƒ|_tj|jƒtj|jƒtj|jƒtjtjj|jdƒƒttjj|jddƒdƒ.}|j dƒ|j dƒ|j d ƒWd QXtjtjj|jdd ƒƒttjj|jdd dƒdƒ.}|j d ƒ|j d ƒ|j d ƒWd QXttjj|jddƒdƒ}|j dƒWd QXd S(s;Set up directories and configuration for install_packages()R RÃRÒs Foonux 1.2s sources.listR's3deb http://archive.ubuntu.com/ubuntu/ precise main s7deb-src http://archive.ubuntu.com/ubuntu/ precise main s*deb http://ddebs.ubuntu.com/ precise main NRªs*deb http://ports.ubuntu.com/ precise main s.deb-src http://ports.ubuntu.com/ precise main R«tprecise( RR*R+RR¶R´RµRlR,R-(R"R((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyR²s$'  "*  'cCsåidd6dd6dd6}tjdd|gd id tjd tƒ}|jƒd }|jd ksmt‚xJ|jƒD]/}|jd ƒrz|j ddƒd}PqzqzW|j dƒ|j |||kd|||fƒdS(s‡Assert that an ELF file is for an expected machine type. Expected is a Debian-style architecture (i386, amd64, armhf) t80386ti386sX86-64tamd64tARMRªtreadelfs-etenvRRtuniversal_newlinesis Machine:tmaxsplitis)could not fine Machine: in readelf outputs7%s has unexpected machine type "%s" for architecture %sN( RTRURVRRWRZR[R»RR†RÌR<(R"R*texpectedtarchmapRñRˆtlinetmachine((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyR¸s"    ()t__name__t __module__R#R&R7R?R@RGRJRNRPR]R_RbRwR„RŒR‘R•R—R›RžR£R¦R¨tunittestt skipUnlessR RÀRÁRÈRÐRÛRßtskipIfRRjRáRëR²R¸(((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyR sD   %        H n       X-** RQs--helpRRtstderri(RûRitimpRTRR$Rtos.pathRoRÔR R¬RRRt load_sourceRtapport.packaging_implR R R tTestCaseRtcallRVtmaintOSError(((s4/usr/share/apport/testsuite/test_backend_apt_dpkg.pyts"l  ÿÿÿ