diff --git a/debian/changelog b/debian/changelog index ff64030..1ee759d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apport (2.20.1-0ubuntu2.20) xenial; urgency=medium + + * test/test_ui.py: modify run_crash_kernel test to account for the fact + that linux-image-$kvers-$flavor is now built from the linux-signed + source package on amd64. (LP: #1766740) (Original patch by Brian Murray) + + -- Julian Andres Klode Mon, 03 Jun 2019 15:59:41 +0200 + apport (2.20.1-0ubuntu2.19) xenial-security; urgency=medium * SECURITY UPDATE: TOCTOU issue allows local user to read arbitrary diff --git a/test/test_ui.py b/test/test_ui.py index bb9bbb2..5a3f114 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -1,5 +1,5 @@ # coding: UTF-8 -import unittest, shutil, signal, tempfile, resource, pwd, time, os, sys +import unittest, shutil, signal, tempfile, resource, pwd, time, os, sys, imp import subprocess, errno, glob try: @@ -16,6 +16,11 @@ import problem_report import apport.crashdb_impl.memory import stat +if os.environ.get('APPORT_TEST_LOCAL'): + impl = imp.load_source('', 'backends/packaging-apt-dpkg.py').impl +else: + from apport.packaging_impl import impl + logind_session = apport.Report.get_logind_session(os.getpid()) @@ -1259,8 +1264,14 @@ bOgUs= def test_run_crash_kernel(self): '''run_crash() for a kernel error''' + sys_arch = impl.get_system_architecture() + if sys_arch in ['amd64']: + src_pkg = 'linux-signed' + else: + src_pkg = 'linux' + # set up hook - f = open(os.path.join(self.hookdir, 'source_linux.py'), 'w') + f = open(os.path.join(self.hookdir, 'source_%s.py' % src_pkg), 'w') f.write('''def add_info(report, ui): report['KernelDebug'] = 'LotsMoreInfo' ''') @@ -1269,7 +1280,7 @@ bOgUs= # generate crash report r = apport.Report('KernelCrash') r['Package'] = apport.packaging.get_kernel_package() - r['SourcePackage'] = 'linux' + r['SourcePackage'] = src_pkg # write crash report report_file = os.path.join(apport.fileutils.report_dir, 'test.crash') @@ -1302,7 +1313,8 @@ bOgUs= self.assertEqual(self.ui.msg_severity, None, str(self.ui.msg_title) + ' ' + str(self.ui.msg_text)) self.assertEqual(self.ui.msg_title, None) - self.assertEqual(self.ui.opened_url, 'http://linux.bugs.example.com/%i' % self.ui.crashdb.latest_id()) + self.assertEqual(self.ui.opened_url, 'http://%s.bugs.example.com/%i' % + (src_pkg, self.ui.crashdb.latest_id())) self.assertTrue(self.ui.present_details_shown) self.assertTrue('SourcePackage' in self.ui.report.keys()) -- 2.7.4