Merge lp:~xnox/apport/xenial-s390x into lp:~apport-hackers/apport/trunk

Proposed by Dimitri John Ledkov
Status: Needs review
Proposed branch: lp:~xnox/apport/xenial-s390x
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 137 lines (+23/-14)
2 files modified
test/test_backend_apt_dpkg.py (+21/-13)
test/test_ui.py (+2/-1)
To merge this branch: bzr merge lp:~xnox/apport/xenial-s390x
Reviewer Review Type Date Requested Status
Martin Pitt (community) Needs Fixing
Brian Murray Pending
Review via email: mp+304943@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

s390x is only available on xenial and up.

I've started to upgrade the test-suite to xenial and add basic s390x compatibility.

There are a few tests that use package names and version numbers that are only available on some architectures -> these are skipped for now, ideally a new set of test packages and version numbers should be picked for the tests that include binaries on all autopkgtestable architectures (amd64, arm64, armhf, i386, ppc64el, s390x) and still have the right properties/version orderings.

I had to move the test-suite to xenial series, but i'm not so sure that I did it all correctly.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for looking into this! This still needs some fixes as you already said, but the general direction is fine.

review: Needs Fixing

Unmerged revisions

3103. By Dimitri John Ledkov

Start moving tests to xenial, add basic s390x support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/test_backend_apt_dpkg.py'
2--- test/test_backend_apt_dpkg.py 2016-08-13 07:06:58 +0000
3+++ test/test_backend_apt_dpkg.py 2016-09-05 16:18:05 +0000
4@@ -804,7 +804,7 @@
5 impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',
6 [('heimdal-dev', None)], False, self.cachedir,
7 permanent_rootdir=True)
8- self.assertIn('heimdal/', os.readlink(include_path))
9+ self.assertFalse(os.path.exists(include_path))
10
11 impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',
12 [('libkrb5-dev', None)], False, self.cachedir,
13@@ -838,6 +838,7 @@
14 self.assertIn('libc6_2.23-0ubuntu3_armhf.deb', cache)
15
16 @unittest.skipUnless(_has_internet(), 'online test')
17+ @unittest.skipIf(impl.get_system_architecture() in ['arm64','powerpc','ppc64el','s390x'], 'test packages do not exist for these architectures')
18 def test_install_packages_from_launchpad(self):
19 '''install_packages() using packages only available on Launchpad'''
20
21@@ -907,6 +908,7 @@
22 self.assertIn(('qemu-utils-dbgsym', '2.0.0+dfsg-2ubuntu1.11'), cache_versions)
23
24 @unittest.skipUnless(_has_internet(), 'online test')
25+ @unittest.skipIf(impl.get_system_architecture() in ['arm64','powerpc','ppc64el','s390x'], 'test packages do not exist for these architectures')
26 def test_install_old_packages(self):
27 '''sandbox will install older package versions from launchpad'''
28
29@@ -954,13 +956,13 @@
30 out_dir = os.path.join(self.workdir, 'out')
31 os.mkdir(out_dir)
32 impl._build_apt_sandbox(self.rootdir, os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'),
33- 'ubuntu', 'trusty', origins=None)
34+ 'ubuntu', 'xenial', origins=None)
35 res = impl.get_source_tree('base-files', out_dir, sandbox=self.rootdir,
36 apt_update=True)
37 self.assertTrue(os.path.isdir(os.path.join(res, 'debian')))
38 # this needs to be updated when the release in _setup_foonux_config
39 # changes
40- self.assertTrue(res.endswith('/base-files-7.2ubuntu5'),
41+ self.assertTrue(res.endswith('/base-files-9.4ubuntu4'),
42 'unexpected version: ' + res.split('/')[-1])
43
44 @unittest.skipUnless(_has_internet(), 'online test')
45@@ -970,12 +972,12 @@
46 os.mkdir(out_dir)
47 impl._build_apt_sandbox(self.rootdir, os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'),
48 'ubuntu', 'trusty', origins=None)
49- res = impl.get_source_tree('debian-installer', out_dir, version='20101020ubuntu318.16',
50+ res = impl.get_source_tree('debian-installer', out_dir, version='20101020ubuntu451.5',
51 sandbox=self.rootdir, apt_update=True)
52 self.assertTrue(os.path.isdir(os.path.join(res, 'debian')))
53 # this needs to be updated when the release in _setup_foonux_config
54 # changes
55- self.assertTrue(res.endswith('/debian-installer-20101020ubuntu318.16'),
56+ self.assertTrue(res.endswith('/debian-installer-20101020ubuntu451.5'),
57 'unexpected version: ' + res.split('/')[-1])
58
59 @unittest.skipUnless(_has_internet(), 'online test')
60@@ -1028,14 +1030,15 @@
61 'ubuntu', 'trusty', origins=['LP-PPA-%s' % ppa])
62 with open(os.path.join(self.rootdir, 'etc', 'apt', 'sources.list.d', ppa + '.list')) as f:
63 sources = f.read().splitlines()
64- self.assertIn('deb http://ppa.launchpad.net/fooser/bar-ppa/ubuntu trusty main main/debug', sources)
65- self.assertIn('deb-src http://ppa.launchpad.net/fooser/bar-ppa/ubuntu trusty main', sources)
66+ self.assertIn('deb http://ppa.launchpad.net/fooser/bar-ppa/ubuntu xenial main main/debug', sources)
67+ self.assertIn('deb-src http://ppa.launchpad.net/fooser/bar-ppa/ubuntu xenial main', sources)
68
69 @unittest.skipUnless(_has_internet(), 'online test')
70+ @unittest.skipIf(impl.get_system_architecture() in ['arm64','powerpc','ppc64el','s390x'], 'test packages do not exist for these architectures')
71 def test_install_package_from_a_ppa(self):
72 '''Install a package from a PPA.'''
73 ppa = 'LP-PPA-brian-murray'
74- self._setup_foonux_config()
75+ self._setup_foonux_config(release='trusty')
76 obsolete = impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',
77 [('apport',
78 '2.14.1-0ubuntu3.7~ppa4')
79@@ -1051,7 +1054,7 @@
80 self.assertEqual(sandbox_ver('apport'),
81 '2.14.1-0ubuntu3.7~ppa4')
82
83- def _setup_foonux_config(self, updates=False, release='trusty', ppa=False):
84+ def _setup_foonux_config(self, updates=False, release='xenial', ppa=False):
85 '''Set up directories and configuration for install_packages()
86
87 If ppa is True, then a sources.list file for a PPA will be created
88@@ -1059,6 +1062,10 @@
89 sandbox.
90 '''
91
92+ archive_url = 'http://ports.ubuntu.com/'
93+ if impl.get_system_architecture() in ['i386', 'amd64']:
94+ archive_url = 'http://archive.ubuntu.com/ubuntu/'
95+
96 self.cachedir = os.path.join(self.workdir, 'cache')
97 self.rootdir = os.path.join(self.workdir, 'root')
98 self.configdir = os.path.join(self.workdir, 'config')
99@@ -1067,12 +1074,12 @@
100 os.mkdir(self.configdir)
101 os.mkdir(os.path.join(self.configdir, 'Foonux 1.2'))
102 with open(os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'), 'w') as f:
103- f.write('deb http://archive.ubuntu.com/ubuntu/ %s main\n' % release)
104- f.write('deb-src http://archive.ubuntu.com/ubuntu/ %s main\n' % release)
105+ f.write('deb %s %s main\n' % (archive_url, release))
106+ f.write('deb-src %s %s main\n' % (archive_url, release))
107 f.write('deb http://ddebs.ubuntu.com/ %s main\n' % release)
108 if updates:
109- f.write('deb http://archive.ubuntu.com/ubuntu/ %s-updates main\n' % release)
110- f.write('deb-src http://archive.ubuntu.com/ubuntu/ %s-updates main\n' % release)
111+ f.write('deb %s %s-updates main\n' % (archive_url, release))
112+ f.write('deb-src %s %s-updates main\n' % (archive_url, release))
113 f.write('deb http://ddebs.ubuntu.com/ %s-updates main\n' % release)
114 if ppa:
115 os.mkdir(os.path.join(self.configdir, 'Foonux 1.2', 'sources.list.d'))
116@@ -1113,6 +1120,7 @@
117 'i386': '80386',
118 'amd64': 'X86-64',
119 'armhf': 'ARM',
120+ 's390x': 'IBM S/390',
121 }
122
123 # get ELF machine type
124
125=== modified file 'test/test_ui.py'
126--- test/test_ui.py 2016-01-13 07:03:25 +0000
127+++ test/test_ui.py 2016-09-05 16:18:05 +0000
128@@ -652,7 +652,8 @@
129 pid = int(stat[0])
130 break
131
132- self.assertFalse(pid is None)
133+ if pid is None:
134+ raise unittest.SkipTest('No kernel threads found in /proc, in a container?!')
135 sys.argv = ['ui-test', '-f', '-P', str(pid)]
136 self.ui = TestSuiteUserInterface()
137 self.ui.present_details_response = {'report': True,

Subscribers

People subscribed via source and target branches