diff options
| author | Simone Weiß <simone.p.weiss@posteo.com> | 2023-12-11 16:45:53 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-02 22:51:01 +0000 |
| commit | 70a92a2f8bfd0fce7e631972c2aff05121024dc2 (patch) | |
| tree | 55ba86131e1aeaee389f69ffd9b96a5313791eaa | |
| parent | 5d7a4304d91800ee1cb8d4618ce1867c0a47abd5 (diff) | |
| download | poky-70a92a2f8bfd0fce7e631972c2aff05121024dc2.tar.gz | |
patchtest: Add test for deprecated CVE_CHECK_IGNORE
If a recipes was modified recommand the use of `CVE_STATUS` instead if
`CVE_CHECK_IGNORE` is used. This is a depreacted variable and will
result in a warning from the cve-check.class and should hence not be
used anymore. [YOCTO #15311]
(From OE-Core rev: 5c264063f6363e5ff88146125217b6089eb22f12)
Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/patchtest/tests/test_metadata.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/lib/patchtest/tests/test_metadata.py b/meta/lib/patchtest/tests/test_metadata.py index b6f4456ad2..174dfc31c6 100644 --- a/meta/lib/patchtest/tests/test_metadata.py +++ b/meta/lib/patchtest/tests/test_metadata.py | |||
| @@ -25,6 +25,8 @@ class TestMetadata(base.Metadata): | |||
| 25 | sha256sum = 'sha256sum' | 25 | sha256sum = 'sha256sum' |
| 26 | git_regex = pyparsing.Regex('^git\:\/\/.*') | 26 | git_regex = pyparsing.Regex('^git\:\/\/.*') |
| 27 | metadata_summary = 'SUMMARY' | 27 | metadata_summary = 'SUMMARY' |
| 28 | cve_check_ignore_var = 'CVE_CHECK_IGNORE' | ||
| 29 | cve_status_var = 'CVE_STATUS' | ||
| 28 | 30 | ||
| 29 | def test_license_presence(self): | 31 | def test_license_presence(self): |
| 30 | if not self.added: | 32 | if not self.added: |
| @@ -178,3 +180,16 @@ class TestMetadata(base.Metadata): | |||
| 178 | # "${PN} version ${PN}-${PR}" is the default, so fail if default | 180 | # "${PN} version ${PN}-${PR}" is the default, so fail if default |
| 179 | if summary.startswith('%s version' % pn): | 181 | if summary.startswith('%s version' % pn): |
| 180 | self.fail('%s is missing in newly added recipe' % self.metadata_summary) | 182 | self.fail('%s is missing in newly added recipe' % self.metadata_summary) |
| 183 | |||
| 184 | def test_cve_check_ignore(self): | ||
| 185 | if not self.modified: | ||
| 186 | self.skip('No modified recipes, skipping test') | ||
| 187 | for pn in self.modified: | ||
| 188 | # we are not interested in images | ||
| 189 | if 'core-image' in pn: | ||
| 190 | continue | ||
| 191 | rd = self.tinfoil.parse_recipe(pn) | ||
| 192 | cve_check_ignore = rd.getVar(self.cve_check_ignore_var) | ||
| 193 | |||
| 194 | if cve_check_ignore is not None: | ||
| 195 | self.fail('%s is deprecated and should be replaced by %s' % (self.cve_check_ignore_var, self.cve_status_var)) | ||
