Merge ~alexmurray/ubuntu-cve-tracker:no-empty-titles-descriptions-in-package-info-overrides into ubuntu-cve-tracker:master
- Git
- lp:~alexmurray/ubuntu-cve-tracker
- no-empty-titles-descriptions-in-package-info-overrides
- Merge into master
Status: | Merged |
---|---|
Merged at revision: | b195a03782fd7d510a0411408fe31b66baecb646 |
Proposed branch: | ~alexmurray/ubuntu-cve-tracker:no-empty-titles-descriptions-in-package-info-overrides |
Merge into: | ubuntu-cve-tracker:master |
Diff against target: |
534 lines (+73/-67) 2 files modified
meta_lists/package_info_overrides.json (+65/-65) scripts/test_cve_lib.py (+8/-2) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Spyros Seimenis | Approve | ||
Review via email: mp+439788@code.launchpad.net |
Commit message
Description of the change
Steve Beattie (sbeattie) wrote : | # |
On Tue, Mar 28, 2023 at 05:17:19AM -0000, Alex Murray wrote:
> Alex Murray has proposed merging ~alexmurray/
This all looks great to me, okay to commit as-is. One suggested
improvement that could be made as a followup below.
> diff --git a/scripts/
> index cdfa1aa..3e15944 100755
> --- a/scripts/
> +++ b/scripts/
> @@ -59,8 +59,15 @@ class TestPackageOver
> def test_get_
> assert cve_lib.
>
> - # XXX add a test to validate that all the package description
> - # XXX override entries have both a non-empty title and description.
> + def test_all_
> + assert cve_lib.
> + for pkg in cve_lib.
> + title = cve_lib.
> + desc = cve_lib.
> + assert title is not None
> + assert desc is not None
> + assert len(title) > 0
> + assert len(desc) > 0
Because the way this works, if there are multiple entries that are
missing something, the test here will trip an assert and stop on the
first occurrence. This means that someone coming along might end up
taking multiple steps to address all issues that would be caught by this
test loop.
One of the advantages of using python's unittest is that provides the
subTest context manager. A failure in a subtest would mark the whole
test as failed but allows the continuation of execution so that all the
entries could be tested, and all failing entries could be reported.
To give an example of how to use them, I'm attaching a patch
series that I had been working on to start adding some tests to
lp:ubuntu-security-tools for umt. The second patch demonstrates the
use of subTest().
[I haven't proposed these patches to lp:ubuntu-security-tools because I
would like to re-work the structure of the code, so that umt selftest
does not need to be invoked.]
It's not a big deal here, but it might be useful technique to put in
place here to demonstrate the use of subtest here for future tests
where it might be more important to have in place.
--
Steve Beattie
<email address hidden>
1 | From aac4a41cc9e9b5968dfbd26f9a1da2282b79cdae Mon Sep 17 00:00:00 2001 |
2 | From: Steve Beattie <steve.beattie@canonical.com> |
3 | Date: Sat, 3 Sep 2022 05:31:35 -0700 |
4 | Subject: [PATCH 1/3] umt: stub out a selftest command for running unit tests |
5 | |
6 | Start to add some basic infrastructure for creating tests |
7 | |
8 | Signed-off-by: Steve Beattie <steve.beattie@canonical.com> |
9 | --- |
10 | build-tools/umt | 16 ++++++++++++++++ |
11 | 1 file changed, 16 insertions(+) |
12 | |
13 | diff --git a/build-tools/umt b/build-tools/umt |
14 | index e92b11e..06dfab2 100755 |
15 | --- a/build-tools/umt |
16 | +++ b/build-tools/umt |
17 | @@ -29,6 +29,7 @@ import yaml |
18 | import threading |
19 | import lpl_common |
20 | import webbrowser |
21 | +import unittest |
22 | from collections import namedtuple |
23 | |
24 | BinaryPackages = collections.namedtuple('BinaryPackages', 'binaries pkg_versions') |
25 | @@ -5296,6 +5297,20 @@ class BetterUbuntuDistroInfo(distro_info.UbuntuDistroInfo): |
26 | else: |
27 | return release |
28 | |
29 | +# I would like to have tests in separate files, but one cannot import |
30 | +# umt; really, the main umt script should be broken apart into separate |
31 | +# components. |
32 | +def cmd_selftest(): |
33 | + parser = umt_argparse("usage: %(prog)s selftest [options]") |
34 | + parser.add_argument("-v", "--verbose", action='count', default=0, |
35 | + help="run selftests with increased verbose output") |
36 | + (opt, args) = parser.parse_known_args() |
37 | + |
38 | + suite = unittest.TestSuite() |
39 | + rc = unittest.TextTestRunner(verbosity=(opt.verbose * 2)).run(suite) |
40 | + if not rc.wasSuccessful(): |
41 | + sys.exit(1) |
42 | + |
43 | # |
44 | # Main program |
45 | # |
46 | @@ -5336,6 +5351,7 @@ commands = { |
47 | 'sing' : cmd_sing, |
48 | 'monument' : cmd_monument, |
49 | 'logs' : cmd_logs, |
50 | + 'selftest' : cmd_selftest, |
51 | 'help' : cmd_help |
52 | } |
53 | |
54 | -- |
55 | 2.34.1 |
1 | From f4202cf05f59425a14e0ba34dedc3640a167ddd3 Mon Sep 17 00:00:00 2001 |
2 | From: Steve Beattie <steve.beattie@canonical.com> |
3 | Date: Sat, 3 Sep 2022 09:49:51 -0700 |
4 | Subject: [PATCH 2/3] umt: add unit tests for version increment functions |
5 | |
6 | Add unit tests for version increment functions. These check that: |
7 | |
8 | (a) the functions generate the expected version, and |
9 | (b) the newly generated version is indeed greater than the prior |
10 | version, according to dpkg, and |
11 | (c) generated esm versions would sort less than a generated non-esm |
12 | version |
13 | |
14 | There are some cases that the existing code can't handle, and have been |
15 | segregated to a testcase that is expected to fail; there is also the |
16 | condition introduced in: |
17 | |
18 | 6214e93 ("umt: Handle another versioning edge case in `umt changelog`") |
19 | |
20 | which I cannot figure out what sort of versions it is supposed to |
21 | handle; I *think* it is supposed to match stuff like 'ubuntu5~18.04' |
22 | but that gets (incorrectly) handled by a prior condition in |
23 | increment_version_security(). |
24 | |
25 | There are more testcases needed around security fakesyncs and the |
26 | debian update versions. |
27 | |
28 | Signed-off-by: Steve Beattie <steve.beattie@canonical.com> |
29 | --- |
30 | build-tools/umt | 131 ++++++++++++++++++++++++++++++++++++++++++++++++ |
31 | 1 file changed, 131 insertions(+) |
32 | |
33 | diff --git a/build-tools/umt b/build-tools/umt |
34 | index 06dfab2..72b6b32 100755 |
35 | --- a/build-tools/umt |
36 | +++ b/build-tools/umt |
37 | @@ -5055,6 +5055,7 @@ def increment_version_security(old_version, esm=False): |
38 | new_version = old_version + 'ubuntu0.1' |
39 | if esm: |
40 | new_version = new_version + '~esm1' |
41 | + # XXX not sure this condition is ever used |
42 | elif re.search(r'~\d{2}\.\d{2}$', old_version): |
43 | new_version = old_version + '.1' |
44 | if esm: |
45 | @@ -5065,6 +5066,135 @@ def increment_version_security(old_version, esm=False): |
46 | |
47 | return new_version |
48 | |
49 | + |
50 | +class VersionChangeTest(unittest.TestCase): |
51 | + |
52 | + def test_increment_version_build(self): |
53 | + # testcases are tuples of (old_version, expected_result) |
54 | + testcases = [ |
55 | + ('2.1-3', '2.1-3build1'), # unmodified debian version |
56 | + ('2-3', '2-3build1'), # unmodified debian version |
57 | + ('2.0-2build2', '2.0-2build3'), # prior no-change rebuild version |
58 | + ('1:2.13.95-1', '1:2.13.95-1build1'), # version with epoch |
59 | + ('2.95-1.2', '2.95-1.2build1'), |
60 | + ('7.1-13build154', '7.1-13build155'), # whole lotta builds |
61 | + ('65', '65build1'), # debian native version |
62 | + |
63 | + # XXX need to convert sys.exit(1) to raise an exception |
64 | + # ('1.2-1ubuntu1', 'error'), |
65 | + ] |
66 | + |
67 | + for (testcase, expected) in testcases: |
68 | + with self.subTest(testcase=testcase): |
69 | + new_version = increment_version_build(testcase) |
70 | + self.assertEqual(new_version, expected) |
71 | + # ensure expected version is actually greater than prior version |
72 | + self.assertEqual( |
73 | + _compare_versions(new_version, 'gt', testcase), 0, |
74 | + f"generated version {new_version} is not greater than original {testcase}" |
75 | + ) |
76 | + |
77 | + def test_increment_version_security(self): |
78 | + # testcases are tuples of (old_version, expected_result) |
79 | + testcases = [ |
80 | + ('2.1-3', '2.1-3ubuntu0.1'), # unmodified debian version |
81 | + ('2.1-3ubuntu1', '2.1-3ubuntu1.1'), # ubuntu version |
82 | + ('2.1-3ubuntu12', '2.1-3ubuntu12.1'), # ubuntu version |
83 | + ('2.95-1.2', '2.95-1.2ubuntu0.1'), |
84 | + ('1:2.13.95-1', '1:2.13.95-1ubuntu0.1'), # version with epoch |
85 | + ('9.8-2ubuntu2.1', '9.8-2ubuntu2.2'), # prior security upload |
86 | + ('9.8-2ubuntu0.18.04.1', '9.8-2ubuntu0.18.04.2'), # prior release-specific upload |
87 | + ('9.8-2ubuntu0.18.04.5', '9.8-2ubuntu0.18.04.6'), # prior release-specific upload |
88 | + ('9.8-2ubuntu4~18.04.1', '9.8-2ubuntu4~18.04.2'), # prior release-specific upload |
89 | + |
90 | + # prior no-change builds |
91 | + ('2.0-2build2', '2.0-2ubuntu0.1'), # prior no-change rebuild version |
92 | + ('7.1-13build154', '7.1-13ubuntu0.1'), # whole lotta builds |
93 | + ('65', '65ubuntu0.1'), # debian native version |
94 | + ] |
95 | + |
96 | + for (testcase, expected) in testcases: |
97 | + with self.subTest(testcase=testcase): |
98 | + new_version = increment_version_security(testcase) |
99 | + self.assertEqual(increment_version_security(testcase), expected) |
100 | + # ensure expected version is actually greater than prior version |
101 | + self.assertEqual( |
102 | + _compare_versions(new_version, 'gt', testcase), 0, |
103 | + f"generated version {new_version} is not greater than original {testcase}" |
104 | + ) |
105 | + |
106 | + @unittest.expectedFailure |
107 | + def test_increment_version_security_exfail(self): |
108 | + # these tests are expected to fail, due to the current code not |
109 | + # handling them correctly; they'd be nice to fix |
110 | + testcases = [ |
111 | + ('1.2-2ubuntu0.18.04', '1.2-2ubuntu0.18.04.1'), # prior release-specific upload that doko sometimes does |
112 | + ('1.2-2ubuntu18.04', '1.2-2ubuntu18.04.1'), # prior release-specific upload |
113 | + |
114 | + # prior release-specific upload; tries to trigger the case |
115 | + # introduced in: |
116 | + # 6214e93 ("umt: Handle another versioning edge case in `umt changelog`") |
117 | + # but gets covered by earlier cases, not sure how to trigger |
118 | + # the case intended to be covered by 6214e93. |
119 | + ('9.8-2ubuntu7~18.04', '9.8-2ubuntu7~18.04.1'), |
120 | + ] |
121 | + |
122 | + for (testcase, expected) in testcases: |
123 | + with self.subTest(testcase=testcase): |
124 | + self.assertEqual(increment_version_security(testcase), expected) |
125 | + |
126 | + def test_increment_version_security_esm(self): |
127 | + testcases = [ |
128 | + ('2.1-3', '2.1-3ubuntu0.1~esm1'), # unmodified debian version |
129 | + ('2.1-3ubuntu1', '2.1-3ubuntu1+esm1'), # ubuntu version |
130 | + ('2.1-3ubuntu12', '2.1-3ubuntu12+esm1'), # ubuntu version |
131 | + ('2.95-1.2', '2.95-1.2ubuntu0.1~esm1'), |
132 | + ('1:2.13.95-1', '1:2.13.95-1ubuntu0.1~esm1'), # version with epoch |
133 | + ('9.8-2ubuntu2.1', '9.8-2ubuntu2.1+esm1'), # prior security upload |
134 | + ('9.8-2ubuntu0.18.04.1', '9.8-2ubuntu0.18.04.1+esm1'), # prior release-specific upload |
135 | + ('9.8-2ubuntu0.18.04.5', '9.8-2ubuntu0.18.04.5+esm1'), # prior release-specific upload |
136 | + # prior no-change builds |
137 | + ('2.0-2build2', '2.0-2ubuntu0.1~esm1'), # prior no-change rebuild version |
138 | + ('7.1-13build154', '7.1-13ubuntu0.1~esm1'), # whole lotta builds |
139 | + ('65', '65ubuntu0.1~esm1'), # debian native version |
140 | + ] |
141 | + |
142 | + for (testcase, expected) in testcases: |
143 | + with self.subTest(testcase=testcase): |
144 | + esm_version = increment_version_security(testcase, esm=True) |
145 | + self.assertEqual(esm_version, expected) |
146 | + |
147 | + # ensure expected version is actually greater than prior version |
148 | + self.assertEqual( |
149 | + _compare_versions(esm_version, 'gt', testcase), 0, |
150 | + f"generated version {esm_version} is not greater than original {testcase}" |
151 | + ) |
152 | + |
153 | + # ensure esm version would sort less than a no-esm increment |
154 | + no_esm_version = increment_version_security(testcase) |
155 | + self.assertEqual( |
156 | + _compare_versions(esm_version, 'lt', no_esm_version), 0, |
157 | + f"generated esm version {esm_version} is not less than generated {no_esm_version}" |
158 | + ) |
159 | + |
160 | + def test_increment_version_security_esm_existing_esm_version(self): |
161 | + testcases = [ |
162 | + ('2.1-3ubuntu0.1~esm1', '2.1-3ubuntu0.1~esm2'), |
163 | + ('2.1-3ubuntu1+esm1', '2.1-3ubuntu1+esm2'), |
164 | + ('2.1-3ubuntu1+esm9', '2.1-3ubuntu1+esm10'), |
165 | + ('2.1-3ubuntu12+esm5', '2.1-3ubuntu12+esm6'), |
166 | + ] |
167 | + for (testcase, expected) in testcases: |
168 | + with self.subTest(testcase=testcase): |
169 | + new_version = increment_version_security(testcase, esm=True) |
170 | + self.assertEqual(new_version, expected) |
171 | + # ensure expected version is actually greater than prior version |
172 | + self.assertEqual( |
173 | + _compare_versions(new_version, 'gt', testcase), 0, |
174 | + f"generated version {new_version} is not greater than original {testcase}" |
175 | + ) |
176 | + |
177 | + |
178 | def launch_dch(old_ver, new_ver, release=None, note=None, is_devel_release=False): |
179 | '''Launches dch with a new version''' |
180 | |
181 | @@ -5307,6 +5437,7 @@ def cmd_selftest(): |
182 | (opt, args) = parser.parse_known_args() |
183 | |
184 | suite = unittest.TestSuite() |
185 | + suite.addTest(unittest.TestLoader().loadTestsFromTestCase(VersionChangeTest)) |
186 | rc = unittest.TextTestRunner(verbosity=(opt.verbose * 2)).run(suite) |
187 | if not rc.wasSuccessful(): |
188 | sys.exit(1) |
189 | -- |
190 | 2.34.1 |
1 | From f3029aa6165fa25d1e8f00abd7446320774d35cd Mon Sep 17 00:00:00 2001 |
2 | From: Steve Beattie <steve.beattie@canonical.com> |
3 | Date: Tue, 6 Sep 2022 09:52:24 -0700 |
4 | Subject: [PATCH 3/3] umt: add a couple more version tests from tzdata package |
5 | |
6 | Signed-off-by: Steve Beattie <steve.beattie@canonical.com> |
7 | --- |
8 | build-tools/umt | 2 ++ |
9 | 1 file changed, 2 insertions(+) |
10 | |
11 | diff --git a/build-tools/umt b/build-tools/umt |
12 | index 72b6b32..8a77f57 100755 |
13 | --- a/build-tools/umt |
14 | +++ b/build-tools/umt |
15 | @@ -5105,6 +5105,7 @@ class VersionChangeTest(unittest.TestCase): |
16 | ('9.8-2ubuntu2.1', '9.8-2ubuntu2.2'), # prior security upload |
17 | ('9.8-2ubuntu0.18.04.1', '9.8-2ubuntu0.18.04.2'), # prior release-specific upload |
18 | ('9.8-2ubuntu0.18.04.5', '9.8-2ubuntu0.18.04.6'), # prior release-specific upload |
19 | + ('2022c-0ubuntu0.18.04.0', '2022c-0ubuntu0.18.04.1'), # real-world tzdata example |
20 | ('9.8-2ubuntu4~18.04.1', '9.8-2ubuntu4~18.04.2'), # prior release-specific upload |
21 | |
22 | # prior no-change builds |
23 | @@ -5152,6 +5153,7 @@ class VersionChangeTest(unittest.TestCase): |
24 | ('1:2.13.95-1', '1:2.13.95-1ubuntu0.1~esm1'), # version with epoch |
25 | ('9.8-2ubuntu2.1', '9.8-2ubuntu2.1+esm1'), # prior security upload |
26 | ('9.8-2ubuntu0.18.04.1', '9.8-2ubuntu0.18.04.1+esm1'), # prior release-specific upload |
27 | + ('2022c-0ubuntu0.18.04.0', '2022c-0ubuntu0.18.04.0+esm1'), # real-world tzdata example |
28 | ('9.8-2ubuntu0.18.04.5', '9.8-2ubuntu0.18.04.5+esm1'), # prior release-specific upload |
29 | # prior no-change builds |
30 | ('2.0-2build2', '2.0-2ubuntu0.1~esm1'), # prior no-change rebuild version |
31 | -- |
32 | 2.34.1 |
Alex Murray (alexmurray) wrote : | # |
Thanks for the review Steve and Spyros - it seems we can't use unittest.subtest as we are using pytest but I was able to achieve the same thing with the parametrize decorator in https:/
Preview Diff
1 | diff --git a/meta_lists/package_info_overrides.json b/meta_lists/package_info_overrides.json |
2 | index 0ce4b1e..3eadb39 100644 |
3 | --- a/meta_lists/package_info_overrides.json |
4 | +++ b/meta_lists/package_info_overrides.json |
5 | @@ -28,11 +28,11 @@ |
6 | "title": "AppArmor update" |
7 | }, |
8 | "apport": { |
9 | - "description": "", |
10 | + "description": "automatically generate crash reports for debugging", |
11 | "title": "Apport" |
12 | }, |
13 | "apr": { |
14 | - "description": "", |
15 | + "description": "Apache Portable Runtime Library", |
16 | "title": "APR" |
17 | }, |
18 | "apt": { |
19 | @@ -117,14 +117,14 @@ |
20 | }, |
21 | "boost1.50": { |
22 | "description": "C++ utility libraries", |
23 | - "title": "" |
24 | + "title": "boost1.50" |
25 | }, |
26 | "bouncycastle": { |
27 | "description": "Java implementation of cryptographic algorithms", |
28 | "title": "Bouncy Castle" |
29 | }, |
30 | "brotli": { |
31 | - "description": "", |
32 | + "description": "lossless compression algorithm and format (command line utility)", |
33 | "title": "Brotli" |
34 | }, |
35 | "bsh": { |
36 | @@ -188,7 +188,7 @@ |
37 | "title": "colord" |
38 | }, |
39 | "commons-beanutils": { |
40 | - "description": "", |
41 | + "description": "Apache Commons BeanUtils - Utility for manipulating Java beans", |
42 | "title": "Apache Commons BeanUtils" |
43 | }, |
44 | "condor": { |
45 | @@ -237,7 +237,7 @@ |
46 | }, |
47 | "db": { |
48 | "description": "Berkeley DB Utilities", |
49 | - "title": "" |
50 | + "title": "db" |
51 | }, |
52 | "db4.8": { |
53 | "description": "Berkeley DB Utilities", |
54 | @@ -264,7 +264,7 @@ |
55 | "title": "DHCP" |
56 | }, |
57 | "dino-im": { |
58 | - "description": "", |
59 | + "description": "modern XMPP client", |
60 | "title": "Dino" |
61 | }, |
62 | "djvulibre": { |
63 | @@ -340,7 +340,7 @@ |
64 | "title": "Exim" |
65 | }, |
66 | "exiv2": { |
67 | - "description": "", |
68 | + "description": "EXIF/IPTC/XMP metadata manipulation tool", |
69 | "title": "Exiv2" |
70 | }, |
71 | "expat": { |
72 | @@ -356,7 +356,7 @@ |
73 | "title": "file" |
74 | }, |
75 | "file-roller": { |
76 | - "description": "", |
77 | + "description": "archive manager for GNOME", |
78 | "title": "File Roller" |
79 | }, |
80 | "firebird2.5": { |
81 | @@ -416,7 +416,7 @@ |
82 | "title": "FreeType" |
83 | }, |
84 | "freexl": { |
85 | - "description": "", |
86 | + "description": "library for direct reading of Microsoft Excel spreadsheets", |
87 | "title": "FreeXL" |
88 | }, |
89 | "frr": { |
90 | @@ -444,7 +444,7 @@ |
91 | "title": "Ghostscript" |
92 | }, |
93 | "gifsicle": { |
94 | - "description": "", |
95 | + "description": "Tool for manipulating GIF images", |
96 | "title": "Gifsicle" |
97 | }, |
98 | "git": { |
99 | @@ -581,7 +581,7 @@ |
100 | }, |
101 | "gst-plugins-good1.0": { |
102 | "description": "GStreamer plugins", |
103 | - "title": "" |
104 | + "title": "gst-plugins-good1.0" |
105 | }, |
106 | "gtk+2.0": { |
107 | "description": "GTK+ graphical user interface library", |
108 | @@ -596,7 +596,7 @@ |
109 | "title": "gtk-vnc" |
110 | }, |
111 | "gummi": { |
112 | - "description": "", |
113 | + "description": "simple LaTeX editor with live preview", |
114 | "title": "Gummi" |
115 | }, |
116 | "gupnp": { |
117 | @@ -652,7 +652,7 @@ |
118 | "title": "HttpClient" |
119 | }, |
120 | "ibus": { |
121 | - "description": "", |
122 | + "description": "Intelligent Input Bus - core", |
123 | "title": "IBus" |
124 | }, |
125 | "icedtea-web": { |
126 | @@ -893,7 +893,7 @@ |
127 | }, |
128 | "libjpeg6b": { |
129 | "description": "library for handling JPEG files", |
130 | - "title": "" |
131 | + "title": "libjpeg6b" |
132 | }, |
133 | "libkdcraw": { |
134 | "description": "RAW picture decoding library", |
135 | @@ -952,7 +952,7 @@ |
136 | "title": "OpenMPT" |
137 | }, |
138 | "libpam-krb5": { |
139 | - "description": "", |
140 | + "description": "PAM module for MIT Kerberos", |
141 | "title": "pam-krb5" |
142 | }, |
143 | "libpcap": { |
144 | @@ -1057,7 +1057,7 @@ |
145 | }, |
146 | "libu2f-host": { |
147 | "description": "Universal 2nd Factor (U2F) host communication C Library", |
148 | - "title": "" |
149 | + "title": "libu2f-host" |
150 | }, |
151 | "libunity-webapps": { |
152 | "description": "UnityWebapps library", |
153 | @@ -1129,7 +1129,7 @@ |
154 | }, |
155 | "libxrandr": { |
156 | "description": "X11 RandR extension library", |
157 | - "title": "" |
158 | + "title": "libxrandr" |
159 | }, |
160 | "libxrandr-lts-quantal": { |
161 | "description": "X11 RandR extension library", |
162 | @@ -1421,7 +1421,7 @@ |
163 | }, |
164 | "linux-linaro": { |
165 | "description": "Linux kernel for ARM", |
166 | - "title": "" |
167 | + "title": "linux-linaro" |
168 | }, |
169 | "linux-lowlatency": { |
170 | "description": "Linux low latency kernel", |
171 | @@ -1553,7 +1553,7 @@ |
172 | }, |
173 | "linux-qcm-msm": { |
174 | "description": "Linux kernel for MSM", |
175 | - "title": "" |
176 | + "title": "linux-qcm-msm" |
177 | }, |
178 | "linux-raspi": { |
179 | "description": "Linux kernel for Raspberry Pi systems", |
180 | @@ -1697,7 +1697,7 @@ |
181 | }, |
182 | "mesa-lts-quantal": { |
183 | "description": "free implementation of the EGL API", |
184 | - "title": "" |
185 | + "title": "mesa-lts-quantal" |
186 | }, |
187 | "mime-support": { |
188 | "description": "MIME support programs", |
189 | @@ -1708,7 +1708,7 @@ |
190 | "title": "mini_httpd" |
191 | }, |
192 | "minicom": { |
193 | - "description": "", |
194 | + "description": "Friendly menu driven serial communication program", |
195 | "title": "Minicom" |
196 | }, |
197 | "miniupnpc": { |
198 | @@ -1724,7 +1724,7 @@ |
199 | "title": "MongoDB" |
200 | }, |
201 | "monit": { |
202 | - "description": "", |
203 | + "description": "utility for monitoring and managing daemons or similar programs", |
204 | "title": "Monit" |
205 | }, |
206 | "mono": { |
207 | @@ -1748,7 +1748,7 @@ |
208 | "title": "MPlayer" |
209 | }, |
210 | "mumble": { |
211 | - "description": "", |
212 | + "description": "Low latency encrypted VoIP client", |
213 | "title": "Mumble" |
214 | }, |
215 | "munin": { |
216 | @@ -1756,12 +1756,12 @@ |
217 | "title": "Munin" |
218 | }, |
219 | "mutt": { |
220 | - "description": "", |
221 | + "description": "text-based mailreader supporting MIME, GPG, PGP and threading", |
222 | "title": "Mutt" |
223 | }, |
224 | "mysql-5.1": { |
225 | "description": "MySQL database", |
226 | - "title": "" |
227 | + "title": "mysql-5.1" |
228 | }, |
229 | "mysql-5.5": { |
230 | "description": "MySQL database", |
231 | @@ -1769,7 +1769,7 @@ |
232 | }, |
233 | "mysql-5.6": { |
234 | "description": "MySQL database", |
235 | - "title": "" |
236 | + "title": "mysql-5.6" |
237 | }, |
238 | "mysql-5.7": { |
239 | "description": "MySQL database", |
240 | @@ -1785,7 +1785,7 @@ |
241 | }, |
242 | "mysql-dfsg-5.1": { |
243 | "description": "MySQL database", |
244 | - "title": "" |
245 | + "title": "mysql-dfsg-5.1" |
246 | }, |
247 | "nas": { |
248 | "description": "Network Audio System", |
249 | @@ -1804,7 +1804,7 @@ |
250 | "title": "Net-SNMP" |
251 | }, |
252 | "netatalk": { |
253 | - "description": "", |
254 | + "description": "Apple Filing Protocol service", |
255 | "title": "Netatalk" |
256 | }, |
257 | "netqmail": { |
258 | @@ -1852,7 +1852,7 @@ |
259 | "title": "NTFS-3G" |
260 | }, |
261 | "ntp": { |
262 | - "description": "", |
263 | + "description": "Network Time Protocol daemon/utilities (transitional package)", |
264 | "title": "NTP" |
265 | }, |
266 | "numpy": { |
267 | @@ -1865,7 +1865,7 @@ |
268 | }, |
269 | "nvidia-graphics-drivers": { |
270 | "description": "NVIDIA binary X.Org driver", |
271 | - "title": "" |
272 | + "title": "nvidia-graphics-drivers" |
273 | }, |
274 | "nvidia-graphics-drivers-173": { |
275 | "description": "NVIDIA binary X.Org driver", |
276 | @@ -1873,7 +1873,7 @@ |
277 | }, |
278 | "nvidia-graphics-drivers-173-updates": { |
279 | "description": "NVIDIA binary X.Org driver", |
280 | - "title": "" |
281 | + "title": "nvidia-graphics-drivers-173-updates" |
282 | }, |
283 | "nvidia-graphics-drivers-304": { |
284 | "description": "NVIDIA binary X.Org driver", |
285 | @@ -1881,35 +1881,35 @@ |
286 | }, |
287 | "nvidia-graphics-drivers-304-updates": { |
288 | "description": "NVIDIA binary X.Org driver", |
289 | - "title": "" |
290 | + "title": "nvidia-graphics-drivers-304-updates" |
291 | }, |
292 | "nvidia-graphics-drivers-331": { |
293 | "description": "NVIDIA binary X.Org driver", |
294 | - "title": "" |
295 | + "title": "nvidia-graphics-drivers-331" |
296 | }, |
297 | "nvidia-graphics-drivers-331-updates": { |
298 | "description": "NVIDIA binary X.Org driver", |
299 | - "title": "" |
300 | + "title": "nvidia-graphics-drivers-331-updates" |
301 | }, |
302 | "nvidia-graphics-drivers-340": { |
303 | "description": "NVIDIA binary X.Org driver", |
304 | - "title": "" |
305 | + "title": "nvidia-graphics-drivers-340" |
306 | }, |
307 | "nvidia-graphics-drivers-340-updates": { |
308 | "description": "NVIDIA binary X.Org driver", |
309 | - "title": "" |
310 | + "title": "nvidia-graphics-drivers-340-updates" |
311 | }, |
312 | "nvidia-graphics-drivers-352": { |
313 | "description": "NVIDIA binary X.Org driver", |
314 | - "title": "" |
315 | + "title": "nvidia-graphics-drivers-352" |
316 | }, |
317 | "nvidia-graphics-drivers-352-updates": { |
318 | "description": "NVIDIA binary X.Org driver", |
319 | - "title": "" |
320 | + "title": "nvidia-graphics-drivers-352-updates" |
321 | }, |
322 | "nvidia-graphics-drivers-367": { |
323 | "description": "NVIDIA binary X.Org driver", |
324 | - "title": "" |
325 | + "title": "nvidia-graphics-drivers-367" |
326 | }, |
327 | "nvidia-graphics-drivers-375": { |
328 | "description": "NVIDIA binary X.Org driver", |
329 | @@ -1977,11 +1977,11 @@ |
330 | }, |
331 | "nvidia-settings": { |
332 | "description": "Tool for configuring the NVIDIA graphics driver", |
333 | - "title": "" |
334 | + "title": "nvidia-settings" |
335 | }, |
336 | "nvidia-settings-updates": { |
337 | "description": "Tool for configuring the NVIDIA graphics driver", |
338 | - "title": "" |
339 | + "title": "nvidia-settings-updates" |
340 | }, |
341 | "octavia": { |
342 | "description": "OpenStack Load Balancer Service", |
343 | @@ -2060,7 +2060,7 @@ |
344 | "title": "OpenSLP" |
345 | }, |
346 | "opensmtpd": { |
347 | - "description": "", |
348 | + "description": "secure, reliable, lean, and easy-to configure SMTP server", |
349 | "title": "OpenSMTPD" |
350 | }, |
351 | "openssh": { |
352 | @@ -2133,7 +2133,7 @@ |
353 | }, |
354 | "php-perl": { |
355 | "description": "PHP Extension and Application Repository", |
356 | - "title": "" |
357 | + "title": "php-perl" |
358 | }, |
359 | "php5": { |
360 | "description": "HTML-embedded scripting language interpreter", |
361 | @@ -2145,7 +2145,7 @@ |
362 | }, |
363 | "php7.1": { |
364 | "description": "HTML-embedded scripting language interpreter", |
365 | - "title": "" |
366 | + "title": "php7.1" |
367 | }, |
368 | "php7.2": { |
369 | "description": "HTML-embedded scripting language interpreter", |
370 | @@ -2168,7 +2168,7 @@ |
371 | "title": "phpLDAPadmin" |
372 | }, |
373 | "phpmyadmin": { |
374 | - "description": "", |
375 | + "description": "MySQL web administration tool", |
376 | "title": "phpMyAdmin" |
377 | }, |
378 | "pillow": { |
379 | @@ -2229,7 +2229,7 @@ |
380 | }, |
381 | "postgresql-9.4": { |
382 | "description": "Object-relational SQL database", |
383 | - "title": "" |
384 | + "title": "postgresql-9.4" |
385 | }, |
386 | "postgresql-9.5": { |
387 | "description": "Object-relational SQL database", |
388 | @@ -2304,7 +2304,7 @@ |
389 | "title": "Python Imaging Library" |
390 | }, |
391 | "python-ldap": { |
392 | - "description": "", |
393 | + "description": "LDAP interface module for Python", |
394 | "title": "Python LDAP" |
395 | }, |
396 | "python-pip": { |
397 | @@ -2324,7 +2324,7 @@ |
398 | "title": "urllib3" |
399 | }, |
400 | "python-werkzeug": { |
401 | - "description": "", |
402 | + "description": "collection of utilities for WSGI applications", |
403 | "title": "Werkzeug" |
404 | }, |
405 | "python2.6": { |
406 | @@ -2361,7 +2361,7 @@ |
407 | }, |
408 | "python3.6": { |
409 | "description": "An interactive high-level object-oriented language", |
410 | - "title": "" |
411 | + "title": "python3.6" |
412 | }, |
413 | "python3.7": { |
414 | "description": "An interactive high-level object-oriented language", |
415 | @@ -2481,11 +2481,11 @@ |
416 | }, |
417 | "ruby2.0": { |
418 | "description": "Object-oriented scripting language", |
419 | - "title": "" |
420 | + "title": "ruby2.0" |
421 | }, |
422 | "ruby2.1": { |
423 | "description": "Object-oriented scripting language", |
424 | - "title": "" |
425 | + "title": "ruby2.1" |
426 | }, |
427 | "ruby2.3": { |
428 | "description": "Object-oriented scripting language", |
429 | @@ -2600,7 +2600,7 @@ |
430 | "title": "SSSD" |
431 | }, |
432 | "ssvnc": { |
433 | - "description": "", |
434 | + "description": "Enhanced TightVNC viewer with SSL/SSH tunnel helper", |
435 | "title": "SSVNC" |
436 | }, |
437 | "strongswan": { |
438 | @@ -2620,11 +2620,11 @@ |
439 | "title": "OpenStack Swift" |
440 | }, |
441 | "sysstat": { |
442 | - "description": "", |
443 | + "description": "system performance tools for Linux", |
444 | "title": "Sysstat" |
445 | }, |
446 | "teeworlds": { |
447 | - "description": "", |
448 | + "description": "online multi-player platform 2D shooter", |
449 | "title": "Teeworlds" |
450 | }, |
451 | "thunderbird": { |
452 | @@ -2712,15 +2712,15 @@ |
453 | "title": "UW IMAP" |
454 | }, |
455 | "uwsgi": { |
456 | - "description": "", |
457 | + "description": "fast, self-healing application container server", |
458 | "title": "uWSGI" |
459 | }, |
460 | "vcftools": { |
461 | - "description": "", |
462 | + "description": "Collection of tools to work with VCF files", |
463 | "title": "VCFtools" |
464 | }, |
465 | "vim": { |
466 | - "description": "", |
467 | + "description": "Vi IMproved - enhanced vi editor", |
468 | "title": "Vim" |
469 | }, |
470 | "vino": { |
471 | @@ -2740,11 +2740,11 @@ |
472 | "title": "vsftpd" |
473 | }, |
474 | "vtk": { |
475 | - "description": "", |
476 | + "description": "Visualization Toolkit - A high level 3D visualization library", |
477 | "title": "VTK" |
478 | }, |
479 | "wavpack": { |
480 | - "description": "", |
481 | + "description": "audio codec (lossy and lossless) - encoder and decoder", |
482 | "title": "WavPack" |
483 | }, |
484 | "wayland": { |
485 | @@ -2813,23 +2813,23 @@ |
486 | }, |
487 | "xorg-server-lts-raring": { |
488 | "description": "X.Org X11 server", |
489 | - "title": "" |
490 | + "title": "xorg-server-lts-raring" |
491 | }, |
492 | "xorg-server-lts-trusty": { |
493 | "description": "X.Org X11 server", |
494 | - "title": "" |
495 | + "title": "xorg-server-lts-trusty" |
496 | }, |
497 | "xorg-server-lts-utopic": { |
498 | "description": "X.Org X11 server", |
499 | - "title": "" |
500 | + "title": "xorg-server-lts-utopic" |
501 | }, |
502 | "xorg-server-lts-vivid": { |
503 | "description": "X.Org X11 server", |
504 | - "title": "" |
505 | + "title": "xorg-server-lts-vivid" |
506 | }, |
507 | "xorg-server-lts-xenial": { |
508 | "description": "X.Org X11 server", |
509 | - "title": "" |
510 | + "title": "xorg-server-lts-xenial" |
511 | }, |
512 | "xulrunner-1.9.2": { |
513 | "description": "Mozilla Gecko runtime environment", |
514 | diff --git a/scripts/test_cve_lib.py b/scripts/test_cve_lib.py |
515 | index cdfa1aa..8bf4509 100755 |
516 | --- a/scripts/test_cve_lib.py |
517 | +++ b/scripts/test_cve_lib.py |
518 | @@ -59,8 +59,14 @@ class TestPackageOverrideTests: |
519 | def test_get_desc_linux(self): |
520 | assert cve_lib.lookup_package_override_description('linux') == 'Linux kernel' |
521 | |
522 | - # XXX add a test to validate that all the package description |
523 | - # XXX override entries have both a non-empty title and description. |
524 | + @pytest.mark.parametrize("pkg", cve_lib.package_info_overrides.keys()) |
525 | + def test_all_non_empty(self, pkg): |
526 | + title = cve_lib.lookup_package_override_title(pkg) |
527 | + desc = cve_lib.lookup_package_override_description(pkg) |
528 | + assert title is not None |
529 | + assert desc is not None |
530 | + assert len(title) > 0 |
531 | + assert len(desc) > 0 |
532 | |
533 | |
534 | TEST_DATA_DIR = "test/" |
LGTM