Merge ~cypressyew/qa-regression-testing:330-fix into qa-regression-testing:master

Proposed by Po-Hsu Lin
Status: Merged
Merged at revision: 46cee41c216eb98fd3e802befe856ec4c4123553
Proposed branch: ~cypressyew/qa-regression-testing:330-fix
Merge into: qa-regression-testing:master
Diff against target: 122 lines (+58/-22)
3 files modified
scripts/test-kernel-security.py (+2/-2)
scripts/test-openjdk.py (+16/-20)
scripts/test-openjdk11.py (+40/-0)
Reviewer Review Type Date Requested Status
Ubuntu Security Team Pending
Review via email: mp+353551@code.launchpad.net

Commit message

BugLink: https://bugs.launchpad.net/bugs/1788338

The DEBUG_WX config is also available in 4.4 kernel with commit e1a58320.
Change the kernel requirement version from 4.13 to 4.4

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/test-kernel-security.py b/scripts/test-kernel-security.py
2index c515316..66b35c8 100755
3--- a/scripts/test-kernel-security.py
4+++ b/scripts/test-kernel-security.py
5@@ -2540,8 +2540,8 @@ class KernelSecurityConfigTest(KernelSecurityBaseTest):
6 if not (self.dpkg_arch in ['amd64', 'i386', 'arm64']):
7 self._skipped("DEBUG_WX is an x86 and arm64 arch feature only")
8 expected = False
9- elif not self.kernel_at_least('4.13'):
10- self._skipped('CONFIG_DEBUG_WX added/enabled in 4.13 and newer')
11+ elif not self.kernel_at_least('4.4'):
12+ self._skipped('CONFIG_DEBUG_WX added/enabled in 4.4 and newer')
13 expected = False
14 self.assertKernelConfig('DEBUG_WX', expected)
15
16diff --git a/scripts/test-openjdk.py b/scripts/test-openjdk.py
17index ad9616f..a015426 100755
18--- a/scripts/test-openjdk.py
19+++ b/scripts/test-openjdk.py
20@@ -50,20 +50,14 @@ class OpenJDKTest(testlib.TestlibCase):
21 elif arch == "i686":
22 arch = "i386"
23
24- if self.lsb_release['Release'] >= 12.04:
25- jdkpath = "/usr/lib/jvm/java-6-openjdk-%s/jre/lib" % arch
26- if jdk == "openjdk-7":
27- jdkpath = "/usr/lib/jvm/java-7-openjdk-%s/jre/lib" % arch
28- elif jdk == "openjdk-8":
29- jdkpath = "/usr/lib/jvm/java-8-openjdk-%s/jre/lib" % arch
30- else:
31- jdkpath = "/usr/lib/jvm/java-6-openjdk/jre/lib"
32- if jdk == "openjdk-7":
33- jdkpath = "/usr/lib/jvm/java-7-openjdk/jre/lib"
34- elif jdk == "openjdk-8":
35- jdkpath = "/usr/lib/jvm/java-8-openjdk-%s/jre/lib" % arch
36-
37- self.jdkpath = os.path.join(jdkpath, arch)
38+ jdkpaths = {
39+ 'openjdk-6': "/usr/lib/jvm/java-6-openjdk-%s/jre/lib/%s" % (arch, arch),
40+ 'openjdk-7': "/usr/lib/jvm/java-7-openjdk-%s/jre/lib/%s" % (arch, arch),
41+ 'openjdk-8': "/usr/lib/jvm/java-8-openjdk-%s/jre/lib/%s" % (arch, arch),
42+ 'openjdk-11': "/usr/lib/jvm/java-11-openjdk-%s/lib" % arch
43+ }
44+
45+ self.jdkpath = jdkpaths[jdk]
46
47 # 'server' is the default for amd64 and 'client' for i386, but don't
48 # list the default here. It will be used when applications are called
49@@ -85,12 +79,11 @@ class OpenJDKTest(testlib.TestlibCase):
50
51 def test_aa_java_version(self):
52 '''Test java version'''
53- rc, report = testlib.cmd(['java', '-version'])
54- expected = 0
55- result = 'Got exit code %d, expected %d\n' % (rc, expected)
56- self.assertTrue(rc == expected, result + report)
57- print("$ java -version\n%s" % report, file=sys.stdout)
58- sys.stdout.flush()
59+ report = self.assertShellExitEquals(0, ['java', '-version'], bare_report=True)
60+ print("$ java -version\n%s" % report, file=sys.stderr)
61+ for vm in self.vms:
62+ report = self.assertShellExitEquals(0, ['java', '-%s' % vm, '-version'], bare_report=True)
63+ print("$ java -%s -version\n%s" % (vm, report), file=sys.stderr)
64
65 def test_eclipse(self):
66 '''Test eclipse'''
67@@ -190,6 +183,9 @@ class OpenJDKTest(testlib.TestlibCase):
68
69 self.assertShellExitEquals(0, ['java', '-jar', jarfile, '-s'])
70
71+ for vm in self.vms:
72+ self.assertShellExitEquals(0, ['java', '-%s' % vm, '-jar', jarfile, '-s'])
73+
74 # The yy_* tests should happen last to make sure we see the failures after
75 # all the prompted manual tests
76 def test_yy_regression_lp1283828(self):
77diff --git a/scripts/test-openjdk11.py b/scripts/test-openjdk11.py
78new file mode 100755
79index 0000000..4cc2b1f
80--- /dev/null
81+++ b/scripts/test-openjdk11.py
82@@ -0,0 +1,40 @@
83+#!/usr/bin/python
84+#
85+# test-openjdk8.py quality assurance test script
86+# Copyright (C) 2012-2016 Canonical Ltd.
87+#
88+# This program is free software: you can redistribute it and/or modify
89+# it under the terms of the GNU General Public License version 2,
90+# as published by the Free Software Foundation.
91+#
92+# This program is distributed in the hope that it will be useful,
93+# but WITHOUT ANY WARRANTY; without even the implied warranty of
94+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95+# GNU General Public License for more details.
96+#
97+# You should have received a copy of the GNU General Public License
98+# along with this program. If not, see <http://www.gnu.org/licenses/>.
99+#
100+
101+'''
102+ *** IMPORTANT ***
103+ DO NOT RUN ON A PRODUCTION SERVER.
104+ *** IMPORTANT ***
105+'''
106+
107+# QRT-Depends: testlib_data.py testlib_ssl.py testlib_browser.py test-openjdk.py
108+# QRT-Packages: eclipse openjdk-11-jdk openjdk-11-jre-zero chromium-browser firefox eclipse-platform
109+# QRT-Alternates: netbeans
110+
111+from __future__ import print_function
112+
113+import subprocess
114+import sys
115+
116+if __name__ == '__main__':
117+ print('openjdk8 regression tests')
118+ prc = subprocess.Popen(['python', 'test-openjdk.py', '--jdk=openjdk-11'],
119+ stdout=sys.stdout,
120+ stderr=subprocess.STDOUT)
121+ prc.wait()
122+ sys.exit(prc.returncode)

Subscribers

People subscribed via source and target branches