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
=== modified file 'test/test_backend_apt_dpkg.py'
--- test/test_backend_apt_dpkg.py 2016-08-13 07:06:58 +0000
+++ test/test_backend_apt_dpkg.py 2016-09-05 16:18:05 +0000
@@ -804,7 +804,7 @@
804 impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',804 impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',
805 [('heimdal-dev', None)], False, self.cachedir,805 [('heimdal-dev', None)], False, self.cachedir,
806 permanent_rootdir=True)806 permanent_rootdir=True)
807 self.assertIn('heimdal/', os.readlink(include_path))807 self.assertFalse(os.path.exists(include_path))
808808
809 impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',809 impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',
810 [('libkrb5-dev', None)], False, self.cachedir,810 [('libkrb5-dev', None)], False, self.cachedir,
@@ -838,6 +838,7 @@
838 self.assertIn('libc6_2.23-0ubuntu3_armhf.deb', cache)838 self.assertIn('libc6_2.23-0ubuntu3_armhf.deb', cache)
839839
840 @unittest.skipUnless(_has_internet(), 'online test')840 @unittest.skipUnless(_has_internet(), 'online test')
841 @unittest.skipIf(impl.get_system_architecture() in ['arm64','powerpc','ppc64el','s390x'], 'test packages do not exist for these architectures')
841 def test_install_packages_from_launchpad(self):842 def test_install_packages_from_launchpad(self):
842 '''install_packages() using packages only available on Launchpad'''843 '''install_packages() using packages only available on Launchpad'''
843844
@@ -907,6 +908,7 @@
907 self.assertIn(('qemu-utils-dbgsym', '2.0.0+dfsg-2ubuntu1.11'), cache_versions)908 self.assertIn(('qemu-utils-dbgsym', '2.0.0+dfsg-2ubuntu1.11'), cache_versions)
908909
909 @unittest.skipUnless(_has_internet(), 'online test')910 @unittest.skipUnless(_has_internet(), 'online test')
911 @unittest.skipIf(impl.get_system_architecture() in ['arm64','powerpc','ppc64el','s390x'], 'test packages do not exist for these architectures')
910 def test_install_old_packages(self):912 def test_install_old_packages(self):
911 '''sandbox will install older package versions from launchpad'''913 '''sandbox will install older package versions from launchpad'''
912914
@@ -954,13 +956,13 @@
954 out_dir = os.path.join(self.workdir, 'out')956 out_dir = os.path.join(self.workdir, 'out')
955 os.mkdir(out_dir)957 os.mkdir(out_dir)
956 impl._build_apt_sandbox(self.rootdir, os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'),958 impl._build_apt_sandbox(self.rootdir, os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'),
957 'ubuntu', 'trusty', origins=None)959 'ubuntu', 'xenial', origins=None)
958 res = impl.get_source_tree('base-files', out_dir, sandbox=self.rootdir,960 res = impl.get_source_tree('base-files', out_dir, sandbox=self.rootdir,
959 apt_update=True)961 apt_update=True)
960 self.assertTrue(os.path.isdir(os.path.join(res, 'debian')))962 self.assertTrue(os.path.isdir(os.path.join(res, 'debian')))
961 # this needs to be updated when the release in _setup_foonux_config963 # this needs to be updated when the release in _setup_foonux_config
962 # changes964 # changes
963 self.assertTrue(res.endswith('/base-files-7.2ubuntu5'),965 self.assertTrue(res.endswith('/base-files-9.4ubuntu4'),
964 'unexpected version: ' + res.split('/')[-1])966 'unexpected version: ' + res.split('/')[-1])
965967
966 @unittest.skipUnless(_has_internet(), 'online test')968 @unittest.skipUnless(_has_internet(), 'online test')
@@ -970,12 +972,12 @@
970 os.mkdir(out_dir)972 os.mkdir(out_dir)
971 impl._build_apt_sandbox(self.rootdir, os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'),973 impl._build_apt_sandbox(self.rootdir, os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'),
972 'ubuntu', 'trusty', origins=None)974 'ubuntu', 'trusty', origins=None)
973 res = impl.get_source_tree('debian-installer', out_dir, version='20101020ubuntu318.16',975 res = impl.get_source_tree('debian-installer', out_dir, version='20101020ubuntu451.5',
974 sandbox=self.rootdir, apt_update=True)976 sandbox=self.rootdir, apt_update=True)
975 self.assertTrue(os.path.isdir(os.path.join(res, 'debian')))977 self.assertTrue(os.path.isdir(os.path.join(res, 'debian')))
976 # this needs to be updated when the release in _setup_foonux_config978 # this needs to be updated when the release in _setup_foonux_config
977 # changes979 # changes
978 self.assertTrue(res.endswith('/debian-installer-20101020ubuntu318.16'),980 self.assertTrue(res.endswith('/debian-installer-20101020ubuntu451.5'),
979 'unexpected version: ' + res.split('/')[-1])981 'unexpected version: ' + res.split('/')[-1])
980982
981 @unittest.skipUnless(_has_internet(), 'online test')983 @unittest.skipUnless(_has_internet(), 'online test')
@@ -1028,14 +1030,15 @@
1028 'ubuntu', 'trusty', origins=['LP-PPA-%s' % ppa])1030 'ubuntu', 'trusty', origins=['LP-PPA-%s' % ppa])
1029 with open(os.path.join(self.rootdir, 'etc', 'apt', 'sources.list.d', ppa + '.list')) as f:1031 with open(os.path.join(self.rootdir, 'etc', 'apt', 'sources.list.d', ppa + '.list')) as f:
1030 sources = f.read().splitlines()1032 sources = f.read().splitlines()
1031 self.assertIn('deb http://ppa.launchpad.net/fooser/bar-ppa/ubuntu trusty main main/debug', sources)1033 self.assertIn('deb http://ppa.launchpad.net/fooser/bar-ppa/ubuntu xenial main main/debug', sources)
1032 self.assertIn('deb-src http://ppa.launchpad.net/fooser/bar-ppa/ubuntu trusty main', sources)1034 self.assertIn('deb-src http://ppa.launchpad.net/fooser/bar-ppa/ubuntu xenial main', sources)
10331035
1034 @unittest.skipUnless(_has_internet(), 'online test')1036 @unittest.skipUnless(_has_internet(), 'online test')
1037 @unittest.skipIf(impl.get_system_architecture() in ['arm64','powerpc','ppc64el','s390x'], 'test packages do not exist for these architectures')
1035 def test_install_package_from_a_ppa(self):1038 def test_install_package_from_a_ppa(self):
1036 '''Install a package from a PPA.'''1039 '''Install a package from a PPA.'''
1037 ppa = 'LP-PPA-brian-murray'1040 ppa = 'LP-PPA-brian-murray'
1038 self._setup_foonux_config()1041 self._setup_foonux_config(release='trusty')
1039 obsolete = impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',1042 obsolete = impl.install_packages(self.rootdir, self.configdir, 'Foonux 1.2',
1040 [('apport',1043 [('apport',
1041 '2.14.1-0ubuntu3.7~ppa4')1044 '2.14.1-0ubuntu3.7~ppa4')
@@ -1051,7 +1054,7 @@
1051 self.assertEqual(sandbox_ver('apport'),1054 self.assertEqual(sandbox_ver('apport'),
1052 '2.14.1-0ubuntu3.7~ppa4')1055 '2.14.1-0ubuntu3.7~ppa4')
10531056
1054 def _setup_foonux_config(self, updates=False, release='trusty', ppa=False):1057 def _setup_foonux_config(self, updates=False, release='xenial', ppa=False):
1055 '''Set up directories and configuration for install_packages()1058 '''Set up directories and configuration for install_packages()
10561059
1057 If ppa is True, then a sources.list file for a PPA will be created1060 If ppa is True, then a sources.list file for a PPA will be created
@@ -1059,6 +1062,10 @@
1059 sandbox.1062 sandbox.
1060 '''1063 '''
10611064
1065 archive_url = 'http://ports.ubuntu.com/'
1066 if impl.get_system_architecture() in ['i386', 'amd64']:
1067 archive_url = 'http://archive.ubuntu.com/ubuntu/'
1068
1062 self.cachedir = os.path.join(self.workdir, 'cache')1069 self.cachedir = os.path.join(self.workdir, 'cache')
1063 self.rootdir = os.path.join(self.workdir, 'root')1070 self.rootdir = os.path.join(self.workdir, 'root')
1064 self.configdir = os.path.join(self.workdir, 'config')1071 self.configdir = os.path.join(self.workdir, 'config')
@@ -1067,12 +1074,12 @@
1067 os.mkdir(self.configdir)1074 os.mkdir(self.configdir)
1068 os.mkdir(os.path.join(self.configdir, 'Foonux 1.2'))1075 os.mkdir(os.path.join(self.configdir, 'Foonux 1.2'))
1069 with open(os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'), 'w') as f:1076 with open(os.path.join(self.configdir, 'Foonux 1.2', 'sources.list'), 'w') as f:
1070 f.write('deb http://archive.ubuntu.com/ubuntu/ %s main\n' % release)1077 f.write('deb %s %s main\n' % (archive_url, release))
1071 f.write('deb-src http://archive.ubuntu.com/ubuntu/ %s main\n' % release)1078 f.write('deb-src %s %s main\n' % (archive_url, release))
1072 f.write('deb http://ddebs.ubuntu.com/ %s main\n' % release)1079 f.write('deb http://ddebs.ubuntu.com/ %s main\n' % release)
1073 if updates:1080 if updates:
1074 f.write('deb http://archive.ubuntu.com/ubuntu/ %s-updates main\n' % release)1081 f.write('deb %s %s-updates main\n' % (archive_url, release))
1075 f.write('deb-src http://archive.ubuntu.com/ubuntu/ %s-updates main\n' % release)1082 f.write('deb-src %s %s-updates main\n' % (archive_url, release))
1076 f.write('deb http://ddebs.ubuntu.com/ %s-updates main\n' % release)1083 f.write('deb http://ddebs.ubuntu.com/ %s-updates main\n' % release)
1077 if ppa:1084 if ppa:
1078 os.mkdir(os.path.join(self.configdir, 'Foonux 1.2', 'sources.list.d'))1085 os.mkdir(os.path.join(self.configdir, 'Foonux 1.2', 'sources.list.d'))
@@ -1113,6 +1120,7 @@
1113 'i386': '80386',1120 'i386': '80386',
1114 'amd64': 'X86-64',1121 'amd64': 'X86-64',
1115 'armhf': 'ARM',1122 'armhf': 'ARM',
1123 's390x': 'IBM S/390',
1116 }1124 }
11171125
1118 # get ELF machine type1126 # get ELF machine type
11191127
=== modified file 'test/test_ui.py'
--- test/test_ui.py 2016-01-13 07:03:25 +0000
+++ test/test_ui.py 2016-09-05 16:18:05 +0000
@@ -652,7 +652,8 @@
652 pid = int(stat[0])652 pid = int(stat[0])
653 break653 break
654654
655 self.assertFalse(pid is None)655 if pid is None:
656 raise unittest.SkipTest('No kernel threads found in /proc, in a container?!')
656 sys.argv = ['ui-test', '-f', '-P', str(pid)]657 sys.argv = ['ui-test', '-f', '-P', str(pid)]
657 self.ui = TestSuiteUserInterface()658 self.ui = TestSuiteUserInterface()
658 self.ui.present_details_response = {'report': True,659 self.ui.present_details_response = {'report': True,

Subscribers

People subscribed via source and target branches