diff options
author | Lee Chee Yang <chee.yang.lee@intel.com> | 2021-03-04 22:44:07 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-28 22:31:47 +0100 |
commit | b9739ad63a9465ae581ff00aadf72d5ea18af928 (patch) | |
tree | 48f88fca0a0ff3bace0fba0170da3adc7d3d8235 /meta/lib/oeqa/selftest/cases | |
parent | daf52f58e3b03db71030ee30d2c836163f2a057d (diff) | |
download | poky-b9739ad63a9465ae581ff00aadf72d5ea18af928.tar.gz |
cve-check: CVE_VERSION_SUFFIX to work with patched release
CVE_VERSION_SUFFIX in "patch" to treat version string with suffix "pX"
or "patchX" as patched release.
also update testcases to cover this changes and set CVE_VERSION_SUFFIX
for sudo.
(From OE-Core rev: d75f95a09e5e85eb759e748f9e0fee1c5fa1b318)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 8076815fc2ffc8f632e73527ce2b7d158a29e9ea)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/cve_check.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/cve_check.py b/meta/lib/oeqa/selftest/cases/cve_check.py index 3f343a2841..d1947baffc 100644 --- a/meta/lib/oeqa/selftest/cases/cve_check.py +++ b/meta/lib/oeqa/selftest/cases/cve_check.py | |||
@@ -34,3 +34,11 @@ class CVECheck(OESelftestTestCase): | |||
34 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'") | 34 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'") |
35 | result = Version("1.0b","alphabetical") > Version("1.0","alphabetical") | 35 | result = Version("1.0b","alphabetical") > Version("1.0","alphabetical") |
36 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'") | 36 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'") |
37 | |||
38 | # consider the trailing "p" and "patch" as patched released when comparing | ||
39 | result = Version("1.0","patch") < Version("1.0p1","patch") | ||
40 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0' < '1.0p1'") | ||
41 | result = Version("1.0p2","patch") > Version("1.0p1","patch") | ||
42 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'") | ||
43 | result = Version("1.0_patch2","patch") < Version("1.0_patch3","patch") | ||
44 | self.assertTrue( result ,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'") | ||