diff options
Diffstat (limited to 'meta/lib/patchtest')
55 files changed, 1522 insertions, 1445 deletions
diff --git a/meta/lib/patchtest/README.md b/meta/lib/patchtest/README.md index f66613c0c1..27cc61c802 100644 --- a/meta/lib/patchtest/README.md +++ b/meta/lib/patchtest/README.md | |||
@@ -1,12 +1,12 @@ | |||
1 | # patchtest selftests for openembedded-core | 1 | # patchtest selftests for openembedded-core |
2 | 2 | ||
3 | This directory provides a test suite and selftest script for use with the | 3 | This directory provides a test suite and selftest script for use with the |
4 | patchtest repository: https://git.yoctoproject.org/patchtest/ | 4 | patchtest repository: <https://git.yoctoproject.org/patchtest/> |
5 | 5 | ||
6 | To setup for use: | 6 | To setup for use: |
7 | 7 | ||
8 | 1. Clone https://git.openembedded.org/openembedded-core (this repo) and https://git.openembedded.org/bitbake/ | 8 | 1. Clone <https://git.openembedded.org/openembedded-core> (this repo) and <https://git.openembedded.org/bitbake/> |
9 | 2. Clone https://git.yoctoproject.org/patchtest | 9 | 2. Clone <https://git.yoctoproject.org/patchtest> |
10 | 3. Install the necessary Python modules: in meta/lib/patchtest or the patchtest | 10 | 3. Install the necessary Python modules: in meta/lib/patchtest or the patchtest |
11 | repo, do `pip install -r requirements.txt` | 11 | repo, do `pip install -r requirements.txt` |
12 | 4. Add patchtest to PATH: `export PATH=/path/to/patchtest/repo:$PATH` | 12 | 4. Add patchtest to PATH: `export PATH=/path/to/patchtest/repo:$PATH` |
@@ -17,4 +17,4 @@ To setup for use: | |||
17 | 7. Finally, run the selftest script: `./meta/lib/patchtest/selftest/selftest` | 17 | 7. Finally, run the selftest script: `./meta/lib/patchtest/selftest/selftest` |
18 | 18 | ||
19 | For more information on using patchtest, see the patchtest repo at | 19 | For more information on using patchtest, see the patchtest repo at |
20 | https://git.yoctoproject.org/patchtest/. | 20 | <https://git.yoctoproject.org/patchtest/>. |
diff --git a/meta/lib/patchtest/mbox.py b/meta/lib/patchtest/mbox.py new file mode 100644 index 0000000000..1d95819b7a --- /dev/null +++ b/meta/lib/patchtest/mbox.py | |||
@@ -0,0 +1,108 @@ | |||
1 | #! /usr/bin/env python3 | ||
2 | |||
3 | # series.py | ||
4 | # | ||
5 | # Read a series' mbox file and get information about the patches | ||
6 | # contained | ||
7 | # | ||
8 | # Copyright (C) 2024 BayLibre SAS | ||
9 | # | ||
10 | # SPDX-License-Identifier: GPL-2.0-only | ||
11 | # | ||
12 | |||
13 | import email | ||
14 | import re | ||
15 | |||
16 | # From: https://stackoverflow.com/questions/59681461/read-a-big-mbox-file-with-python | ||
17 | class MboxReader: | ||
18 | def __init__(self, filepath): | ||
19 | self.handle = open(filepath, 'rb') | ||
20 | assert self.handle.readline().startswith(b'From ') | ||
21 | |||
22 | def __enter__(self): | ||
23 | return self | ||
24 | |||
25 | def __exit__(self, exc_type, exc_value, exc_traceback): | ||
26 | self.handle.close() | ||
27 | |||
28 | def __iter__(self): | ||
29 | return iter(self.__next__()) | ||
30 | |||
31 | def __next__(self): | ||
32 | lines = [] | ||
33 | while True: | ||
34 | line = self.handle.readline() | ||
35 | if line == b'' or line.startswith(b'From '): | ||
36 | yield email.message_from_bytes(b''.join(lines)) | ||
37 | if line == b'': | ||
38 | break | ||
39 | lines = [] | ||
40 | continue | ||
41 | lines.append(line) | ||
42 | |||
43 | class Patch: | ||
44 | def __init__(self, data): | ||
45 | self.author = data['From'] | ||
46 | self.to = data['To'] | ||
47 | self.cc = data['Cc'] | ||
48 | self.subject = data['Subject'] | ||
49 | self.split_body = re.split('---', data.get_payload(), maxsplit=1) | ||
50 | self.commit_message = self.split_body[0] | ||
51 | self.diff = self.split_body[1] | ||
52 | |||
53 | class PatchSeries: | ||
54 | def __init__(self, filepath): | ||
55 | with MboxReader(filepath) as mbox: | ||
56 | self.patches = [Patch(message) for message in mbox] | ||
57 | |||
58 | assert self.patches | ||
59 | self.patch_count = len(self.patches) | ||
60 | self.path = filepath | ||
61 | |||
62 | @property | ||
63 | def path(self): | ||
64 | return self.path | ||
65 | |||
66 | self.branch = self.get_branch() | ||
67 | |||
68 | def get_branch(self): | ||
69 | fullprefix = "" | ||
70 | pattern = re.compile(r"(\[.*\])", re.DOTALL) | ||
71 | |||
72 | # There should be at least one patch in the series and it should | ||
73 | # include the branch name in the subject, so parse that | ||
74 | match = pattern.search(self.patches[0].subject) | ||
75 | if match: | ||
76 | fullprefix = match.group(1) | ||
77 | |||
78 | branch, branches, valid_branches = None, [], [] | ||
79 | |||
80 | if fullprefix: | ||
81 | prefix = fullprefix.strip('[]') | ||
82 | branches = [ b.strip() for b in prefix.split(',')] | ||
83 | valid_branches = [b for b in branches if PatchSeries.valid_branch(b)] | ||
84 | |||
85 | if len(valid_branches): | ||
86 | branch = valid_branches[0] | ||
87 | |||
88 | # Get the branch name excluding any brackets. If nothing was | ||
89 | # found, then assume there was no branch tag in the subject line | ||
90 | # and that the patch targets master | ||
91 | if branch is not None: | ||
92 | return branch.split(']')[0] | ||
93 | else: | ||
94 | return "master" | ||
95 | |||
96 | @staticmethod | ||
97 | def valid_branch(branch): | ||
98 | """ Check if branch is valid name """ | ||
99 | lbranch = branch.lower() | ||
100 | |||
101 | invalid = lbranch.startswith('patch') or \ | ||
102 | lbranch.startswith('rfc') or \ | ||
103 | lbranch.startswith('resend') or \ | ||
104 | re.search(r'^v\d+', lbranch) or \ | ||
105 | re.search(r'^\d+/\d+', lbranch) | ||
106 | |||
107 | return not invalid | ||
108 | |||
diff --git a/meta/lib/patchtest/patch.py b/meta/lib/patchtest/patch.py deleted file mode 100644 index baf6283873..0000000000 --- a/meta/lib/patchtest/patch.py +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # patchtestpatch: PatchTestPatch class which abstracts a patch file | ||
5 | # | ||
6 | # Copyright (C) 2016 Intel Corporation | ||
7 | # | ||
8 | # SPDX-License-Identifier: GPL-2.0-only | ||
9 | # | ||
10 | |||
11 | import logging | ||
12 | import utils | ||
13 | |||
14 | logger = logging.getLogger('patchtest') | ||
15 | |||
16 | class PatchTestPatch(object): | ||
17 | MERGE_STATUS_INVALID = 'INVALID' | ||
18 | MERGE_STATUS_NOT_MERGED = 'NOTMERGED' | ||
19 | MERGE_STATUS_MERGED_SUCCESSFULL = 'PASS' | ||
20 | MERGE_STATUS_MERGED_FAIL = 'FAIL' | ||
21 | MERGE_STATUS = (MERGE_STATUS_INVALID, | ||
22 | MERGE_STATUS_NOT_MERGED, | ||
23 | MERGE_STATUS_MERGED_SUCCESSFULL, | ||
24 | MERGE_STATUS_MERGED_FAIL) | ||
25 | |||
26 | def __init__(self, path, forcereload=False): | ||
27 | self._path = path | ||
28 | self._forcereload = forcereload | ||
29 | |||
30 | self._contents = None | ||
31 | self._branch = None | ||
32 | self._merge_status = PatchTestPatch.MERGE_STATUS_NOT_MERGED | ||
33 | |||
34 | @property | ||
35 | def contents(self): | ||
36 | if self._forcereload or (not self._contents): | ||
37 | logger.debug('Reading %s contents' % self._path) | ||
38 | try: | ||
39 | with open(self._path, newline='') as _f: | ||
40 | self._contents = _f.read() | ||
41 | except IOError: | ||
42 | logger.warn("Reading the mbox %s failed" % self.resource) | ||
43 | return self._contents | ||
44 | |||
45 | @property | ||
46 | def path(self): | ||
47 | return self._path | ||
48 | |||
49 | @property | ||
50 | def branch(self): | ||
51 | if not self._branch: | ||
52 | self._branch = utils.get_branch(self._path) | ||
53 | return self._branch | ||
54 | |||
55 | def setmergestatus(self, status): | ||
56 | self._merge_status = status | ||
57 | |||
58 | def getmergestatus(self): | ||
59 | return self._merge_status | ||
60 | |||
61 | merge_status = property(getmergestatus, setmergestatus) | ||
62 | |||
diff --git a/meta/lib/patchtest/data.py b/meta/lib/patchtest/patchtest_parser.py index 356259921d..2a11cb76c2 100644 --- a/meta/lib/patchtest/data.py +++ b/meta/lib/patchtest/patchtest_parser.py | |||
@@ -15,19 +15,11 @@ | |||
15 | 15 | ||
16 | import os | 16 | import os |
17 | import argparse | 17 | import argparse |
18 | import collections | ||
19 | import logging | ||
20 | |||
21 | logger=logging.getLogger('patchtest') | ||
22 | info=logger.info | ||
23 | 18 | ||
24 | default_testdir = os.path.abspath(os.path.dirname(__file__) + "/tests") | 19 | default_testdir = os.path.abspath(os.path.dirname(__file__) + "/tests") |
25 | default_repodir = os.path.abspath(os.path.dirname(__file__) + "/../../..") | 20 | default_repodir = os.path.abspath(os.path.dirname(__file__) + "/../../..") |
26 | 21 | ||
27 | # Data store commonly used to share values between pre and post-merge tests | 22 | class PatchtestParser(object): |
28 | PatchTestDataStore = collections.defaultdict(str) | ||
29 | |||
30 | class PatchTestInput(object): | ||
31 | """Abstract the patchtest argument parser""" | 23 | """Abstract the patchtest argument parser""" |
32 | 24 | ||
33 | @classmethod | 25 | @classmethod |
diff --git a/meta/lib/patchtest/patchtest_patterns.py b/meta/lib/patchtest/patchtest_patterns.py new file mode 100644 index 0000000000..50637cf499 --- /dev/null +++ b/meta/lib/patchtest/patchtest_patterns.py | |||
@@ -0,0 +1,98 @@ | |||
1 | # common pyparsing variables | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | |||
7 | import pyparsing | ||
8 | import re | ||
9 | |||
10 | # general | ||
11 | colon = pyparsing.Literal(":") | ||
12 | line_start = pyparsing.LineStart() | ||
13 | line_end = pyparsing.LineEnd() | ||
14 | lessthan = pyparsing.Literal("<") | ||
15 | greaterthan = pyparsing.Literal(">") | ||
16 | inappropriate = pyparsing.CaselessLiteral("Inappropriate") | ||
17 | submitted = pyparsing.CaselessLiteral("Submitted") | ||
18 | |||
19 | # word related | ||
20 | nestexpr = pyparsing.nestedExpr(opener='[', closer=']') | ||
21 | inappropriateinfo = pyparsing.Literal("Inappropriate") + nestexpr | ||
22 | submittedinfo = pyparsing.Literal("Submitted") + nestexpr | ||
23 | word = pyparsing.Word(pyparsing.alphas) | ||
24 | worddot = pyparsing.Word(pyparsing.alphas+".") | ||
25 | |||
26 | # metadata | ||
27 | |||
28 | metadata_lic = 'LICENSE' | ||
29 | invalid_license = 'PATCHTESTINVALID' | ||
30 | metadata_chksum = 'LIC_FILES_CHKSUM' | ||
31 | license_var = 'LICENSE' | ||
32 | closed = 'CLOSED' | ||
33 | lictag_re = pyparsing.AtLineStart("License-Update:") | ||
34 | lic_chksum_added = pyparsing.AtLineStart("+" + metadata_chksum) | ||
35 | lic_chksum_removed = pyparsing.AtLineStart("-" + metadata_chksum) | ||
36 | add_mark = pyparsing.Regex('\\+ ') | ||
37 | patch_max_line_length = 200 | ||
38 | metadata_src_uri = "SRC_URI" | ||
39 | metadata_summary = "SUMMARY" | ||
40 | cve_check_ignore_var = "CVE_CHECK_IGNORE" | ||
41 | cve_status_var = "CVE_STATUS" | ||
42 | endcommit_messages_regex = re.compile( | ||
43 | r"\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n" | ||
44 | ) | ||
45 | patchmetadata_regex = re.compile( | ||
46 | r"-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+" | ||
47 | ) | ||
48 | |||
49 | # mbox | ||
50 | auh_email = 'auh@yoctoproject.org' | ||
51 | |||
52 | invalid_submitters = [pyparsing.Regex("^Upgrade Helper.+"), | ||
53 | pyparsing.Regex(auh_email), | ||
54 | pyparsing.Regex("uh@not\.set"), | ||
55 | pyparsing.Regex("\S+@example\.com")] | ||
56 | |||
57 | mbox_bugzilla = pyparsing.Regex('\[\s?YOCTO.*\]') | ||
58 | mbox_bugzilla_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') | ||
59 | mbox_revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') | ||
60 | mbox_shortlog_maxlength = 90 | ||
61 | # based on https://stackoverflow.com/questions/30281026/regex-parsing-github-usernames-javascript | ||
62 | mbox_github_username = pyparsing.Regex('\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))') | ||
63 | |||
64 | # patch | ||
65 | |||
66 | cve = pyparsing.Regex("CVE\-\d{4}\-\d+") | ||
67 | cve_payload_tag = pyparsing.Regex("\+CVE:(\s+CVE\-\d{4}\-\d+)+") | ||
68 | upstream_status_regex = pyparsing.AtLineStart("+" + "Upstream-Status") | ||
69 | |||
70 | # shortlog | ||
71 | |||
72 | shortlog_target = pyparsing.OneOrMore(pyparsing.Word(pyparsing.printables.replace(':',''))) | ||
73 | shortlog_summary = pyparsing.OneOrMore(pyparsing.Word(pyparsing.printables)) | ||
74 | shortlog = line_start + shortlog_target + colon + shortlog_summary + line_end | ||
75 | |||
76 | # signed-off-bys | ||
77 | |||
78 | email_pattern = pyparsing.Regex(r"(?P<user>[A-Za-z0-9._%+-]+)@(?P<hostname>[A-Za-z0-9.-]+)\.(?P<domain>[A-Za-z]{2,})") | ||
79 | |||
80 | signed_off_by_prefix = pyparsing.Literal("Signed-off-by:") | ||
81 | signed_off_by_name = pyparsing.Regex('\S+.*(?= <)') | ||
82 | signed_off_by_email = lessthan + email_pattern + greaterthan | ||
83 | signed_off_by = pyparsing.AtLineStart(signed_off_by_prefix + signed_off_by_name + signed_off_by_email) | ||
84 | patch_signed_off_by = pyparsing.AtLineStart("+" + signed_off_by_prefix + signed_off_by_name + signed_off_by_email) | ||
85 | |||
86 | # upstream-status | ||
87 | |||
88 | upstream_status_literal_valid_status = ["Pending", "Backport", "Denied", "Inappropriate", "Submitted", "Inactive-Upstream"] | ||
89 | upstream_status_nonliteral_valid_status = ["Pending", "Backport", "Denied", "Inappropriate [reason]", "Submitted [where]", "Inactive-Upstream [lastcommit: when (and/or) lastrelease: when]"] | ||
90 | |||
91 | upstream_status_valid_status = pyparsing.Or( | ||
92 | [pyparsing.Literal(status) for status in upstream_status_literal_valid_status] | ||
93 | ) | ||
94 | |||
95 | upstream_status_prefix = pyparsing.Literal("Upstream-Status") | ||
96 | upstream_status = line_start + upstream_status_prefix + colon + upstream_status_valid_status | ||
97 | upstream_status_inappropriate_info = line_start + upstream_status_prefix + colon + inappropriateinfo | ||
98 | upstream_status_submitted_info = line_start + upstream_status_prefix + colon + submittedinfo | ||
diff --git a/meta/lib/patchtest/repo.py b/meta/lib/patchtest/repo.py index d3788f466d..8ec8f68a0b 100644 --- a/meta/lib/patchtest/repo.py +++ b/meta/lib/patchtest/repo.py | |||
@@ -8,13 +8,9 @@ | |||
8 | # SPDX-License-Identifier: GPL-2.0-only | 8 | # SPDX-License-Identifier: GPL-2.0-only |
9 | # | 9 | # |
10 | 10 | ||
11 | import git | ||
11 | import os | 12 | import os |
12 | import utils | 13 | import mbox |
13 | import logging | ||
14 | from patch import PatchTestPatch | ||
15 | |||
16 | logger = logging.getLogger('patchtest') | ||
17 | info=logger.info | ||
18 | 14 | ||
19 | class PatchTestRepo(object): | 15 | class PatchTestRepo(object): |
20 | 16 | ||
@@ -22,23 +18,17 @@ class PatchTestRepo(object): | |||
22 | prefix = 'patchtest' | 18 | prefix = 'patchtest' |
23 | 19 | ||
24 | def __init__(self, patch, repodir, commit=None, branch=None): | 20 | def __init__(self, patch, repodir, commit=None, branch=None): |
25 | self._repodir = repodir | 21 | self.repodir = repodir |
26 | self._patch = PatchTestPatch(patch) | 22 | self.repo = git.Repo.init(repodir) |
27 | self._current_branch = self._get_current_branch() | 23 | self.patch = mbox.PatchSeries(patch) |
24 | self.current_branch = self.repo.active_branch.name | ||
28 | 25 | ||
29 | # targeted branch defined on the patch may be invalid, so make sure there | 26 | # targeted branch defined on the patch may be invalid, so make sure there |
30 | # is a corresponding remote branch | 27 | # is a corresponding remote branch |
31 | valid_patch_branch = None | 28 | valid_patch_branch = None |
32 | if self._patch.branch in self.upstream_branches(): | 29 | if self.patch.branch in self.repo.branches: |
33 | valid_patch_branch = self._patch.branch | 30 | valid_patch_branch = self.patch.branch |
34 | 31 | ||
35 | # Target Branch | ||
36 | # Priority (top has highest priority): | ||
37 | # 1. branch given at cmd line | ||
38 | # 2. branch given at the patch | ||
39 | # 3. current branch | ||
40 | self._branch = branch or valid_patch_branch or self._current_branch | ||
41 | |||
42 | # Target Commit | 32 | # Target Commit |
43 | # Priority (top has highest priority): | 33 | # Priority (top has highest priority): |
44 | # 1. commit given at cmd line | 34 | # 1. commit given at cmd line |
@@ -52,123 +42,44 @@ class PatchTestRepo(object): | |||
52 | 42 | ||
53 | self._workingbranch = "%s_%s" % (PatchTestRepo.prefix, os.getpid()) | 43 | self._workingbranch = "%s_%s" % (PatchTestRepo.prefix, os.getpid()) |
54 | 44 | ||
55 | # create working branch | 45 | # create working branch. Use the '-B' flag so that we just |
56 | self._exec({'cmd': ['git', 'checkout', '-b', self._workingbranch, self._commit]}) | 46 | # check out the existing one if it's there |
47 | self.repo.git.execute(['git', 'checkout', '-B', self._workingbranch, self._commit]) | ||
57 | 48 | ||
58 | self._patchmerged = False | 49 | self._patchmerged = False |
59 | 50 | ||
60 | # Check if patch can be merged using git-am | 51 | # Check if patch can be merged using git-am |
61 | self._patchcanbemerged = True | 52 | self._patchcanbemerged = True |
62 | try: | 53 | try: |
63 | self._exec({'cmd': ['git', 'am', '--keep-cr'], 'input': self._patch.contents}) | 54 | # Make sure to get the absolute path of the file |
64 | except utils.CmdException as ce: | 55 | self.repo.git.execute(['git', 'apply', '--check', os.path.abspath(self.patch.path)], with_exceptions=True) |
65 | self._exec({'cmd': ['git', 'am', '--abort']}) | 56 | except git.exc.GitCommandError as ce: |
66 | self._patchcanbemerged = False | 57 | self._patchcanbemerged = False |
67 | finally: | 58 | |
68 | # if patch was applied, remove it | ||
69 | if self._patchcanbemerged: | ||
70 | self._exec({'cmd':['git', 'reset', '--hard', self._commit]}) | ||
71 | |||
72 | # for debugging purposes, print all repo parameters | ||
73 | logger.debug("Parameters") | ||
74 | logger.debug("\tRepository : %s" % self._repodir) | ||
75 | logger.debug("\tTarget Commit : %s" % self._commit) | ||
76 | logger.debug("\tTarget Branch : %s" % self._branch) | ||
77 | logger.debug("\tWorking branch : %s" % self._workingbranch) | ||
78 | logger.debug("\tPatch : %s" % self._patch) | ||
79 | |||
80 | @property | ||
81 | def patch(self): | ||
82 | return self._patch.path | ||
83 | |||
84 | @property | ||
85 | def branch(self): | ||
86 | return self._branch | ||
87 | |||
88 | @property | ||
89 | def commit(self): | ||
90 | return self._commit | ||
91 | |||
92 | @property | ||
93 | def ismerged(self): | 59 | def ismerged(self): |
94 | return self._patchmerged | 60 | return self._patchmerged |
95 | 61 | ||
96 | @property | ||
97 | def canbemerged(self): | 62 | def canbemerged(self): |
98 | return self._patchcanbemerged | 63 | return self._patchcanbemerged |
99 | 64 | ||
100 | def _exec(self, cmds): | ||
101 | _cmds = [] | ||
102 | if isinstance(cmds, dict): | ||
103 | _cmds.append(cmds) | ||
104 | elif isinstance(cmds, list): | ||
105 | _cmds = cmds | ||
106 | else: | ||
107 | raise utils.CmdException({'cmd':str(cmds)}) | ||
108 | |||
109 | results = [] | ||
110 | cmdfailure = False | ||
111 | try: | ||
112 | results = utils.exec_cmds(_cmds, self._repodir) | ||
113 | except utils.CmdException as ce: | ||
114 | cmdfailure = True | ||
115 | raise ce | ||
116 | finally: | ||
117 | if cmdfailure: | ||
118 | for cmd in _cmds: | ||
119 | logger.debug("CMD: %s" % ' '.join(cmd['cmd'])) | ||
120 | else: | ||
121 | for result in results: | ||
122 | cmd, rc, stdout, stderr = ' '.join(result['cmd']), result['returncode'], result['stdout'], result['stderr'] | ||
123 | logger.debug("CMD: %s RCODE: %s STDOUT: %s STDERR: %s" % (cmd, rc, stdout, stderr)) | ||
124 | |||
125 | return results | ||
126 | |||
127 | def _get_current_branch(self, commit='HEAD'): | ||
128 | cmd = {'cmd':['git', 'rev-parse', '--abbrev-ref', commit]} | ||
129 | cb = self._exec(cmd)[0]['stdout'] | ||
130 | if cb == commit: | ||
131 | logger.warning('You may be detached so patchtest will checkout to master after execution') | ||
132 | cb = 'master' | ||
133 | return cb | ||
134 | |||
135 | def _get_commitid(self, commit): | 65 | def _get_commitid(self, commit): |
136 | 66 | ||
137 | if not commit: | 67 | if not commit: |
138 | return None | 68 | return None |
139 | 69 | ||
140 | try: | 70 | try: |
141 | cmd = {'cmd':['git', 'rev-parse', '--short', commit]} | 71 | return self.repo.rev_parse(commit).hexsha |
142 | return self._exec(cmd)[0]['stdout'] | 72 | except Exception as e: |
143 | except utils.CmdException as ce: | 73 | print(f"Couldn't find commit {commit} in repo") |
144 | # try getting the commit under any remotes | ||
145 | cmd = {'cmd':['git', 'remote']} | ||
146 | remotes = self._exec(cmd)[0]['stdout'] | ||
147 | for remote in remotes.splitlines(): | ||
148 | cmd = {'cmd':['git', 'rev-parse', '--short', '%s/%s' % (remote, commit)]} | ||
149 | try: | ||
150 | return self._exec(cmd)[0]['stdout'] | ||
151 | except utils.CmdException: | ||
152 | pass | ||
153 | 74 | ||
154 | return None | 75 | return None |
155 | 76 | ||
156 | def upstream_branches(self): | ||
157 | cmd = {'cmd':['git', 'branch', '--remotes']} | ||
158 | remote_branches = self._exec(cmd)[0]['stdout'] | ||
159 | |||
160 | # just get the names, without the remote name | ||
161 | branches = set(branch.split('/')[-1] for branch in remote_branches.splitlines()) | ||
162 | return branches | ||
163 | |||
164 | def merge(self): | 77 | def merge(self): |
165 | if self._patchcanbemerged: | 78 | if self._patchcanbemerged: |
166 | self._exec({'cmd': ['git', 'am', '--keep-cr'], | 79 | self.repo.git.execute(['git', 'am', '--keep-cr', os.path.abspath(self.patch.path)]) |
167 | 'input': self._patch.contents, | ||
168 | 'updateenv': {'PTRESOURCE':self._patch.path}}) | ||
169 | self._patchmerged = True | 80 | self._patchmerged = True |
170 | 81 | ||
171 | def clean(self): | 82 | def clean(self): |
172 | self._exec({'cmd':['git', 'checkout', '%s' % self._current_branch]}) | 83 | self.repo.git.execute(['git', 'checkout', self.current_branch]) |
173 | self._exec({'cmd':['git', 'branch', '-D', self._workingbranch]}) | 84 | self.repo.git.execute(['git', 'branch', '-D', self._workingbranch]) |
174 | self._patchmerged = False | 85 | self._patchmerged = False |
diff --git a/meta/lib/patchtest/requirements.txt b/meta/lib/patchtest/requirements.txt index ba55ff905e..4247b91f09 100644 --- a/meta/lib/patchtest/requirements.txt +++ b/meta/lib/patchtest/requirements.txt | |||
@@ -1,5 +1,6 @@ | |||
1 | boto3 | 1 | boto3 |
2 | git-pw>=2.5.0 | 2 | git-pw>=2.5.0 |
3 | GitPython | ||
3 | jinja2 | 4 | jinja2 |
4 | pylint | 5 | pylint |
5 | pyparsing>=3.0.9 | 6 | pyparsing>=3.0.9 |
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.fail index 0c40cdc1b6..30c1bc4624 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.fail | |||
@@ -1,32 +1,43 @@ | |||
1 | From 1fbb446d1849b1208012cbdae5d85d228cdbe4a6 Mon Sep 17 00:00:00 2001 | 1 | From 04eb94a0134ef5eb5b5fd783b303104fbfcd8437 Mon Sep 17 00:00:00 2001 |
2 | From: First Last <first.last@example.com> | 2 | From: First Last <first.last@example.com> |
3 | Date: Tue, 29 Aug 2023 13:32:24 -0400 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] selftest-hello: add a summary | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This patch should fail the selftests because the author address is from the | 6 | This should fail the test_author_valid test. |
7 | invalid "example.com". | ||
8 | 7 | ||
9 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
10 | --- | 9 | --- |
11 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 3 ++- | 10 | .../selftest-hello-extra_1.0.bb | 21 +++++++++++++++++++ |
12 | 1 file changed, 2 insertions(+), 1 deletion(-) | 11 | 1 file changed, 21 insertions(+) |
12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb | ||
13 | 13 | ||
14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
15 | index 547587bef4..491f0a3df7 100644 | 15 | new file mode 100644 |
16 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | index 00000000000..f3dec1b220c |
17 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 17 | --- /dev/null |
18 | @@ -1,3 +1,4 @@ | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
19 | +SUMMARY = "A cool sample" | 19 | @@ -0,0 +1,21 @@ |
20 | DESCRIPTION = "Simple helloworld application -- selftest variant" | 20 | +SUMMARY = "This is an example summary" |
21 | SECTION = "examples" | 21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
22 | LICENSE = "MIT" | 22 | +SECTION = "examples" |
23 | @@ -16,4 +17,4 @@ do_install() { | 23 | +LICENSE = "MIT" |
24 | install -m 0755 helloworld ${D}${bindir} | 24 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
25 | } | 25 | + |
26 | 26 | +SRC_URI = "file://helloworld.c" | |
27 | -BBCLASSEXTEND = "native nativesdk" | 27 | + |
28 | \ No newline at end of file | 28 | +S = "${WORKDIR}/sources" |
29 | +UNPACKDIR = "${S}" | ||
30 | + | ||
31 | +do_compile() { | ||
32 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld | ||
33 | +} | ||
34 | + | ||
35 | +do_install() { | ||
36 | + install -d ${D}${bindir} | ||
37 | + install -m 0755 helloworld ${D}${bindir} | ||
38 | +} | ||
39 | + | ||
29 | +BBCLASSEXTEND = "native nativesdk" | 40 | +BBCLASSEXTEND = "native nativesdk" |
30 | -- | 41 | -- |
31 | 2.41.0 | 42 | 2.45.1 |
32 | 43 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.pass index cbb8ef2cef..6e82b08bc6 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.1.pass | |||
@@ -1,31 +1,43 @@ | |||
1 | From 1fbb446d1849b1208012cbdae5d85d228cdbe4a6 Mon Sep 17 00:00:00 2001 | 1 | From 04eb94a0134ef5eb5b5fd783b303104fbfcd8437 Mon Sep 17 00:00:00 2001 |
2 | From: First Last <first.last@address.com> | 2 | From: First Last <first.last@address.com> |
3 | Date: Tue, 29 Aug 2023 13:32:24 -0400 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] selftest-hello: add a summary | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This patch should pass the selftests because the author address is in a valid format. | 6 | This should pass the test_author_valid test. |
7 | 7 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 3 ++- | 10 | .../selftest-hello-extra_1.0.bb | 21 +++++++++++++++++++ |
11 | 1 file changed, 2 insertions(+), 1 deletion(-) | 11 | 1 file changed, 21 insertions(+) |
12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb | ||
12 | 13 | ||
13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
14 | index 547587bef4..491f0a3df7 100644 | 15 | new file mode 100644 |
15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | index 00000000000..f3dec1b220c |
16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 17 | --- /dev/null |
17 | @@ -1,3 +1,4 @@ | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
18 | +SUMMARY = "A cool sample" | 19 | @@ -0,0 +1,21 @@ |
19 | DESCRIPTION = "Simple helloworld application -- selftest variant" | 20 | +SUMMARY = "This is an example summary" |
20 | SECTION = "examples" | 21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
21 | LICENSE = "MIT" | 22 | +SECTION = "examples" |
22 | @@ -16,4 +17,4 @@ do_install() { | 23 | +LICENSE = "MIT" |
23 | install -m 0755 helloworld ${D}${bindir} | 24 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
24 | } | 25 | + |
25 | 26 | +SRC_URI = "file://helloworld.c" | |
26 | -BBCLASSEXTEND = "native nativesdk" | 27 | + |
27 | \ No newline at end of file | 28 | +S = "${WORKDIR}/sources" |
29 | +UNPACKDIR = "${S}" | ||
30 | + | ||
31 | +do_compile() { | ||
32 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld | ||
33 | +} | ||
34 | + | ||
35 | +do_install() { | ||
36 | + install -d ${D}${bindir} | ||
37 | + install -m 0755 helloworld ${D}${bindir} | ||
38 | +} | ||
39 | + | ||
28 | +BBCLASSEXTEND = "native nativesdk" | 40 | +BBCLASSEXTEND = "native nativesdk" |
29 | -- | 41 | -- |
30 | 2.41.0 | 42 | 2.45.1 |
31 | 43 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.fail index 3e2b81bca1..745a8f45d9 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.fail | |||
@@ -1,31 +1,43 @@ | |||
1 | From 1fbb446d1849b1208012cbdae5d85d228cdbe4a6 Mon Sep 17 00:00:00 2001 | 1 | From 04eb94a0134ef5eb5b5fd783b303104fbfcd8437 Mon Sep 17 00:00:00 2001 |
2 | From: Upgrade Helper <auh@auh.yoctoproject.org> | 2 | From: Upgrade Helper <auh@auh.yoctoproject.org> |
3 | Date: Tue, 29 Aug 2023 13:32:24 -0400 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] selftest-hello: add a summary | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This patch should fail the selftests because AUH is an invalid sender. | 6 | This should fail the test_author_valid test. |
7 | 7 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 3 ++- | 10 | .../selftest-hello-extra_1.0.bb | 21 +++++++++++++++++++ |
11 | 1 file changed, 2 insertions(+), 1 deletion(-) | 11 | 1 file changed, 21 insertions(+) |
12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb | ||
12 | 13 | ||
13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
14 | index 547587bef4..491f0a3df7 100644 | 15 | new file mode 100644 |
15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | index 00000000000..f3dec1b220c |
16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 17 | --- /dev/null |
17 | @@ -1,3 +1,4 @@ | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
18 | +SUMMARY = "A cool sample" | 19 | @@ -0,0 +1,21 @@ |
19 | DESCRIPTION = "Simple helloworld application -- selftest variant" | 20 | +SUMMARY = "This is an example summary" |
20 | SECTION = "examples" | 21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
21 | LICENSE = "MIT" | 22 | +SECTION = "examples" |
22 | @@ -16,4 +17,4 @@ do_install() { | 23 | +LICENSE = "MIT" |
23 | install -m 0755 helloworld ${D}${bindir} | 24 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
24 | } | 25 | + |
25 | 26 | +SRC_URI = "file://helloworld.c" | |
26 | -BBCLASSEXTEND = "native nativesdk" | 27 | + |
27 | \ No newline at end of file | 28 | +S = "${WORKDIR}/sources" |
29 | +UNPACKDIR = "${S}" | ||
30 | + | ||
31 | +do_compile() { | ||
32 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld | ||
33 | +} | ||
34 | + | ||
35 | +do_install() { | ||
36 | + install -d ${D}${bindir} | ||
37 | + install -m 0755 helloworld ${D}${bindir} | ||
38 | +} | ||
39 | + | ||
28 | +BBCLASSEXTEND = "native nativesdk" | 40 | +BBCLASSEXTEND = "native nativesdk" |
29 | -- | 41 | -- |
30 | 2.41.0 | 42 | 2.45.1 |
31 | 43 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.pass index f84e1265a7..56cb77fa69 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_author_valid.2.pass | |||
@@ -1,31 +1,43 @@ | |||
1 | From 1fbb446d1849b1208012cbdae5d85d228cdbe4a6 Mon Sep 17 00:00:00 2001 | 1 | From 04eb94a0134ef5eb5b5fd783b303104fbfcd8437 Mon Sep 17 00:00:00 2001 |
2 | From: First Last <averylongemailaddressthatishardtoread.from@address.com> | 2 | From: First Last <averylongemailaddressthatishardtoread.from@address.com> |
3 | Date: Tue, 29 Aug 2023 13:32:24 -0400 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] selftest-hello: add a summary | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This patch should pass the selftests because the author address is in a valid format. | 6 | This should pass the test_author_valid test. |
7 | 7 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 3 ++- | 10 | .../selftest-hello-extra_1.0.bb | 21 +++++++++++++++++++ |
11 | 1 file changed, 2 insertions(+), 1 deletion(-) | 11 | 1 file changed, 21 insertions(+) |
12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb | ||
12 | 13 | ||
13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
14 | index 547587bef4..491f0a3df7 100644 | 15 | new file mode 100644 |
15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | index 00000000000..f3dec1b220c |
16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 17 | --- /dev/null |
17 | @@ -1,3 +1,4 @@ | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
18 | +SUMMARY = "A cool sample" | 19 | @@ -0,0 +1,21 @@ |
19 | DESCRIPTION = "Simple helloworld application -- selftest variant" | 20 | +SUMMARY = "This is an example summary" |
20 | SECTION = "examples" | 21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
21 | LICENSE = "MIT" | 22 | +SECTION = "examples" |
22 | @@ -16,4 +17,4 @@ do_install() { | 23 | +LICENSE = "MIT" |
23 | install -m 0755 helloworld ${D}${bindir} | 24 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
24 | } | 25 | + |
25 | 26 | +SRC_URI = "file://helloworld.c" | |
26 | -BBCLASSEXTEND = "native nativesdk" | 27 | + |
27 | \ No newline at end of file | 28 | +S = "${WORKDIR}/sources" |
29 | +UNPACKDIR = "${S}" | ||
30 | + | ||
31 | +do_compile() { | ||
32 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld | ||
33 | +} | ||
34 | + | ||
35 | +do_install() { | ||
36 | + install -d ${D}${bindir} | ||
37 | + install -m 0755 helloworld ${D}${bindir} | ||
38 | +} | ||
39 | + | ||
28 | +BBCLASSEXTEND = "native nativesdk" | 40 | +BBCLASSEXTEND = "native nativesdk" |
29 | -- | 41 | -- |
30 | 2.41.0 | 42 | 2.45.1 |
31 | 43 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.fail index 80f409e952..6facb8c756 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.fail | |||
@@ -1,25 +1,67 @@ | |||
1 | From fdfd605e565d874502522c4b70b786c8c5aa0bad Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: name@somedomain.com <email@address.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Fri, 17 Feb 2017 16:29:21 -0600 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] README: adds 'foo' to the header | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This test patch adds 'foo' to the header | 6 | This should fail the test_bugzilla_entry_format test. |
7 | 7 | ||
8 | [YOCTO 1234] | 8 | [YOCTO 1234] |
9 | CVE: CVE-1234-56789 | ||
9 | 10 | ||
10 | Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 11 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
11 | --- | 12 | --- |
12 | README | 1 + | 13 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
13 | 1 file changed, 1 insertion(+) | 14 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
15 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
16 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
14 | 17 | ||
15 | diff --git a/README b/README | 18 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | index 521916cd4f..cdf29dcea3 100644 | 19 | new file mode 100644 |
17 | --- a/README | 20 | index 00000000000..8a4f9329303 |
18 | +++ b/README | 21 | --- /dev/null |
19 | @@ -1,3 +1,4 @@ | 22 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | +**** FOO **** | 23 | @@ -0,0 +1,26 @@ |
21 | OpenEmbedded-Core | 24 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | ================= | 25 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
26 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
27 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
28 | + | ||
29 | +CVE: CVE-1234-56789 | ||
30 | +Upstream-Status: Backport(http://example.com/example) | ||
31 | + | ||
32 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
33 | +--- | ||
34 | + strlen.c | 1 + | ||
35 | + 1 file changed, 1 insertion(+) | ||
36 | + | ||
37 | +diff --git a/strlen.c b/strlen.c | ||
38 | +index 1788f38..83d7918 100644 | ||
39 | +--- a/strlen.c | ||
40 | ++++ b/strlen.c | ||
41 | + | ||
42 | +int main() { | ||
43 | + | ||
44 | + printf("%d\n", str_len(string1)); | ||
45 | + printf("%d\n", str_len(string2)); | ||
46 | + printf("CVE FIXED!!!\n"); | ||
47 | + | ||
48 | + return 0; | ||
49 | +} | ||
50 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
51 | index 2dc352d479e..d937759f157 100644 | ||
52 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
53 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
54 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
55 | LICENSE = "MIT" | ||
56 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
57 | |||
58 | -SRC_URI = "file://helloworld.c" | ||
59 | +SRC_URI = "file://helloworld.c \ | ||
60 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
61 | + " | ||
62 | |||
63 | S = "${WORKDIR}/sources" | ||
64 | UNPACKDIR = "${S}" | ||
65 | -- | ||
66 | 2.45.1 | ||
23 | 67 | ||
24 | -- | ||
25 | 2.11.0 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.pass index 2648b03364..2f35458b4f 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_bugzilla_entry_format.pass | |||
@@ -1,25 +1,67 @@ | |||
1 | From fdfd605e565d874502522c4b70b786c8c5aa0bad Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: name@somedomain.com <email@address.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Fri, 17 Feb 2017 16:29:21 -0600 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] README: adds 'foo' to the header | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This test patch adds 'foo' to the header | 6 | This should pass the test_bugzilla_entry_format test. |
7 | 7 | ||
8 | [YOCTO #1234] | 8 | [YOCTO #1234] |
9 | CVE: CVE-1234-56789 | ||
9 | 10 | ||
10 | Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 11 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
11 | --- | 12 | --- |
12 | README | 1 + | 13 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
13 | 1 file changed, 1 insertion(+) | 14 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
15 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
16 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
14 | 17 | ||
15 | diff --git a/README b/README | 18 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | index 521916cd4f..cdf29dcea3 100644 | 19 | new file mode 100644 |
17 | --- a/README | 20 | index 00000000000..8a4f9329303 |
18 | +++ b/README | 21 | --- /dev/null |
19 | @@ -1,3 +1,4 @@ | 22 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | +**** FOO **** | 23 | @@ -0,0 +1,26 @@ |
21 | OpenEmbedded-Core | 24 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | ================= | 25 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
26 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
27 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
28 | + | ||
29 | +CVE: CVE-1234-56789 | ||
30 | +Upstream-Status: Backport(http://example.com/example) | ||
31 | + | ||
32 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
33 | +--- | ||
34 | + strlen.c | 1 + | ||
35 | + 1 file changed, 1 insertion(+) | ||
36 | + | ||
37 | +diff --git a/strlen.c b/strlen.c | ||
38 | +index 1788f38..83d7918 100644 | ||
39 | +--- a/strlen.c | ||
40 | ++++ b/strlen.c | ||
41 | + | ||
42 | +int main() { | ||
43 | + | ||
44 | + printf("%d\n", str_len(string1)); | ||
45 | + printf("%d\n", str_len(string2)); | ||
46 | + printf("CVE FIXED!!!\n"); | ||
47 | + | ||
48 | + return 0; | ||
49 | +} | ||
50 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
51 | index 2dc352d479e..d937759f157 100644 | ||
52 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
53 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
54 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
55 | LICENSE = "MIT" | ||
56 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
57 | |||
58 | -SRC_URI = "file://helloworld.c" | ||
59 | +SRC_URI = "file://helloworld.c \ | ||
60 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
61 | + " | ||
62 | |||
63 | S = "${WORKDIR}/sources" | ||
64 | UNPACKDIR = "${S}" | ||
65 | -- | ||
66 | 2.45.1 | ||
23 | 67 | ||
24 | -- | ||
25 | 2.11.0 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.fail index 93ca0f9119..6f4e61c0da 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.fail | |||
@@ -1,22 +1,62 @@ | |||
1 | From 0a52a62c9430c05d22cb7f46380488f2280b69bb Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Fri, 1 Sep 2023 08:56:14 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] README.OE-Core.md: add foo | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 6 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
7 | --- | 7 | --- |
8 | README.OE-Core.md | 1 + | 8 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
9 | 1 file changed, 1 insertion(+) | 9 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
10 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
11 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
10 | 12 | ||
11 | diff --git a/README.OE-Core.md b/README.OE-Core.md | 13 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
12 | index 2f2127fb03..48464252c8 100644 | 14 | new file mode 100644 |
13 | --- a/README.OE-Core.md | 15 | index 00000000000..8a4f9329303 |
14 | +++ b/README.OE-Core.md | 16 | --- /dev/null |
15 | @@ -1,3 +1,4 @@ | 17 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | +** FOO ** | 18 | @@ -0,0 +1,26 @@ |
17 | OpenEmbedded-Core | 19 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
18 | ================= | 20 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
21 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
22 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
23 | + | ||
24 | +CVE: CVE-1234-56789 | ||
25 | +Upstream-Status: Backport(http://example.com/example) | ||
26 | + | ||
27 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
28 | +--- | ||
29 | + strlen.c | 1 + | ||
30 | + 1 file changed, 1 insertion(+) | ||
31 | + | ||
32 | +diff --git a/strlen.c b/strlen.c | ||
33 | +index 1788f38..83d7918 100644 | ||
34 | +--- a/strlen.c | ||
35 | ++++ b/strlen.c | ||
36 | + | ||
37 | +int main() { | ||
38 | + | ||
39 | + printf("%d\n", str_len(string1)); | ||
40 | + printf("%d\n", str_len(string2)); | ||
41 | + printf("CVE FIXED!!!\n"); | ||
42 | + | ||
43 | + return 0; | ||
44 | +} | ||
45 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
46 | index 2dc352d479e..d937759f157 100644 | ||
47 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
48 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
49 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
50 | LICENSE = "MIT" | ||
51 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
19 | 52 | ||
53 | -SRC_URI = "file://helloworld.c" | ||
54 | +SRC_URI = "file://helloworld.c \ | ||
55 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
56 | + " | ||
57 | |||
58 | S = "${WORKDIR}/sources" | ||
59 | UNPACKDIR = "${S}" | ||
20 | -- | 60 | -- |
21 | 2.41.0 | 61 | 2.45.1 |
22 | 62 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.pass index 5e3dcbd58b..3fbc23fd00 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_presence.pass | |||
@@ -1,24 +1,66 @@ | |||
1 | From 0a52a62c9430c05d22cb7f46380488f2280b69bb Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Fri, 1 Sep 2023 08:56:14 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] README.OE-Core.md: add foo | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This is a commit message | 6 | This should pass the test_commit_message_presence test. |
7 | |||
8 | CVE: CVE-1234-56789 | ||
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | README.OE-Core.md | 1 + | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | 1 file changed, 1 insertion(+) | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
14 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
12 | 16 | ||
13 | diff --git a/README.OE-Core.md b/README.OE-Core.md | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | index 2f2127fb03..48464252c8 100644 | 18 | new file mode 100644 |
15 | --- a/README.OE-Core.md | 19 | index 00000000000..8a4f9329303 |
16 | +++ b/README.OE-Core.md | 20 | --- /dev/null |
17 | @@ -1,3 +1,4 @@ | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
18 | +** FOO ** | 22 | @@ -0,0 +1,26 @@ |
19 | OpenEmbedded-Core | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
20 | ================= | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
26 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
27 | + | ||
28 | +CVE: CVE-1234-56789 | ||
29 | +Upstream-Status: Backport(http://example.com/example) | ||
30 | + | ||
31 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
32 | +--- | ||
33 | + strlen.c | 1 + | ||
34 | + 1 file changed, 1 insertion(+) | ||
35 | + | ||
36 | +diff --git a/strlen.c b/strlen.c | ||
37 | +index 1788f38..83d7918 100644 | ||
38 | +--- a/strlen.c | ||
39 | ++++ b/strlen.c | ||
40 | + | ||
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
50 | index 2dc352d479e..d937759f157 100644 | ||
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
54 | LICENSE = "MIT" | ||
55 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
56 | |||
57 | -SRC_URI = "file://helloworld.c" | ||
58 | +SRC_URI = "file://helloworld.c \ | ||
59 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
60 | + " | ||
21 | 61 | ||
62 | S = "${WORKDIR}/sources" | ||
63 | UNPACKDIR = "${S}" | ||
22 | -- | 64 | -- |
23 | 2.41.0 | 65 | 2.45.1 |
24 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_user_tags.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_user_tags.fail new file mode 100644 index 0000000000..9d54af9644 --- /dev/null +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_user_tags.fail | |||
@@ -0,0 +1,65 @@ | |||
1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | ||
3 | Date: Fri, 31 May 2024 09:54:50 -0400 | ||
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | ||
5 | |||
6 | This should fail the test_commit_message_user_tags test because of this | ||
7 | string: @teststring | ||
8 | |||
9 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
10 | --- | ||
11 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ | ||
12 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- | ||
13 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
14 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
15 | |||
16 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
17 | new file mode 100644 | ||
18 | index 00000000000..8a4f9329303 | ||
19 | --- /dev/null | ||
20 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
21 | @@ -0,0 +1,26 @@ | ||
22 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | ||
23 | +From: Trevor Gamblin <tgamblin@baylibre.com> | ||
24 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
25 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
26 | + | ||
27 | +CVE: CVE-1234-56789 | ||
28 | +Upstream-Status: Backport(http://example.com/example) | ||
29 | + | ||
30 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
31 | +--- | ||
32 | + strlen.c | 1 + | ||
33 | + 1 file changed, 1 insertion(+) | ||
34 | + | ||
35 | +diff --git a/strlen.c b/strlen.c | ||
36 | +index 1788f38..83d7918 100644 | ||
37 | +--- a/strlen.c | ||
38 | ++++ b/strlen.c | ||
39 | + | ||
40 | +int main() { | ||
41 | + | ||
42 | + printf("%d\n", str_len(string1)); | ||
43 | + printf("%d\n", str_len(string2)); | ||
44 | + printf("CVE FIXED!!!\n"); | ||
45 | + | ||
46 | + return 0; | ||
47 | +} | ||
48 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
49 | index 2dc352d479e..d937759f157 100644 | ||
50 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
51 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
52 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
53 | LICENSE = "MIT" | ||
54 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
55 | |||
56 | -SRC_URI = "file://helloworld.c" | ||
57 | +SRC_URI = "file://helloworld.c \ | ||
58 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
59 | + " | ||
60 | |||
61 | S = "${WORKDIR}/sources" | ||
62 | UNPACKDIR = "${S}" | ||
63 | -- | ||
64 | 2.45.1 | ||
65 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_user_tags.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_user_tags.pass new file mode 100644 index 0000000000..57f2fc8a8e --- /dev/null +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_commit_message_user_tags.pass | |||
@@ -0,0 +1,66 @@ | |||
1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | ||
3 | Date: Fri, 31 May 2024 09:54:50 -0400 | ||
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | ||
5 | |||
6 | This should pass the test_commit_message_user_tags test. | ||
7 | |||
8 | CVE: CVE-1234-56789 | ||
9 | |||
10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
11 | --- | ||
12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ | ||
13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- | ||
14 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
16 | |||
17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
18 | new file mode 100644 | ||
19 | index 00000000000..8a4f9329303 | ||
20 | --- /dev/null | ||
21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
22 | @@ -0,0 +1,26 @@ | ||
23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | ||
24 | +From: Trevor Gamblin <tgamblin@baylibre.com> | ||
25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
26 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
27 | + | ||
28 | +CVE: CVE-1234-56789 | ||
29 | +Upstream-Status: Backport(http://example.com/example) | ||
30 | + | ||
31 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
32 | +--- | ||
33 | + strlen.c | 1 + | ||
34 | + 1 file changed, 1 insertion(+) | ||
35 | + | ||
36 | +diff --git a/strlen.c b/strlen.c | ||
37 | +index 1788f38..83d7918 100644 | ||
38 | +--- a/strlen.c | ||
39 | ++++ b/strlen.c | ||
40 | + | ||
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
50 | index 2dc352d479e..d937759f157 100644 | ||
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
54 | LICENSE = "MIT" | ||
55 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
56 | |||
57 | -SRC_URI = "file://helloworld.c" | ||
58 | +SRC_URI = "file://helloworld.c \ | ||
59 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
60 | + " | ||
61 | |||
62 | S = "${WORKDIR}/sources" | ||
63 | UNPACKDIR = "${S}" | ||
64 | -- | ||
65 | 2.45.1 | ||
66 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.1.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.1.fail deleted file mode 100644 index 9cc4aab38a..0000000000 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.1.fail +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | From d12db4cfa913b0e7a4b5bd858d3019acc53ce426 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | ||
3 | Date: Wed, 30 Aug 2023 12:15:00 -0400 | ||
4 | Subject: [PATCH] selftest-hello: upgrade 1.0 -> 1.1 | ||
5 | |||
6 | This test should fail the mbox formatting test and the merge on head | ||
7 | test. | ||
8 | |||
9 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
10 | --- | ||
11 | .../{selftest-hello_1.0.bb => selftest-hello_1.1.bb} | 3 ++- | ||
12 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
13 | rename meta-selftest/recipes-test/selftest-hello/{selftest-hello_1.0.bb => selftest-hello_1.1.bb} (88%) | ||
14 | |||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | ||
16 | similarity index 88% | ||
17 | rename from meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
18 | rename to meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | ||
19 | index 547587bef4..acc388ec2c 100644 | ||
20 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
21 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | ||
22 | @@ -1,3 +1,4 @@ | ||
23 | %+SUMMARY = "Hello!" | ||
24 | DESCRIPTION = "Simple helloworld application -- selftest variant" | ||
25 | SECTION = "examples" | ||
26 | LICENSE = "MIT" | ||
27 | @@ -16,4 +17,4 @@ do_install() { | ||
28 | install -m 0755 helloworld ${D}${bindir} | ||
29 | } | ||
30 | |||
31 | -BBCLASSEXTEND = "native nativesdk" | ||
32 | \ No newline at end of file | ||
33 | +BBCLASSEXTEND = "native nativesdk" | ||
34 | -- | ||
35 | 2.41.0 | ||
36 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.2.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.2.fail deleted file mode 100644 index eca1c60085..0000000000 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.2.fail +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From d12db4cfa913b0e7a4b5bd858d3019acc53ce426 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | ||
3 | Date: Wed, 30 Aug 2023 12:15:00 -0400 | ||
4 | Subject: [PATCH] selftest-hello: upgrade 1.0 -> 1.1 | ||
5 | |||
6 | This test should fail the merge-on-head and mbox formatting tests. | ||
7 | |||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
9 | --- | ||
10 | .../{selftest-hello_1.0.bb => selftest-hello_1.1.bb} | 3 ++- | ||
11 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
12 | rename meta-selftest/recipes-test/selftest-hello/{selftest-hello_1.0.bb => selftest-hello_1.1.bb} (88%) | ||
13 | |||
14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | ||
15 | similarity index 88% | ||
16 | rename from meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
17 | rename to meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | ||
18 | index 547587bef4..acc388ec2c 100644 | ||
19 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
20 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | ||
21 | @@ -1,3 +1,4 @@ | ||
22 | %+SUMMARY = "Hello!" | ||
23 | DESCRIPTION = "Simple helloworld application -- selftest variant" | ||
24 | SECTION = "examples" | ||
25 | LICENSE = "MIT" | ||
26 | @@ -16,4 +17,4 @@ do_install() { | ||
27 | install -m 0755 helloworld ${D}${bindir} | ||
28 | } | ||
29 | |||
30 | -BBCLASSEXTEND = "native nativesdk" | ||
31 | \ No newline at end of file | ||
32 | +BBCLASSEXTEND = "native nativesdk" | ||
33 | -- | ||
34 | 2.41.0 | ||
35 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.fail new file mode 100644 index 0000000000..0dda6802d1 --- /dev/null +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.fail | |||
@@ -0,0 +1,66 @@ | |||
1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | ||
3 | Date: Fri, 31 May 2024 09:54:50 -0400 | ||
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | ||
5 | |||
6 | This should fail the test_mbox_format test. | ||
7 | |||
8 | CVE: CVE-1234-56789 | ||
9 | |||
10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
11 | --- | ||
12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ | ||
13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- | ||
14 | 2 files changed, 29 insertions(+), 1 deletion(-) | ||
15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
16 | |||
17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
18 | new file mode 100644 | ||
19 | index 00000000000..8a4f9329303 | ||
20 | --- /dev/null | ||
21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
22 | @@ -0,0 +1,26 @@ | ||
23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | ||
24 | +From: Trevor Gamblin <tgamblin@baylibre.com> | ||
25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
26 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
27 | + | ||
28 | +CVE: CVE-1234-56789 | ||
29 | +Upstream-Status: Backport(http://example.com/example) | ||
30 | + | ||
31 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
32 | +--- | ||
33 | + strlen.c | 1 + | ||
34 | + 1 file changed, 1 insertion(+) | ||
35 | + | ||
36 | +diff --git a/strlen.c b/strlen.c | ||
37 | +index 1788f38..83d7918 100644 | ||
38 | +--- a/strlen.c | ||
39 | ++++ b/strlen.c | ||
40 | + | ||
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
50 | index 2dc352d479e..d937759f157 100644 | ||
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | ||
54 | LICENSE = "MIT" | ||
55 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
56 | |||
57 | -SRC_URI = "file://helloworld.c" | ||
58 | +SRC_URI = "file://helloworld.c \ | ||
59 | %+ file://0001-Fix-CVE-1234-56789.patch \ | ||
60 | + " | ||
61 | |||
62 | S = "${WORKDIR}/sources" | ||
63 | UNPACKDIR = "${S}" | ||
64 | -- | ||
65 | 2.45.1 | ||
66 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.pass index 33940adffc..f06ae11d04 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_mbox_format.pass | |||
@@ -1,33 +1,66 @@ | |||
1 | From d12db4cfa913b0e7a4b5bd858d3019acc53ce426 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Wed, 30 Aug 2023 12:15:00 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: upgrade 1.0 -> 1.1 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | |||
6 | This should pass the test_mbox_format test. | ||
7 | |||
8 | CVE: CVE-1234-56789 | ||
5 | 9 | ||
6 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
7 | --- | 11 | --- |
8 | .../{selftest-hello_1.0.bb => selftest-hello_1.1.bb} | 3 ++- | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
9 | 1 file changed, 2 insertions(+), 1 deletion(-) | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
10 | rename meta-selftest/recipes-test/selftest-hello/{selftest-hello_1.0.bb => selftest-hello_1.1.bb} (88%) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | ||
11 | 16 | ||
12 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
13 | similarity index 88% | 18 | new file mode 100644 |
14 | rename from meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 19 | index 00000000000..8a4f9329303 |
15 | rename to meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | 20 | --- /dev/null |
16 | index 547587bef4..acc388ec2c 100644 | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
22 | @@ -0,0 +1,26 @@ | ||
23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | ||
24 | +From: Trevor Gamblin <tgamblin@baylibre.com> | ||
25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | ||
26 | +Subject: [PATCH] Fix CVE-NOT-REAL | ||
27 | + | ||
28 | +CVE: CVE-1234-56789 | ||
29 | +Upstream-Status: Backport(http://example.com/example) | ||
30 | + | ||
31 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
32 | +--- | ||
33 | + strlen.c | 1 + | ||
34 | + 1 file changed, 1 insertion(+) | ||
35 | + | ||
36 | +diff --git a/strlen.c b/strlen.c | ||
37 | +index 1788f38..83d7918 100644 | ||
38 | +--- a/strlen.c | ||
39 | ++++ b/strlen.c | ||
40 | + | ||
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | ||
50 | index 2dc352d479e..d937759f157 100644 | ||
17 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.1.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
19 | @@ -1,3 +1,4 @@ | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
20 | +SUMMARY = "Hello!" | ||
21 | DESCRIPTION = "Simple helloworld application -- selftest variant" | ||
22 | SECTION = "examples" | ||
23 | LICENSE = "MIT" | 54 | LICENSE = "MIT" |
24 | @@ -16,4 +17,4 @@ do_install() { | 55 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
25 | install -m 0755 helloworld ${D}${bindir} | 56 | |
26 | } | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | ||
59 | + file://0001-Fix-CVE-1234-56789.patch \ | ||
60 | + " | ||
27 | 61 | ||
28 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
29 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
30 | +BBCLASSEXTEND = "native nativesdk" | ||
31 | -- | 64 | -- |
32 | 2.41.0 | 65 | 2.45.1 |
33 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_series_merge_on_head.1.skip b/meta/lib/patchtest/selftest/files/TestMbox.test_series_merge_on_head.1.skip index 2a72457878..072ccc28c0 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_series_merge_on_head.1.skip +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_series_merge_on_head.1.skip | |||
@@ -3,7 +3,7 @@ From: Trevor Gamblin <tgamblin@baylibre.com> | |||
3 | Date: Wed, 30 Aug 2023 12:15:00 -0400 | 3 | Date: Wed, 30 Aug 2023 12:15:00 -0400 |
4 | Subject: [PATCH] selftest-hello: upgrade 1.0 -> 1.1 | 4 | Subject: [PATCH] selftest-hello: upgrade 1.0 -> 1.1 |
5 | 5 | ||
6 | This file should pass the test_series_merge_on_head test. | 6 | This file should skip the test_series_merge_on_head test. |
7 | 7 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.fail index cdbbc61b61..c5e4df2549 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.fail | |||
@@ -1,23 +1,25 @@ | |||
1 | From 35ccee3cee96fb29514475279248078d88907231 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello% fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello% fix CVE-1234-56789 |
5 | 5 | ||
6 | This should fail the test_shortlog_format test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../files/0001-Fix-CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..9219b8db62 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,19 +37,17 @@ index 0000000000..9219b8db62 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | ||
39 | + | ||
40 | + printf("%d\n", str_len(string1)); | ||
41 | + printf("%d\n", str_len(string2)); | ||
42 | ++ printf("CVE FIXED!!!\n"); | ||
43 | + | ||
44 | + return 0; | ||
45 | + } | ||
46 | +-- | ||
47 | +2.41.0 | ||
48 | + | 40 | + |
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -56,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
56 | 56 | ||
57 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
59 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
60 | + " | 60 | + " |
61 | |||
62 | S = "${WORKDIR}" | ||
63 | |||
64 | @@ -16,4 +18,4 @@ do_install() { | ||
65 | install -m 0755 helloworld ${D}${bindir} | ||
66 | } | ||
67 | 61 | ||
68 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
69 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
70 | +BBCLASSEXTEND = "native nativesdk" | ||
71 | -- | 64 | -- |
72 | 2.41.0 | 65 | 2.45.1 |
73 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.pass index ef6017037c..4948e26afc 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_format.pass | |||
@@ -1,23 +1,25 @@ | |||
1 | From 35ccee3cee96fb29514475279248078d88907231 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should pass the test_shortlog_format test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../files/0001-Fix-CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..9219b8db62 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,19 +37,17 @@ index 0000000000..9219b8db62 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | ||
39 | + | ||
40 | + printf("%d\n", str_len(string1)); | ||
41 | + printf("%d\n", str_len(string2)); | ||
42 | ++ printf("CVE FIXED!!!\n"); | ||
43 | + | ||
44 | + return 0; | ||
45 | + } | ||
46 | +-- | ||
47 | +2.41.0 | ||
48 | + | 40 | + |
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -56,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
56 | 56 | ||
57 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
59 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
60 | + " | 60 | + " |
61 | |||
62 | S = "${WORKDIR}" | ||
63 | |||
64 | @@ -16,4 +18,4 @@ do_install() { | ||
65 | install -m 0755 helloworld ${D}${bindir} | ||
66 | } | ||
67 | 61 | ||
68 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
69 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
70 | +BBCLASSEXTEND = "native nativesdk" | ||
71 | -- | 64 | -- |
72 | 2.41.0 | 65 | 2.45.1 |
73 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.fail index 629e78540b..4ed1242821 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.fail | |||
@@ -1,23 +1,25 @@ | |||
1 | From 35ccee3cee96fb29514475279248078d88907231 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: this is a very long commit shortlog with way too many words included in it to pass the test | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 this is a very long commit shortlog with way too many words included in it to pass the test |
5 | |||
6 | This should fail the test_shortlong_length test. | ||
5 | 7 | ||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../files/0001-Fix-CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..9219b8db62 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,19 +37,17 @@ index 0000000000..9219b8db62 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | ||
39 | + | ||
40 | + printf("%d\n", str_len(string1)); | ||
41 | + printf("%d\n", str_len(string2)); | ||
42 | ++ printf("CVE FIXED!!!\n"); | ||
43 | + | ||
44 | + return 0; | ||
45 | + } | ||
46 | +-- | ||
47 | +2.41.0 | ||
48 | + | 40 | + |
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -57,17 +57,10 @@ index 547587bef4..76975a6729 100644 | |||
57 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
59 | + file://0001-Fix-CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
60 | + " | 60 | + " |
61 | |||
62 | S = "${WORKDIR}" | ||
63 | |||
64 | @@ -16,4 +18,4 @@ do_install() { | ||
65 | install -m 0755 helloworld ${D}${bindir} | ||
66 | } | ||
67 | 61 | ||
68 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
69 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
70 | +BBCLASSEXTEND = "native nativesdk" | ||
71 | -- | 64 | -- |
72 | 2.41.0 | 65 | 2.45.1 |
73 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.pass index ef6017037c..ef5066a650 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_shortlog_length.pass | |||
@@ -1,23 +1,25 @@ | |||
1 | From 35ccee3cee96fb29514475279248078d88907231 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should pass the test_shortlog_length test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../files/0001-Fix-CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..9219b8db62 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,19 +37,17 @@ index 0000000000..9219b8db62 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | ||
39 | + | ||
40 | + printf("%d\n", str_len(string1)); | ||
41 | + printf("%d\n", str_len(string2)); | ||
42 | ++ printf("CVE FIXED!!!\n"); | ||
43 | + | ||
44 | + return 0; | ||
45 | + } | ||
46 | +-- | ||
47 | +2.41.0 | ||
48 | + | 40 | + |
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -56,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
56 | 56 | ||
57 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
59 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
60 | + " | 60 | + " |
61 | |||
62 | S = "${WORKDIR}" | ||
63 | |||
64 | @@ -16,4 +18,4 @@ do_install() { | ||
65 | install -m 0755 helloworld ${D}${bindir} | ||
66 | } | ||
67 | 61 | ||
68 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
69 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
70 | +BBCLASSEXTEND = "native nativesdk" | ||
71 | -- | 64 | -- |
72 | 2.41.0 | 65 | 2.45.1 |
73 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.1.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.1.fail index 35d92aeed7..4ede7271ee 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.1.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.1.fail | |||
@@ -1,22 +1,24 @@ | |||
1 | From 14d72f6973270f78455a8628143f2cff90e8f41e Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should fail the test_signed_off_by_presence test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | --- | 10 | --- |
9 | .../selftest-hello/files/CVE-1234-56789.patch | 27 +++++++++++++++++++ | 11 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
10 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 12 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
11 | 2 files changed, 31 insertions(+), 2 deletions(-) | 13 | 2 files changed, 29 insertions(+), 1 deletion(-) |
12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 14 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
13 | 15 | ||
14 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 16 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
15 | new file mode 100644 | 17 | new file mode 100644 |
16 | index 0000000000..869cfb6fe5 | 18 | index 00000000000..8a4f9329303 |
17 | --- /dev/null | 19 | --- /dev/null |
18 | +++ b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 20 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
19 | @@ -0,0 +1,27 @@ | 21 | @@ -0,0 +1,26 @@ |
20 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 22 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
21 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 23 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
22 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 24 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -34,18 +36,17 @@ index 0000000000..869cfb6fe5 | |||
34 | +index 1788f38..83d7918 100644 | 36 | +index 1788f38..83d7918 100644 |
35 | +--- a/strlen.c | 37 | +--- a/strlen.c |
36 | ++++ b/strlen.c | 38 | ++++ b/strlen.c |
37 | +@@ -8,6 +8,7 @@ int main() { | 39 | + |
38 | + | 40 | +int main() { |
39 | + printf("%d\n", str_len(string1)); | 41 | + |
40 | + printf("%d\n", str_len(string2)); | 42 | + printf("%d\n", str_len(string1)); |
41 | ++ printf("CVE FIXED!!!\n"); | 43 | + printf("%d\n", str_len(string2)); |
42 | + | 44 | + printf("CVE FIXED!!!\n"); |
43 | + return 0; | 45 | + |
44 | + } | 46 | + return 0; |
45 | +-- | 47 | +} |
46 | +2.41.0 | ||
47 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 48 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
48 | index 547587bef4..76975a6729 100644 | 49 | index 2dc352d479e..d937759f157 100644 |
49 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 50 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
51 | @@ -3,7 +3,9 @@ SECTION = "examples" | 52 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -54,18 +55,11 @@ index 547587bef4..76975a6729 100644 | |||
54 | 55 | ||
55 | -SRC_URI = "file://helloworld.c" | 56 | -SRC_URI = "file://helloworld.c" |
56 | +SRC_URI = "file://helloworld.c \ | 57 | +SRC_URI = "file://helloworld.c \ |
57 | + file://CVE-1234-56789.patch \ | 58 | + file://0001-Fix-CVE-1234-56789.patch \ |
58 | + " | 59 | + " |
59 | |||
60 | S = "${WORKDIR}" | ||
61 | |||
62 | @@ -16,4 +18,4 @@ do_install() { | ||
63 | install -m 0755 helloworld ${D}${bindir} | ||
64 | } | ||
65 | 60 | ||
66 | -BBCLASSEXTEND = "native nativesdk" | 61 | S = "${WORKDIR}/sources" |
67 | \ No newline at end of file | 62 | UNPACKDIR = "${S}" |
68 | +BBCLASSEXTEND = "native nativesdk" | ||
69 | -- | 63 | -- |
70 | 2.41.0 | 64 | 2.45.1 |
71 | 65 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.2.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.2.fail index 68f38dee06..f7c3f5145a 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.2.fail +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.2.fail | |||
@@ -1,23 +1,25 @@ | |||
1 | From 14d72f6973270f78455a8628143f2cff90e8f41e Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should fail the test_signed_off_by_presence test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Approved: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Approved-of-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../selftest-hello/files/CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..869cfb6fe5 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,18 +37,17 @@ index 0000000000..869cfb6fe5 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | 40 | + |
39 | + | 41 | +int main() { |
40 | + printf("%d\n", str_len(string1)); | 42 | + |
41 | + printf("%d\n", str_len(string2)); | 43 | + printf("%d\n", str_len(string1)); |
42 | ++ printf("CVE FIXED!!!\n"); | 44 | + printf("%d\n", str_len(string2)); |
43 | + | 45 | + printf("CVE FIXED!!!\n"); |
44 | + return 0; | 46 | + |
45 | + } | 47 | + return 0; |
46 | +-- | 48 | +} |
47 | +2.41.0 | ||
48 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
49 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
50 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
51 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -55,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
55 | 56 | ||
56 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
57 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
58 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
59 | + " | 60 | + " |
60 | |||
61 | S = "${WORKDIR}" | ||
62 | |||
63 | @@ -16,4 +18,4 @@ do_install() { | ||
64 | install -m 0755 helloworld ${D}${bindir} | ||
65 | } | ||
66 | 61 | ||
67 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
68 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
69 | +BBCLASSEXTEND = "native nativesdk" | ||
70 | -- | 64 | -- |
71 | 2.41.0 | 65 | 2.45.1 |
72 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.pass index ea34c76f0d..2661c1416f 100644 --- a/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.pass +++ b/meta/lib/patchtest/selftest/files/TestMbox.test_signed_off_by_presence.pass | |||
@@ -1,23 +1,25 @@ | |||
1 | From 14d72f6973270f78455a8628143f2cff90e8f41e Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should pass the test_signed_off_by_presence test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../selftest-hello/files/CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..869cfb6fe5 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,18 +37,17 @@ index 0000000000..869cfb6fe5 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | 40 | + |
39 | + | 41 | +int main() { |
40 | + printf("%d\n", str_len(string1)); | 42 | + |
41 | + printf("%d\n", str_len(string2)); | 43 | + printf("%d\n", str_len(string1)); |
42 | ++ printf("CVE FIXED!!!\n"); | 44 | + printf("%d\n", str_len(string2)); |
43 | + | 45 | + printf("CVE FIXED!!!\n"); |
44 | + return 0; | 46 | + |
45 | + } | 47 | + return 0; |
46 | +-- | 48 | +} |
47 | +2.41.0 | ||
48 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
49 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
50 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
51 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -55,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
55 | 56 | ||
56 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
57 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
58 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
59 | + " | 60 | + " |
60 | |||
61 | S = "${WORKDIR}" | ||
62 | |||
63 | @@ -16,4 +18,4 @@ do_install() { | ||
64 | install -m 0755 helloworld ${D}${bindir} | ||
65 | } | ||
66 | 61 | ||
67 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
68 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
69 | +BBCLASSEXTEND = "native nativesdk" | ||
70 | -- | 64 | -- |
71 | 2.41.0 | 65 | 2.45.1 |
72 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.fail b/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.fail index 3574463ade..dccafcd9bc 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.fail +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.fail | |||
@@ -1,30 +1,25 @@ | |||
1 | From c4ca86b9cca3643097db0328e2f34dccffbba309 Mon Sep 17 00:00:00 2001 | 1 | From 60450eefbc2c438a37c5e08759d021b18f0df0a3 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Simone=20Wei=C3=9F?= <simone.p.weiss@posteo.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Sat, 10 Feb 2024 13:18:44 +0100 | 3 | Date: Fri, 31 May 2024 09:18:17 -0400 |
4 | Subject: [PATCH] selftest-hello: add CVE_CHECK_IGNORE | 4 | Subject: [PATCH] selftest-hello: add CVE_CHECK_IGNORE |
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | 5 | ||
9 | This should fail the test_cve_tag_format selftest. | 6 | This should fail the test_cve_tag_format selftest. |
10 | 7 | ||
11 | Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
12 | --- | 9 | --- |
13 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 3 ++- | 10 | meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 1 + |
14 | 1 file changed, 2 insertions(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+) |
15 | 12 | ||
16 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
17 | index 547587bef4..3ef9b87c34 100644 | 14 | index 2dc352d479e..cc103de6e2e 100644 |
18 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
20 | @@ -16,4 +16,5 @@ do_install() { | 17 | @@ -17,4 +17,5 @@ do_install() { |
21 | install -m 0755 helloworld ${D}${bindir} | 18 | install -m 0755 helloworld ${D}${bindir} |
22 | } | 19 | } |
23 | 20 | ||
24 | -BBCLASSEXTEND = "native nativesdk" | ||
25 | \ No newline at end of file | ||
26 | +CVE_CHECK_IGNORE = "CVE-2024-12345" | 21 | +CVE_CHECK_IGNORE = "CVE-2024-12345" |
27 | +BBCLASSEXTEND = "native nativesdk" | 22 | BBCLASSEXTEND = "native nativesdk" |
28 | -- | 23 | -- |
29 | 2.39.2 | 24 | 2.45.1 |
30 | 25 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.pass b/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.pass index 10f942a6eb..93a6cc91fb 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.pass +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_cve_check_ignore.pass | |||
@@ -1,31 +1,25 @@ | |||
1 | From 7d4d3fee0c7111830ee9b2b049ae3ce265b26030 Mon Sep 17 00:00:00 2001 | 1 | From f91073242268d2b2c1a1a705e7fd585679f78a59 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Simone=20Wei=C3=9F?= <simone.p.weiss@posteo.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Sat, 10 Feb 2024 13:23:56 +0100 | 3 | Date: Fri, 31 May 2024 09:18:17 -0400 |
4 | Subject: [PATCH] selftest-hello: add CVE_STATUS | 4 | Subject: [PATCH] selftest-hello: add CVE_STATUS |
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | 5 | ||
9 | This should pass the test_cve_tag_format selftest. | 6 | This should pass the test_cve_tag_format selftest. |
10 | 7 | ||
11 | Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
12 | --- | 9 | --- |
13 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 4 +++- | 10 | meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 1 + |
14 | 1 file changed, 3 insertions(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+) |
15 | 12 | ||
16 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
17 | index 547587bef4..9908b3b417 100644 | 14 | index 2dc352d479e..88c5c98608f 100644 |
18 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
20 | @@ -16,4 +16,6 @@ do_install() { | 17 | @@ -17,4 +17,5 @@ do_install() { |
21 | install -m 0755 helloworld ${D}${bindir} | 18 | install -m 0755 helloworld ${D}${bindir} |
22 | } | 19 | } |
23 | 20 | ||
24 | -BBCLASSEXTEND = "native nativesdk" | ||
25 | \ No newline at end of file | ||
26 | +CVE_STATUS[CVE-2024-12345] = "not-applicable-platform: Issue only applies on Windows" | 21 | +CVE_STATUS[CVE-2024-12345] = "not-applicable-platform: Issue only applies on Windows" |
27 | + | 22 | BBCLASSEXTEND = "native nativesdk" |
28 | +BBCLASSEXTEND = "native nativesdk" | ||
29 | -- | 23 | -- |
30 | 2.39.2 | 24 | 2.45.1 |
31 | 25 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.fail b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.fail index ab6c52c374..61b3784e3c 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.fail +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.fail | |||
@@ -1,19 +1,17 @@ | |||
1 | From f89919ea86d38404dd621521680a0162367bb965 Mon Sep 17 00:00:00 2001 | 1 | From 974c3a143bc67faaff9abcc0a06a3d5e692fc660 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Wed, 6 Sep 2023 09:09:27 -0400 | 3 | Date: Fri, 31 May 2024 11:51:15 -0400 |
4 | Subject: [PATCH] selftest-hello: update LIC_FILES_CHKSUM | 4 | Subject: [PATCH] selftest-hello: update LIC_FILES_CHKSUM |
5 | 5 | ||
6 | This test should fail the | 6 | This should fail the test_lic_files_chksum_modified_not_mentioned test. |
7 | test_metadata_lic_files_chksum.LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned | ||
8 | test. | ||
9 | 7 | ||
10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
11 | --- | 9 | --- |
12 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 4 ++-- | 10 | meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 2 +- |
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | 11 | 1 file changed, 1 insertion(+), 1 deletion(-) |
14 | 12 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
16 | index 547587bef4..65dda40aba 100644 | 14 | index 2dc352d479e..356921db1dd 100644 |
17 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
19 | @@ -1,7 +1,7 @@ | 17 | @@ -1,7 +1,7 @@ |
@@ -25,13 +23,6 @@ index 547587bef4..65dda40aba 100644 | |||
25 | 23 | ||
26 | SRC_URI = "file://helloworld.c" | 24 | SRC_URI = "file://helloworld.c" |
27 | 25 | ||
28 | @@ -16,4 +16,4 @@ do_install() { | ||
29 | install -m 0755 helloworld ${D}${bindir} | ||
30 | } | ||
31 | |||
32 | -BBCLASSEXTEND = "native nativesdk" | ||
33 | \ No newline at end of file | ||
34 | +BBCLASSEXTEND = "native nativesdk" | ||
35 | -- | 26 | -- |
36 | 2.41.0 | 27 | 2.45.1 |
37 | 28 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.pass b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.pass index 99d9f144da..b7be1e8e55 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.pass +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_modified_not_mentioned.pass | |||
@@ -1,21 +1,19 @@ | |||
1 | From f89919ea86d38404dd621521680a0162367bb965 Mon Sep 17 00:00:00 2001 | 1 | From 974c3a143bc67faaff9abcc0a06a3d5e692fc660 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Wed, 6 Sep 2023 09:09:27 -0400 | 3 | Date: Fri, 31 May 2024 11:51:15 -0400 |
4 | Subject: [PATCH] selftest-hello: update LIC_FILES_CHKSUM | 4 | Subject: [PATCH] selftest-hello: update LIC_FILES_CHKSUM |
5 | 5 | ||
6 | License-Update: Fix checksum | 6 | This should pass the test_lic_files_chksum_modified_not_mentioned test. |
7 | 7 | ||
8 | This test should pass the | 8 | License-Update: Stuff happened! |
9 | test_metadata_lic_files_chksum.LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned | ||
10 | test. | ||
11 | 9 | ||
12 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
13 | --- | 11 | --- |
14 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 4 ++-- | 12 | meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 2 +- |
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
16 | 14 | ||
17 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 15 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
18 | index 547587bef4..65dda40aba 100644 | 16 | index 2dc352d479e..356921db1dd 100644 |
19 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 17 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
20 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
21 | @@ -1,7 +1,7 @@ | 19 | @@ -1,7 +1,7 @@ |
@@ -27,13 +25,6 @@ index 547587bef4..65dda40aba 100644 | |||
27 | 25 | ||
28 | SRC_URI = "file://helloworld.c" | 26 | SRC_URI = "file://helloworld.c" |
29 | 27 | ||
30 | @@ -16,4 +16,4 @@ do_install() { | ||
31 | install -m 0755 helloworld ${D}${bindir} | ||
32 | } | ||
33 | |||
34 | -BBCLASSEXTEND = "native nativesdk" | ||
35 | \ No newline at end of file | ||
36 | +BBCLASSEXTEND = "native nativesdk" | ||
37 | -- | 28 | -- |
38 | 2.41.0 | 29 | 2.45.1 |
39 | 30 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.fail b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.fail index e14d644bb2..a7a0b0bacb 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.fail +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.fail | |||
@@ -1,53 +1,42 @@ | |||
1 | From 66430e7c6fbd5187b66560909a510e136fed91c0 Mon Sep 17 00:00:00 2001 | 1 | From 74bc209a4fbe4da2f57e153ccfff3d2241dada8d Mon Sep 17 00:00:00 2001 |
2 | From: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Thu, 23 Feb 2017 10:34:27 -0600 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] meta: adding hello-yocto recipe | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This is a sample recipe | 6 | This should fail the test_lic_files_chksum_presence test. |
7 | 7 | ||
8 | Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../hello-world/hello-world/hello_world.c | 5 +++++ | 10 | .../selftest-hello-extra_1.0.bb | 20 +++++++++++++++++++ |
11 | .../hello-world/hello-world_1.0.bb | 18 ++++++++++++++++++ | 11 | 1 file changed, 20 insertions(+) |
12 | 2 files changed, 23 insertions(+) | 12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
13 | create mode 100644 meta/recipes-devtools/hello-world/hello-world/hello_world.c | ||
14 | create mode 100644 meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
15 | 13 | ||
16 | diff --git a/meta/recipes-devtools/hello-world/hello-world/hello_world.c b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
17 | new file mode 100644 | 15 | new file mode 100644 |
18 | index 0000000000..0d59f57d4c | 16 | index 00000000000..875bcbef859 |
19 | --- /dev/null | 17 | --- /dev/null |
20 | +++ b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
21 | @@ -0,0 +1,5 @@ | 19 | @@ -0,0 +1,20 @@ |
22 | +#include <stdio.h> | 20 | +SUMMARY = "This is an example summary" |
23 | + | 21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
24 | +int main(){ | 22 | +SECTION = "examples" |
25 | + printf("Hello World\n"); | ||
26 | +} | ||
27 | diff --git a/meta/recipes-devtools/hello-world/hello-world_1.0.bb b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
28 | new file mode 100644 | ||
29 | index 0000000000..3c990c108a | ||
30 | --- /dev/null | ||
31 | +++ b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
32 | @@ -0,0 +1,18 @@ | ||
33 | +SUMMARY = "This is a sample summary" | ||
34 | +DESCRIPTION = "This is a sample description" | ||
35 | +HOMEPAGE = "https://sample.com/this-is-a-sample" | ||
36 | +LICENSE = "MIT" | 23 | +LICENSE = "MIT" |
37 | + | 24 | + |
38 | +SRC_URI += "file://hello_world.c" | 25 | +SRC_URI = "file://helloworld.c" |
39 | + | 26 | + |
40 | +SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632" | 27 | +S = "${WORKDIR}/sources" |
41 | +SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e" | 28 | +UNPACKDIR = "${S}" |
42 | + | 29 | + |
43 | +do_compile(){ | 30 | +do_compile() { |
44 | + ${CC} -o hello_world ../hello_world.c | 31 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld |
45 | +} | 32 | +} |
46 | + | 33 | + |
47 | +do_install(){ | 34 | +do_install() { |
48 | + install -d ${D}${bindir} | 35 | + install -d ${D}${bindir} |
49 | + install -m +x hello_world ${D}${bindir}/hello_world | 36 | + install -m 0755 helloworld ${D}${bindir} |
50 | +} | 37 | +} |
38 | + | ||
39 | +BBCLASSEXTEND = "native nativesdk" | ||
51 | -- | 40 | -- |
52 | 2.41.0 | 41 | 2.45.1 |
53 | 42 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.pass b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.pass index b8da16dfe5..8ffa97ec56 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.pass +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_lic_files_chksum_presence.pass | |||
@@ -1,54 +1,43 @@ | |||
1 | From 5144d2ba1aa763312c047dd5f8901368cff79da6 Mon Sep 17 00:00:00 2001 | 1 | From 04eb94a0134ef5eb5b5fd783b303104fbfcd8437 Mon Sep 17 00:00:00 2001 |
2 | From: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Thu, 23 Feb 2017 10:34:27 -0600 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] meta: adding hello-yocto recipe | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This is a sample recipe | 6 | This should pass the test_lic_files_chksum_presence test. |
7 | 7 | ||
8 | Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../hello-world/hello-world/hello_world.c | 5 +++++ | 10 | .../selftest-hello-extra_1.0.bb | 21 +++++++++++++++++++ |
11 | .../hello-world/hello-world_1.0.bb | 19 +++++++++++++++++++ | 11 | 1 file changed, 21 insertions(+) |
12 | 2 files changed, 24 insertions(+) | 12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
13 | create mode 100644 meta/recipes-devtools/hello-world/hello-world/hello_world.c | ||
14 | create mode 100644 meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
15 | 13 | ||
16 | diff --git a/meta/recipes-devtools/hello-world/hello-world/hello_world.c b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
17 | new file mode 100644 | 15 | new file mode 100644 |
18 | index 0000000000..0d59f57d4c | 16 | index 00000000000..f3dec1b220c |
19 | --- /dev/null | 17 | --- /dev/null |
20 | +++ b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
21 | @@ -0,0 +1,5 @@ | 19 | @@ -0,0 +1,21 @@ |
22 | +#include <stdio.h> | 20 | +SUMMARY = "This is an example summary" |
23 | + | 21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
24 | +int main(){ | 22 | +SECTION = "examples" |
25 | + printf("Hello World\n"); | ||
26 | +} | ||
27 | diff --git a/meta/recipes-devtools/hello-world/hello-world_1.0.bb b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
28 | new file mode 100644 | ||
29 | index 0000000000..44d888c82a | ||
30 | --- /dev/null | ||
31 | +++ b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
32 | @@ -0,0 +1,19 @@ | ||
33 | +SUMMARY = "This is a sample summary" | ||
34 | +DESCRIPTION = "This is a sample description" | ||
35 | +HOMEPAGE = "https://sample.com/this-is-a-sample" | ||
36 | +LICENSE = "MIT" | 23 | +LICENSE = "MIT" |
37 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | 24 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
38 | + | 25 | + |
39 | +SRC_URI += "file://hello_world.c" | 26 | +SRC_URI = "file://helloworld.c" |
40 | + | 27 | + |
41 | +SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632" | 28 | +S = "${WORKDIR}/sources" |
42 | +SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e" | 29 | +UNPACKDIR = "${S}" |
43 | + | 30 | + |
44 | +do_compile(){ | 31 | +do_compile() { |
45 | + ${CC} -o hello_world ../hello_world.c | 32 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld |
46 | +} | 33 | +} |
47 | + | 34 | + |
48 | +do_install(){ | 35 | +do_install() { |
49 | + install -d ${D}${bindir} | 36 | + install -d ${D}${bindir} |
50 | + install -m +x hello_world ${D}${bindir}/hello_world | 37 | + install -m 0755 helloworld ${D}${bindir} |
51 | +} | 38 | +} |
39 | + | ||
40 | +BBCLASSEXTEND = "native nativesdk" | ||
52 | -- | 41 | -- |
53 | 2.41.0 | 42 | 2.45.1 |
54 | 43 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.fail b/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.fail index 983b6e0c2b..0a402d0a3e 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.fail +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.fail | |||
@@ -1,17 +1,17 @@ | |||
1 | From 4ab06b5f81455249cd5e89d2cce9863803b5ecb5 Mon Sep 17 00:00:00 2001 | 1 | From f2f7b6bcb831289bc3ba2343ad7dc5bee6d6e0cd Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Fri, 8 Sep 2023 14:41:00 -0400 | 3 | Date: Fri, 31 May 2024 08:45:41 -0400 |
4 | Subject: [PATCH] selftest-hello: remove helloworld.c | 4 | Subject: [PATCH] selftest-hello: remove helloworld.c |
5 | 5 | ||
6 | This should fail the test_src_uri_left_files selftest. | 6 | This should fail the test_src_uri_left_files selftest. |
7 | 7 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 4 +--- | 10 | meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 2 -- |
11 | 1 file changed, 1 insertion(+), 3 deletions(-) | 11 | 1 file changed, 2 deletions(-) |
12 | 12 | ||
13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 13 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
14 | index 547587bef4..f6817f05bc 100644 | 14 | index 2dc352d479e..e95270adaeb 100644 |
15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 15 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 16 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
17 | @@ -3,8 +3,6 @@ SECTION = "examples" | 17 | @@ -3,8 +3,6 @@ SECTION = "examples" |
@@ -20,16 +20,9 @@ index 547587bef4..f6817f05bc 100644 | |||
20 | 20 | ||
21 | -SRC_URI = "file://helloworld.c" | 21 | -SRC_URI = "file://helloworld.c" |
22 | - | 22 | - |
23 | S = "${WORKDIR}" | 23 | S = "${WORKDIR}/sources" |
24 | UNPACKDIR = "${S}" | ||
24 | 25 | ||
25 | do_compile() { | ||
26 | @@ -16,4 +14,4 @@ do_install() { | ||
27 | install -m 0755 helloworld ${D}${bindir} | ||
28 | } | ||
29 | |||
30 | -BBCLASSEXTEND = "native nativesdk" | ||
31 | \ No newline at end of file | ||
32 | +BBCLASSEXTEND = "native nativesdk" | ||
33 | -- | 26 | -- |
34 | 2.41.0 | 27 | 2.45.1 |
35 | 28 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.pass b/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.pass index 1f1a77e581..a675c028d0 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.pass +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_src_uri_left_files.pass | |||
@@ -1,6 +1,6 @@ | |||
1 | From 6c7ac367a873bf827c19b81085c943eace917a99 Mon Sep 17 00:00:00 2001 | 1 | From e79933e2fc68570066eca66f0b599d259b7a1731 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Fri, 8 Sep 2023 14:41:00 -0400 | 3 | Date: Fri, 31 May 2024 08:18:48 -0400 |
4 | Subject: [PATCH] selftest-hello: remove helloworld.c | 4 | Subject: [PATCH] selftest-hello: remove helloworld.c |
5 | 5 | ||
6 | This should pass the test_src_uri_left_files selftest. | 6 | This should pass the test_src_uri_left_files selftest. |
@@ -8,13 +8,13 @@ This should pass the test_src_uri_left_files selftest. | |||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../recipes-test/selftest-hello/files/helloworld.c | 8 -------- | 10 | .../recipes-test/selftest-hello/files/helloworld.c | 8 -------- |
11 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 4 +--- | 11 | .../recipes-test/selftest-hello/selftest-hello_1.0.bb | 2 -- |
12 | 2 files changed, 1 insertion(+), 11 deletions(-) | 12 | 2 files changed, 10 deletions(-) |
13 | delete mode 100644 meta-selftest/recipes-test/selftest-hello/files/helloworld.c | 13 | delete mode 100644 meta-selftest/recipes-test/selftest-hello/files/helloworld.c |
14 | 14 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/helloworld.c b/meta-selftest/recipes-test/selftest-hello/files/helloworld.c | 15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/helloworld.c b/meta-selftest/recipes-test/selftest-hello/files/helloworld.c |
16 | deleted file mode 100644 | 16 | deleted file mode 100644 |
17 | index fc7169b7b8..0000000000 | 17 | index fc7169b7b83..00000000000 |
18 | --- a/meta-selftest/recipes-test/selftest-hello/files/helloworld.c | 18 | --- a/meta-selftest/recipes-test/selftest-hello/files/helloworld.c |
19 | +++ /dev/null | 19 | +++ /dev/null |
20 | @@ -1,8 +0,0 @@ | 20 | @@ -1,8 +0,0 @@ |
@@ -27,7 +27,7 @@ index fc7169b7b8..0000000000 | |||
27 | - return 0; | 27 | - return 0; |
28 | -} | 28 | -} |
29 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 29 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
30 | index 547587bef4..f6817f05bc 100644 | 30 | index 2dc352d479e..e95270adaeb 100644 |
31 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 31 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
32 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 32 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
33 | @@ -3,8 +3,6 @@ SECTION = "examples" | 33 | @@ -3,8 +3,6 @@ SECTION = "examples" |
@@ -36,16 +36,9 @@ index 547587bef4..f6817f05bc 100644 | |||
36 | 36 | ||
37 | -SRC_URI = "file://helloworld.c" | 37 | -SRC_URI = "file://helloworld.c" |
38 | - | 38 | - |
39 | S = "${WORKDIR}" | 39 | S = "${WORKDIR}/sources" |
40 | UNPACKDIR = "${S}" | ||
40 | 41 | ||
41 | do_compile() { | ||
42 | @@ -16,4 +14,4 @@ do_install() { | ||
43 | install -m 0755 helloworld ${D}${bindir} | ||
44 | } | ||
45 | |||
46 | -BBCLASSEXTEND = "native nativesdk" | ||
47 | \ No newline at end of file | ||
48 | +BBCLASSEXTEND = "native nativesdk" | ||
49 | -- | 42 | -- |
50 | 2.41.0 | 43 | 2.45.1 |
51 | 44 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.fail b/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.fail index 2d2b4e683d..1087843619 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.fail +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.fail | |||
@@ -1,46 +1,42 @@ | |||
1 | From e29da5faa74409be394caa09d9f3b7b60f8592b9 Mon Sep 17 00:00:00 2001 | 1 | From f4b72cc24f5e2a290a8637775c4d41c16d5d83aa Mon Sep 17 00:00:00 2001 |
2 | From: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Thu, 23 Feb 2017 10:34:27 -0600 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] meta: adding hello-yocto recipe | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This is a sample recipe | 6 | This should fail the test_summary_presence test. |
7 | 7 | ||
8 | Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | meta/recipes-devtools/hello-world/hello-world/hello_world.c | 5 +++++ | 10 | .../selftest-hello-extra_1.0.bb | 20 +++++++++++++++++++ |
11 | meta/recipes-devtools/hello-world/hello-world_1.0.bb | 12 ++++++++++++ | 11 | 1 file changed, 20 insertions(+) |
12 | 2 files changed, 17 insertions(+) | 12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
13 | create mode 100644 meta/recipes-devtools/hello-world/hello-world/hello_world.c | ||
14 | create mode 100644 meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
15 | 13 | ||
16 | diff --git a/meta/recipes-devtools/hello-world/hello-world/hello_world.c b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
17 | new file mode 100644 | 15 | new file mode 100644 |
18 | index 0000000000..0d59f57d4c | 16 | index 00000000000..2dc352d479e |
19 | --- /dev/null | 17 | --- /dev/null |
20 | +++ b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
21 | @@ -0,0 +1,5 @@ | 19 | @@ -0,0 +1,20 @@ |
22 | +#include <stdio.h> | 20 | +DESCRIPTION = "Simple helloworld application -- selftest variant" |
21 | +SECTION = "examples" | ||
22 | +LICENSE = "MIT" | ||
23 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
23 | + | 24 | + |
24 | +int main(){ | 25 | +SRC_URI = "file://helloworld.c" |
25 | + printf("Hello World\n"); | ||
26 | +} | ||
27 | diff --git a/meta/recipes-devtools/hello-world/hello-world_1.0.bb b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
28 | new file mode 100644 | ||
29 | index 0000000000..c4e1359217 | ||
30 | --- /dev/null | ||
31 | +++ b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
32 | @@ -0,0 +1,12 @@ | ||
33 | +LICENSE = "CLOSED" | ||
34 | + | 26 | + |
35 | +SRC_URI += "file://hello_world.c" | 27 | +S = "${WORKDIR}/sources" |
28 | +UNPACKDIR = "${S}" | ||
36 | + | 29 | + |
37 | +do_compile(){ | 30 | +do_compile() { |
38 | + ${CC} -o hello_world ../hello_world.c | 31 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld |
39 | +} | 32 | +} |
40 | + | 33 | + |
41 | +do_install(){ | 34 | +do_install() { |
42 | + install -d ${D}${bindir} | 35 | + install -d ${D}${bindir} |
43 | + install -m +x hello_world ${D}${bindir}/hello_world | 36 | + install -m 0755 helloworld ${D}${bindir} |
44 | +} | 37 | +} |
45 | -- | 38 | + |
46 | 2.11.0 | 39 | +BBCLASSEXTEND = "native nativesdk" |
40 | -- | ||
41 | 2.45.1 | ||
42 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.pass b/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.pass index 55f0309b3f..3d35a8d8fb 100644 --- a/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.pass +++ b/meta/lib/patchtest/selftest/files/TestMetadata.test_summary_presence.pass | |||
@@ -1,49 +1,43 @@ | |||
1 | From 0cd2fed12ce4b7b071edde12aec4481ad7a6f107 Mon Sep 17 00:00:00 2001 | 1 | From 04eb94a0134ef5eb5b5fd783b303104fbfcd8437 Mon Sep 17 00:00:00 2001 |
2 | From: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Thu, 23 Feb 2017 10:34:27 -0600 | 3 | Date: Fri, 31 May 2024 11:03:47 -0400 |
4 | Subject: [PATCH] meta: adding hello-yocto recipe | 4 | Subject: [PATCH] selftest-hello: add selftest-hello-extra |
5 | 5 | ||
6 | This is a sample recipe | 6 | This should pass the test_summary_presence test. |
7 | 7 | ||
8 | Signed-off-by: Daniela Plascencia <daniela.plascencia@linux.intel.com> | 8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 9 | --- |
10 | .../hello-world/hello-world/hello_world.c | 5 +++++ | 10 | .../selftest-hello-extra_1.0.bb | 21 +++++++++++++++++++ |
11 | meta/recipes-devtools/hello-world/hello-world_1.0.bb | 15 +++++++++++++++ | 11 | 1 file changed, 21 insertions(+) |
12 | 2 files changed, 20 insertions(+) | 12 | create mode 100644 meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
13 | create mode 100644 meta/recipes-devtools/hello-world/hello-world/hello_world.c | ||
14 | create mode 100644 meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
15 | 13 | ||
16 | diff --git a/meta/recipes-devtools/hello-world/hello-world/hello_world.c b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 14 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
17 | new file mode 100644 | 15 | new file mode 100644 |
18 | index 0000000000..0d59f57d4c | 16 | index 00000000000..f3dec1b220c |
19 | --- /dev/null | 17 | --- /dev/null |
20 | +++ b/meta/recipes-devtools/hello-world/hello-world/hello_world.c | 18 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello-extra_1.0.bb |
21 | @@ -0,0 +1,5 @@ | 19 | @@ -0,0 +1,21 @@ |
22 | +#include <stdio.h> | 20 | +SUMMARY = "This is an example summary" |
21 | +DESCRIPTION = "Simple helloworld application -- selftest variant" | ||
22 | +SECTION = "examples" | ||
23 | +LICENSE = "MIT" | ||
24 | +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
23 | + | 25 | + |
24 | +int main(){ | 26 | +SRC_URI = "file://helloworld.c" |
25 | + printf("Hello World\n"); | ||
26 | +} | ||
27 | diff --git a/meta/recipes-devtools/hello-world/hello-world_1.0.bb b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
28 | new file mode 100644 | ||
29 | index 0000000000..c54283eece | ||
30 | --- /dev/null | ||
31 | +++ b/meta/recipes-devtools/hello-world/hello-world_1.0.bb | ||
32 | @@ -0,0 +1,15 @@ | ||
33 | +SUMMARY = "This is a sample summary" | ||
34 | +DESCRIPTION = "This is a sample description" | ||
35 | +HOMEPAGE = "https://sample.com/this-is-a-sample" | ||
36 | +LICENSE = "CLOSED" | ||
37 | + | 27 | + |
38 | +SRC_URI += "file://hello_world.c" | 28 | +S = "${WORKDIR}/sources" |
29 | +UNPACKDIR = "${S}" | ||
39 | + | 30 | + |
40 | +do_compile(){ | 31 | +do_compile() { |
41 | + ${CC} -o hello_world ../hello_world.c | 32 | + ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld |
42 | +} | 33 | +} |
43 | + | 34 | + |
44 | +do_install(){ | 35 | +do_install() { |
45 | + install -d ${D}${bindir} | 36 | + install -d ${D}${bindir} |
46 | + install -m +x hello_world ${D}${bindir}/hello_world | 37 | + install -m 0755 helloworld ${D}${bindir} |
47 | +} | 38 | +} |
48 | -- | 39 | + |
49 | 2.11.0 | 40 | +BBCLASSEXTEND = "native nativesdk" |
41 | -- | ||
42 | 2.45.1 | ||
43 | |||
diff --git a/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.fail b/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.fail index c763a7506e..f64f2a40b0 100644 --- a/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.fail +++ b/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.fail | |||
@@ -1,29 +1,31 @@ | |||
1 | From 35ccee3cee96fb29514475279248078d88907231 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | CVE: CVE-BAD-FORMAT | 6 | This should fail the test_cve_tag_format test. |
7 | |||
8 | CVE: CVE-1234-56789 | ||
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../files/0001-Fix-CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..9219b8db62 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
24 | +Subject: [PATCH] Fix CVE-NOT-REAL | 26 | +Subject: [PATCH] Fix CVE-NOT-REAL |
25 | + | 27 | + |
26 | +CVE: CVE-BAD-FORMAT | 28 | +CVE: CVE-BAD_FORMAT |
27 | +Upstream-Status: Backport(http://example.com/example) | 29 | +Upstream-Status: Backport(http://example.com/example) |
28 | + | 30 | + |
29 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 31 | +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
@@ -35,19 +37,17 @@ index 0000000000..9219b8db62 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | ||
39 | + | ||
40 | + printf("%d\n", str_len(string1)); | ||
41 | + printf("%d\n", str_len(string2)); | ||
42 | ++ printf("CVE FIXED!!!\n"); | ||
43 | + | ||
44 | + return 0; | ||
45 | + } | ||
46 | +-- | ||
47 | +2.41.0 | ||
48 | + | 40 | + |
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -56,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
56 | 56 | ||
57 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
59 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
60 | + " | 60 | + " |
61 | |||
62 | S = "${WORKDIR}" | ||
63 | |||
64 | @@ -16,4 +18,4 @@ do_install() { | ||
65 | install -m 0755 helloworld ${D}${bindir} | ||
66 | } | ||
67 | 61 | ||
68 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
69 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
70 | +BBCLASSEXTEND = "native nativesdk" | ||
71 | -- | 64 | -- |
72 | 2.41.0 | 65 | 2.45.1 |
73 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.pass b/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.pass index ef6017037c..3819487041 100644 --- a/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.pass +++ b/meta/lib/patchtest/selftest/files/TestPatch.test_cve_tag_format.pass | |||
@@ -1,23 +1,25 @@ | |||
1 | From 35ccee3cee96fb29514475279248078d88907231 Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should pass the test_cve_tag format test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../files/0001-Fix-CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..9219b8db62 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,19 +37,17 @@ index 0000000000..9219b8db62 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | ||
39 | + | ||
40 | + printf("%d\n", str_len(string1)); | ||
41 | + printf("%d\n", str_len(string2)); | ||
42 | ++ printf("CVE FIXED!!!\n"); | ||
43 | + | ||
44 | + return 0; | ||
45 | + } | ||
46 | +-- | ||
47 | +2.41.0 | ||
48 | + | 40 | + |
41 | +int main() { | ||
42 | + | ||
43 | + printf("%d\n", str_len(string1)); | ||
44 | + printf("%d\n", str_len(string2)); | ||
45 | + printf("CVE FIXED!!!\n"); | ||
46 | + | ||
47 | + return 0; | ||
48 | +} | ||
49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
53 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -56,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
56 | 56 | ||
57 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
58 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
59 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
60 | + " | 60 | + " |
61 | |||
62 | S = "${WORKDIR}" | ||
63 | |||
64 | @@ -16,4 +18,4 @@ do_install() { | ||
65 | install -m 0755 helloworld ${D}${bindir} | ||
66 | } | ||
67 | 61 | ||
68 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
69 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
70 | +BBCLASSEXTEND = "native nativesdk" | ||
71 | -- | 64 | -- |
72 | 2.41.0 | 65 | 2.45.1 |
73 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.fail b/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.fail index ce8bf7b7d1..b2d0fab9e3 100644 --- a/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.fail +++ b/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.fail | |||
@@ -1,23 +1,25 @@ | |||
1 | From 5a2d0ac780a0f4c046fb1a3c3463d3e726f191cb Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should fail the test_signed_off_by_presence test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../selftest-hello/files/CVE-1234-56789.patch | 26 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 25 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 30 insertions(+), 2 deletions(-) | 14 | 2 files changed, 28 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..92a5b65a53 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,26 @@ | 22 | @@ -0,0 +1,25 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -34,18 +36,17 @@ index 0000000000..92a5b65a53 | |||
34 | +index 1788f38..83d7918 100644 | 36 | +index 1788f38..83d7918 100644 |
35 | +--- a/strlen.c | 37 | +--- a/strlen.c |
36 | ++++ b/strlen.c | 38 | ++++ b/strlen.c |
37 | +@@ -8,6 +8,7 @@ int main() { | 39 | + |
38 | + | 40 | +int main() { |
39 | + printf("%d\n", str_len(string1)); | 41 | + |
40 | + printf("%d\n", str_len(string2)); | 42 | + printf("%d\n", str_len(string1)); |
41 | ++ printf("CVE FIXED!!!\n"); | 43 | + printf("%d\n", str_len(string2)); |
42 | + | 44 | + printf("CVE FIXED!!!\n"); |
43 | + return 0; | 45 | + |
44 | + } | 46 | + return 0; |
45 | +-- | 47 | +} |
46 | +2.41.0 | ||
47 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 48 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
48 | index 547587bef4..76975a6729 100644 | 49 | index 2dc352d479e..d937759f157 100644 |
49 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 50 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
50 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
51 | @@ -3,7 +3,9 @@ SECTION = "examples" | 52 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -54,18 +55,11 @@ index 547587bef4..76975a6729 100644 | |||
54 | 55 | ||
55 | -SRC_URI = "file://helloworld.c" | 56 | -SRC_URI = "file://helloworld.c" |
56 | +SRC_URI = "file://helloworld.c \ | 57 | +SRC_URI = "file://helloworld.c \ |
57 | + file://CVE-1234-56789.patch \ | 58 | + file://0001-Fix-CVE-1234-56789.patch \ |
58 | + " | 59 | + " |
59 | |||
60 | S = "${WORKDIR}" | ||
61 | |||
62 | @@ -16,4 +18,4 @@ do_install() { | ||
63 | install -m 0755 helloworld ${D}${bindir} | ||
64 | } | ||
65 | 60 | ||
66 | -BBCLASSEXTEND = "native nativesdk" | 61 | S = "${WORKDIR}/sources" |
67 | \ No newline at end of file | 62 | UNPACKDIR = "${S}" |
68 | +BBCLASSEXTEND = "native nativesdk" | ||
69 | -- | 63 | -- |
70 | 2.41.0 | 64 | 2.45.1 |
71 | 65 | ||
diff --git a/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.pass b/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.pass index ea34c76f0d..2661c1416f 100644 --- a/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.pass +++ b/meta/lib/patchtest/selftest/files/TestPatch.test_signed_off_by_presence.pass | |||
@@ -1,23 +1,25 @@ | |||
1 | From 14d72f6973270f78455a8628143f2cff90e8f41e Mon Sep 17 00:00:00 2001 | 1 | From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 |
2 | From: Trevor Gamblin <tgamblin@baylibre.com> | 2 | From: Trevor Gamblin <tgamblin@baylibre.com> |
3 | Date: Tue, 29 Aug 2023 14:12:27 -0400 | 3 | Date: Fri, 31 May 2024 09:54:50 -0400 |
4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 | 4 | Subject: [PATCH] selftest-hello: fix CVE-1234-56789 |
5 | 5 | ||
6 | This should pass the test_signed_off_by_presence test. | ||
7 | |||
6 | CVE: CVE-1234-56789 | 8 | CVE: CVE-1234-56789 |
7 | 9 | ||
8 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | 10 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> |
9 | --- | 11 | --- |
10 | .../selftest-hello/files/CVE-1234-56789.patch | 27 +++++++++++++++++++ | 12 | .../files/0001-Fix-CVE-1234-56789.patch | 26 +++++++++++++++++++ |
11 | .../selftest-hello/selftest-hello_1.0.bb | 6 +++-- | 13 | .../selftest-hello/selftest-hello_1.0.bb | 4 ++- |
12 | 2 files changed, 31 insertions(+), 2 deletions(-) | 14 | 2 files changed, 29 insertions(+), 1 deletion(-) |
13 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 15 | create mode 100644 meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
14 | 16 | ||
15 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 17 | diff --git a/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
16 | new file mode 100644 | 18 | new file mode 100644 |
17 | index 0000000000..869cfb6fe5 | 19 | index 00000000000..8a4f9329303 |
18 | --- /dev/null | 20 | --- /dev/null |
19 | +++ b/meta-selftest/recipes-test/selftest-hello/files/CVE-1234-56789.patch | 21 | +++ b/meta-selftest/recipes-test/selftest-hello/files/0001-Fix-CVE-1234-56789.patch |
20 | @@ -0,0 +1,27 @@ | 22 | @@ -0,0 +1,26 @@ |
21 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 | 23 | +From b26a31186e6ee2eb1f506d5f2f9394d327a0df2f Mon Sep 17 00:00:00 2001 |
22 | +From: Trevor Gamblin <tgamblin@baylibre.com> | 24 | +From: Trevor Gamblin <tgamblin@baylibre.com> |
23 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 | 25 | +Date: Tue, 29 Aug 2023 14:08:20 -0400 |
@@ -35,18 +37,17 @@ index 0000000000..869cfb6fe5 | |||
35 | +index 1788f38..83d7918 100644 | 37 | +index 1788f38..83d7918 100644 |
36 | +--- a/strlen.c | 38 | +--- a/strlen.c |
37 | ++++ b/strlen.c | 39 | ++++ b/strlen.c |
38 | +@@ -8,6 +8,7 @@ int main() { | 40 | + |
39 | + | 41 | +int main() { |
40 | + printf("%d\n", str_len(string1)); | 42 | + |
41 | + printf("%d\n", str_len(string2)); | 43 | + printf("%d\n", str_len(string1)); |
42 | ++ printf("CVE FIXED!!!\n"); | 44 | + printf("%d\n", str_len(string2)); |
43 | + | 45 | + printf("CVE FIXED!!!\n"); |
44 | + return 0; | 46 | + |
45 | + } | 47 | + return 0; |
46 | +-- | 48 | +} |
47 | +2.41.0 | ||
48 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 49 | diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
49 | index 547587bef4..76975a6729 100644 | 50 | index 2dc352d479e..d937759f157 100644 |
50 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 51 | --- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
51 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 52 | +++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb |
52 | @@ -3,7 +3,9 @@ SECTION = "examples" | 53 | @@ -3,7 +3,9 @@ SECTION = "examples" |
@@ -55,18 +56,11 @@ index 547587bef4..76975a6729 100644 | |||
55 | 56 | ||
56 | -SRC_URI = "file://helloworld.c" | 57 | -SRC_URI = "file://helloworld.c" |
57 | +SRC_URI = "file://helloworld.c \ | 58 | +SRC_URI = "file://helloworld.c \ |
58 | + file://CVE-1234-56789.patch \ | 59 | + file://0001-Fix-CVE-1234-56789.patch \ |
59 | + " | 60 | + " |
60 | |||
61 | S = "${WORKDIR}" | ||
62 | |||
63 | @@ -16,4 +18,4 @@ do_install() { | ||
64 | install -m 0755 helloworld ${D}${bindir} | ||
65 | } | ||
66 | 61 | ||
67 | -BBCLASSEXTEND = "native nativesdk" | 62 | S = "${WORKDIR}/sources" |
68 | \ No newline at end of file | 63 | UNPACKDIR = "${S}" |
69 | +BBCLASSEXTEND = "native nativesdk" | ||
70 | -- | 64 | -- |
71 | 2.41.0 | 65 | 2.45.1 |
72 | 66 | ||
diff --git a/meta/lib/patchtest/selftest/selftest b/meta/lib/patchtest/selftest/selftest index 6fad50ce61..3cf1c361f7 100755 --- a/meta/lib/patchtest/selftest/selftest +++ b/meta/lib/patchtest/selftest/selftest | |||
@@ -38,7 +38,7 @@ def test(root, patch): | |||
38 | res = True | 38 | res = True |
39 | patchpath = os.path.abspath(os.path.join(root, patch)) | 39 | patchpath = os.path.abspath(os.path.join(root, patch)) |
40 | 40 | ||
41 | cmd = 'patchtest --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath) | 41 | cmd = 'patchtest --base-commit HEAD --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath) |
42 | results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True) | 42 | results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True) |
43 | 43 | ||
44 | return results | 44 | return results |
diff --git a/meta/lib/patchtest/tests/base.py b/meta/lib/patchtest/tests/base.py index 424e61b5be..919ca136bb 100644 --- a/meta/lib/patchtest/tests/base.py +++ b/meta/lib/patchtest/tests/base.py | |||
@@ -8,20 +8,23 @@ import unittest | |||
8 | import logging | 8 | import logging |
9 | import json | 9 | import json |
10 | import unidiff | 10 | import unidiff |
11 | from data import PatchTestInput | 11 | from patchtest_parser import PatchtestParser |
12 | import mailbox | 12 | import mailbox |
13 | import patchtest_patterns | ||
13 | import collections | 14 | import collections |
14 | import sys | 15 | import sys |
15 | import os | 16 | import os |
16 | import re | 17 | import re |
17 | 18 | ||
18 | sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'pyparsing')) | 19 | logger = logging.getLogger("patchtest") |
20 | debug = logger.debug | ||
21 | info = logger.info | ||
22 | warn = logger.warn | ||
23 | error = logger.error | ||
19 | 24 | ||
20 | logger = logging.getLogger('patchtest') | 25 | Commit = collections.namedtuple( |
21 | debug=logger.debug | 26 | "Commit", ["author", "subject", "commit_message", "shortlog", "payload"] |
22 | info=logger.info | 27 | ) |
23 | warn=logger.warn | ||
24 | error=logger.error | ||
25 | 28 | ||
26 | Commit = collections.namedtuple('Commit', ['author', 'subject', 'commit_message', 'shortlog', 'payload']) | 29 | Commit = collections.namedtuple('Commit', ['author', 'subject', 'commit_message', 'shortlog', 'payload']) |
27 | 30 | ||
@@ -34,10 +37,6 @@ class PatchtestOEError(Exception): | |||
34 | class Base(unittest.TestCase): | 37 | class Base(unittest.TestCase): |
35 | # if unit test fails, fail message will throw at least the following JSON: {"id": <testid>} | 38 | # if unit test fails, fail message will throw at least the following JSON: {"id": <testid>} |
36 | 39 | ||
37 | endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n') | ||
38 | patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+') | ||
39 | |||
40 | |||
41 | @staticmethod | 40 | @staticmethod |
42 | def msg_to_commit(msg): | 41 | def msg_to_commit(msg): |
43 | payload = msg.get_payload() | 42 | payload = msg.get_payload() |
@@ -50,7 +49,7 @@ class Base(unittest.TestCase): | |||
50 | @staticmethod | 49 | @staticmethod |
51 | def commit_message(payload): | 50 | def commit_message(payload): |
52 | commit_message = payload.__str__() | 51 | commit_message = payload.__str__() |
53 | match = Base.endcommit_messages_regex.search(payload) | 52 | match = patchtest_patterns.endcommit_messages_regex.search(payload) |
54 | if match: | 53 | if match: |
55 | commit_message = payload[:match.start()] | 54 | commit_message = payload[:match.start()] |
56 | return commit_message | 55 | return commit_message |
@@ -66,13 +65,15 @@ class Base(unittest.TestCase): | |||
66 | def setUpClass(cls): | 65 | def setUpClass(cls): |
67 | 66 | ||
68 | # General objects: mailbox.mbox and patchset | 67 | # General objects: mailbox.mbox and patchset |
69 | cls.mbox = mailbox.mbox(PatchTestInput.repo.patch) | 68 | cls.mbox = mailbox.mbox(PatchtestParser.repo.patch.path) |
70 | 69 | ||
71 | # Patch may be malformed, so try parsing it | 70 | # Patch may be malformed, so try parsing it |
72 | cls.unidiff_parse_error = '' | 71 | cls.unidiff_parse_error = '' |
73 | cls.patchset = None | 72 | cls.patchset = None |
74 | try: | 73 | try: |
75 | cls.patchset = unidiff.PatchSet.from_filename(PatchTestInput.repo.patch, encoding=u'UTF-8') | 74 | cls.patchset = unidiff.PatchSet.from_filename( |
75 | PatchtestParser.repo.patch.path, encoding="UTF-8" | ||
76 | ) | ||
76 | except unidiff.UnidiffParseError as upe: | 77 | except unidiff.UnidiffParseError as upe: |
77 | cls.patchset = [] | 78 | cls.patchset = [] |
78 | cls.unidiff_parse_error = str(upe) | 79 | cls.unidiff_parse_error = str(upe) |
@@ -149,7 +150,7 @@ class Metadata(Base): | |||
149 | 150 | ||
150 | # import relevant libraries | 151 | # import relevant libraries |
151 | try: | 152 | try: |
152 | scripts_path = os.path.join(PatchTestInput.repodir, 'scripts', 'lib') | 153 | scripts_path = os.path.join(PatchtestParser.repodir, "scripts", "lib") |
153 | if scripts_path not in sys.path: | 154 | if scripts_path not in sys.path: |
154 | sys.path.insert(0, scripts_path) | 155 | sys.path.insert(0, scripts_path) |
155 | import scriptpath | 156 | import scriptpath |
@@ -224,11 +225,23 @@ class Metadata(Base): | |||
224 | for patch in patchset: | 225 | for patch in patchset: |
225 | if patch.path.endswith('.bb') or patch.path.endswith('.bbappend') or patch.path.endswith('.inc'): | 226 | if patch.path.endswith('.bb') or patch.path.endswith('.bbappend') or patch.path.endswith('.inc'): |
226 | if patch.is_added_file: | 227 | if patch.is_added_file: |
227 | added_paths.append(os.path.join(os.path.abspath(PatchTestInput.repodir), patch.path)) | 228 | added_paths.append( |
229 | os.path.join( | ||
230 | os.path.abspath(PatchtestParser.repodir), patch.path | ||
231 | ) | ||
232 | ) | ||
228 | elif patch.is_modified_file: | 233 | elif patch.is_modified_file: |
229 | modified_paths.append(os.path.join(os.path.abspath(PatchTestInput.repodir), patch.path)) | 234 | modified_paths.append( |
235 | os.path.join( | ||
236 | os.path.abspath(PatchtestParser.repodir), patch.path | ||
237 | ) | ||
238 | ) | ||
230 | elif patch.is_removed_file: | 239 | elif patch.is_removed_file: |
231 | removed_paths.append(os.path.join(os.path.abspath(PatchTestInput.repodir), patch.path)) | 240 | removed_paths.append( |
241 | os.path.join( | ||
242 | os.path.abspath(PatchtestParser.repodir), patch.path | ||
243 | ) | ||
244 | ) | ||
232 | 245 | ||
233 | data = cls.tinfoil.cooker.recipecaches[''].pkg_fn.items() | 246 | data = cls.tinfoil.cooker.recipecaches[''].pkg_fn.items() |
234 | 247 | ||
diff --git a/meta/lib/patchtest/tests/pyparsing/common.py b/meta/lib/patchtest/tests/pyparsing/common.py deleted file mode 100644 index cbce4c38bc..0000000000 --- a/meta/lib/patchtest/tests/pyparsing/common.py +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | # common pyparsing variables | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | |||
7 | import pyparsing | ||
8 | |||
9 | # general | ||
10 | colon = pyparsing.Literal(":") | ||
11 | start = pyparsing.LineStart() | ||
12 | end = pyparsing.LineEnd() | ||
13 | at = pyparsing.Literal("@") | ||
14 | lessthan = pyparsing.Literal("<") | ||
15 | greaterthan = pyparsing.Literal(">") | ||
16 | opensquare = pyparsing.Literal("[") | ||
17 | closesquare = pyparsing.Literal("]") | ||
18 | inappropriate = pyparsing.CaselessLiteral("Inappropriate") | ||
19 | submitted = pyparsing.CaselessLiteral("Submitted") | ||
20 | |||
21 | # word related | ||
22 | nestexpr = pyparsing.nestedExpr(opener='[', closer=']') | ||
23 | inappropriateinfo = pyparsing.Literal("Inappropriate") + nestexpr | ||
24 | submittedinfo = pyparsing.Literal("Submitted") + nestexpr | ||
25 | word = pyparsing.Word(pyparsing.alphas) | ||
26 | worddot = pyparsing.Word(pyparsing.alphas+".") | ||
diff --git a/meta/lib/patchtest/tests/pyparsing/parse_cve_tags.py b/meta/lib/patchtest/tests/pyparsing/parse_cve_tags.py deleted file mode 100644 index f7fb82ec2b..0000000000 --- a/meta/lib/patchtest/tests/pyparsing/parse_cve_tags.py +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | # signed-off-by pyparsing definition | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | |||
7 | |||
8 | import pyparsing | ||
9 | import common | ||
10 | |||
11 | name = pyparsing.Regex('\S+.*(?= <)') | ||
12 | username = pyparsing.OneOrMore(common.worddot) | ||
13 | domain = pyparsing.OneOrMore(common.worddot) | ||
14 | cve = pyparsing.Regex('CVE\-\d{4}\-\d+') | ||
15 | cve_mark = pyparsing.Literal("CVE:") | ||
16 | |||
17 | cve_tag = pyparsing.AtLineStart(cve_mark + cve) | ||
18 | patch_cve_tag = pyparsing.AtLineStart("+" + cve_mark + cve) | ||
diff --git a/meta/lib/patchtest/tests/pyparsing/parse_shortlog.py b/meta/lib/patchtest/tests/pyparsing/parse_shortlog.py deleted file mode 100644 index 30d3ab35b3..0000000000 --- a/meta/lib/patchtest/tests/pyparsing/parse_shortlog.py +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | # subject pyparsing definition | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | |||
7 | # NOTE:This is an oversimplified syntax of the mbox's summary | ||
8 | |||
9 | import pyparsing | ||
10 | import common | ||
11 | |||
12 | target = pyparsing.OneOrMore(pyparsing.Word(pyparsing.printables.replace(':',''))) | ||
13 | summary = pyparsing.OneOrMore(pyparsing.Word(pyparsing.printables)) | ||
14 | shortlog = common.start + target + common.colon + summary + common.end | ||
diff --git a/meta/lib/patchtest/tests/pyparsing/parse_signed_off_by.py b/meta/lib/patchtest/tests/pyparsing/parse_signed_off_by.py deleted file mode 100644 index 692ebec3ff..0000000000 --- a/meta/lib/patchtest/tests/pyparsing/parse_signed_off_by.py +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | # signed-off-by pyparsing definition | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | |||
7 | |||
8 | import pyparsing | ||
9 | import common | ||
10 | |||
11 | name = pyparsing.Regex('\S+.*(?= <)') | ||
12 | username = pyparsing.OneOrMore(common.worddot) | ||
13 | domain = pyparsing.OneOrMore(common.worddot) | ||
14 | |||
15 | # taken from https://pyparsing-public.wikispaces.com/Helpful+Expressions | ||
16 | email = pyparsing.Regex(r"(?P<user>[A-Za-z0-9._%+-]+)@(?P<hostname>[A-Za-z0-9.-]+)\.(?P<domain>[A-Za-z]{2,})") | ||
17 | |||
18 | email_enclosed = common.lessthan + email + common.greaterthan | ||
19 | |||
20 | signed_off_by_mark = pyparsing.Literal("Signed-off-by:") | ||
21 | signed_off_by = pyparsing.AtLineStart(signed_off_by_mark + name + email_enclosed) | ||
22 | patch_signed_off_by = pyparsing.AtLineStart("+" + signed_off_by_mark + name + email_enclosed) | ||
diff --git a/meta/lib/patchtest/tests/pyparsing/parse_upstream_status.py b/meta/lib/patchtest/tests/pyparsing/parse_upstream_status.py deleted file mode 100644 index bc6c427c4c..0000000000 --- a/meta/lib/patchtest/tests/pyparsing/parse_upstream_status.py +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | # upstream-status pyparsing definition | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | |||
7 | |||
8 | import common | ||
9 | import pyparsing | ||
10 | |||
11 | upstream_status_literal_valid_status = ["Pending", "Backport", "Denied", "Inappropriate", "Submitted"] | ||
12 | upstream_status_nonliteral_valid_status = ["Pending", "Backport", "Denied", "Inappropriate [reason]", "Submitted [where]"] | ||
13 | |||
14 | upstream_status_valid_status = pyparsing.Or( | ||
15 | [pyparsing.Literal(status) for status in upstream_status_literal_valid_status] | ||
16 | ) | ||
17 | |||
18 | upstream_status_mark = pyparsing.Literal("Upstream-Status") | ||
19 | inappropriate_status_mark = common.inappropriate | ||
20 | submitted_status_mark = common.submitted | ||
21 | |||
22 | upstream_status = common.start + upstream_status_mark + common.colon + upstream_status_valid_status | ||
23 | upstream_status_inappropriate_info = common.start + upstream_status_mark + common.colon + common.inappropriateinfo | ||
24 | upstream_status_submitted_info = common.start + upstream_status_mark + common.colon + common.submittedinfo | ||
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py index 0b623b7d17..dab733ea77 100644 --- a/meta/lib/patchtest/tests/test_mbox.py +++ b/meta/lib/patchtest/tests/test_mbox.py | |||
@@ -6,15 +6,15 @@ | |||
6 | 6 | ||
7 | import base | 7 | import base |
8 | import collections | 8 | import collections |
9 | import parse_shortlog | 9 | import patchtest_patterns |
10 | import parse_signed_off_by | ||
11 | import pyparsing | 10 | import pyparsing |
11 | import re | ||
12 | import subprocess | 12 | import subprocess |
13 | from data import PatchTestInput | 13 | from patchtest_parser import PatchtestParser |
14 | 14 | ||
15 | def headlog(): | 15 | def headlog(): |
16 | output = subprocess.check_output( | 16 | output = subprocess.check_output( |
17 | "cd %s; git log --pretty='%%h#%%aN#%%cD:#%%s' -1" % PatchTestInput.repodir, | 17 | "cd %s; git log --pretty='%%h#%%aN#%%cD:#%%s' -1" % PatchtestParser.repodir, |
18 | universal_newlines=True, | 18 | universal_newlines=True, |
19 | shell=True | 19 | shell=True |
20 | ) | 20 | ) |
@@ -22,20 +22,6 @@ def headlog(): | |||
22 | 22 | ||
23 | class TestMbox(base.Base): | 23 | class TestMbox(base.Base): |
24 | 24 | ||
25 | auh_email = 'auh@auh.yoctoproject.org' | ||
26 | |||
27 | invalids = [pyparsing.Regex("^Upgrade Helper.+"), | ||
28 | pyparsing.Regex(auh_email), | ||
29 | pyparsing.Regex("uh@not\.set"), | ||
30 | pyparsing.Regex("\S+@example\.com")] | ||
31 | |||
32 | rexp_detect = pyparsing.Regex('\[\s?YOCTO.*\]') | ||
33 | rexp_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') | ||
34 | revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') | ||
35 | signoff_prog = parse_signed_off_by.signed_off_by | ||
36 | revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') | ||
37 | maxlength = 90 | ||
38 | |||
39 | # base paths of main yocto project sub-projects | 25 | # base paths of main yocto project sub-projects |
40 | paths = { | 26 | paths = { |
41 | 'oe-core': ['meta-selftest', 'meta-skeleton', 'meta', 'scripts'], | 27 | 'oe-core': ['meta-selftest', 'meta-skeleton', 'meta', 'scripts'], |
@@ -57,16 +43,18 @@ class TestMbox(base.Base): | |||
57 | 43 | ||
58 | 44 | ||
59 | def test_signed_off_by_presence(self): | 45 | def test_signed_off_by_presence(self): |
60 | for commit in TestMbox.commits: | 46 | for commit in self.commits: |
61 | # skip those patches that revert older commits, these do not required the tag presence | 47 | # skip those patches that revert older commits, these do not required the tag presence |
62 | if self.revert_shortlog_regex.search_string(commit.shortlog): | 48 | if patchtest_patterns.mbox_revert_shortlog_regex.search_string(commit.shortlog): |
63 | continue | 49 | continue |
64 | if not self.signoff_prog.search_string(commit.payload): | 50 | if not patchtest_patterns.signed_off_by.search_string(commit.payload): |
65 | self.fail('Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s"', | 51 | self.fail( |
66 | commit=commit) | 52 | 'Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s"', |
53 | commit=commit, | ||
54 | ) | ||
67 | 55 | ||
68 | def test_shortlog_format(self): | 56 | def test_shortlog_format(self): |
69 | for commit in TestMbox.commits: | 57 | for commit in self.commits: |
70 | shortlog = commit.shortlog | 58 | shortlog = commit.shortlog |
71 | if not shortlog.strip(): | 59 | if not shortlog.strip(): |
72 | self.skip('Empty shortlog, no reason to execute shortlog format test') | 60 | self.skip('Empty shortlog, no reason to execute shortlog format test') |
@@ -75,40 +63,54 @@ class TestMbox(base.Base): | |||
75 | if shortlog.startswith('Revert "'): | 63 | if shortlog.startswith('Revert "'): |
76 | continue | 64 | continue |
77 | try: | 65 | try: |
78 | parse_shortlog.shortlog.parseString(shortlog) | 66 | patchtest_patterns.shortlog.parseString(shortlog) |
79 | except pyparsing.ParseException as pe: | 67 | except pyparsing.ParseException as pe: |
80 | self.fail('Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"', | 68 | self.fail('Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"', |
81 | commit=commit) | 69 | commit=commit) |
82 | 70 | ||
83 | def test_shortlog_length(self): | 71 | def test_shortlog_length(self): |
84 | for commit in TestMbox.commits: | 72 | for commit in self.commits: |
85 | # no reason to re-check on revert shortlogs | 73 | # no reason to re-check on revert shortlogs |
86 | shortlog = commit.shortlog | 74 | shortlog = re.sub('^(\[.*?\])+ ', '', commit.shortlog) |
87 | if shortlog.startswith('Revert "'): | 75 | if shortlog.startswith('Revert "'): |
88 | continue | 76 | continue |
89 | l = len(shortlog) | 77 | l = len(shortlog) |
90 | if l > self.maxlength: | 78 | if l > patchtest_patterns.mbox_shortlog_maxlength: |
91 | self.fail('Edit shortlog so that it is %d characters or less (currently %d characters)' % (self.maxlength, l), | 79 | self.fail( |
92 | commit=commit) | 80 | "Edit shortlog so that it is %d characters or less (currently %d characters)" |
81 | % (patchtest_patterns.mbox_shortlog_maxlength, l), | ||
82 | commit=commit, | ||
83 | ) | ||
93 | 84 | ||
94 | def test_series_merge_on_head(self): | 85 | def test_series_merge_on_head(self): |
95 | self.skip("Merge test is disabled for now") | 86 | self.skip("Merge test is disabled for now") |
96 | if PatchTestInput.repo.branch != "master": | 87 | if PatchtestParser.repo.patch.branch != "master": |
97 | self.skip("Skipping merge test since patch is not intended for master branch. Target detected is %s" % PatchTestInput.repo.branch) | 88 | self.skip( |
98 | if not PatchTestInput.repo.ismerged: | 89 | "Skipping merge test since patch is not intended" |
90 | " for master branch. Target detected is %s" | ||
91 | % PatchtestParser.repo.patch.branch | ||
92 | ) | ||
93 | if not PatchtestParser.repo.canbemerged: | ||
99 | commithash, author, date, shortlog = headlog() | 94 | commithash, author, date, shortlog = headlog() |
100 | self.fail('Series does not apply on top of target branch %s' % PatchTestInput.repo.branch, | 95 | self.fail( |
101 | data=[('Targeted branch', '%s (currently at %s)' % (PatchTestInput.repo.branch, commithash))]) | 96 | "Series does not apply on top of target branch %s" |
97 | % PatchtestParser.repo.patch.branch, | ||
98 | data=[ | ||
99 | ( | ||
100 | "Targeted branch", | ||
101 | "%s (currently at %s)" | ||
102 | % (PatchtestParser.repo.patch.branch, commithash), | ||
103 | ) | ||
104 | ], | ||
105 | ) | ||
102 | 106 | ||
103 | def test_target_mailing_list(self): | 107 | def test_target_mailing_list(self): |
104 | """In case of merge failure, check for other targeted projects""" | 108 | """Check for other targeted projects""" |
105 | if PatchTestInput.repo.ismerged: | ||
106 | self.skip('Series merged, no reason to check other mailing lists') | ||
107 | 109 | ||
108 | # a meta project may be indicted in the message subject, if this is the case, just fail | 110 | # a meta project may be indicted in the message subject, if this is the case, just fail |
109 | # TODO: there may be other project with no-meta prefix, we also need to detect these | 111 | # TODO: there may be other project with no-meta prefix, we also need to detect these |
110 | project_regex = pyparsing.Regex("\[(?P<project>meta-.+)\]") | 112 | project_regex = pyparsing.Regex("\[(?P<project>meta-.+)\]") |
111 | for commit in TestMbox.commits: | 113 | for commit in self.commits: |
112 | match = project_regex.search_string(commit.subject) | 114 | match = project_regex.search_string(commit.subject) |
113 | if match: | 115 | if match: |
114 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists', | 116 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists', |
@@ -136,24 +138,42 @@ class TestMbox(base.Base): | |||
136 | data=[('Diff line',self.unidiff_parse_error)]) | 138 | data=[('Diff line',self.unidiff_parse_error)]) |
137 | 139 | ||
138 | def test_commit_message_presence(self): | 140 | def test_commit_message_presence(self): |
139 | for commit in TestMbox.commits: | 141 | for commit in self.commits: |
140 | if not commit.commit_message.strip(): | 142 | if not commit.commit_message.strip(): |
141 | self.fail('Please include a commit message on your patch explaining the change', commit=commit) | 143 | self.fail('Please include a commit message on your patch explaining the change', commit=commit) |
142 | 144 | ||
145 | # This may incorrectly report a failure if something such as a | ||
146 | # Python decorator is included in the commit message, but this | ||
147 | # scenario is much less common than the username case it is written | ||
148 | # to protect against | ||
149 | def test_commit_message_user_tags(self): | ||
150 | for commit in self.commits: | ||
151 | if patchtest_patterns.mbox_github_username.search_string(commit.commit_message): | ||
152 | self.fail('Mbox includes one or more GitHub-style username tags. Ensure that any "@" symbols are stripped out of usernames', commit=commit) | ||
153 | |||
143 | def test_bugzilla_entry_format(self): | 154 | def test_bugzilla_entry_format(self): |
144 | for commit in TestMbox.commits: | 155 | for commit in self.commits: |
145 | if not self.rexp_detect.search_string(commit.commit_message): | 156 | if not patchtest_patterns.mbox_bugzilla.search_string(commit.commit_message): |
146 | self.skip("No bug ID found") | 157 | self.skip("No bug ID found") |
147 | elif not self.rexp_validation.search_string(commit.commit_message): | 158 | elif not patchtest_patterns.mbox_bugzilla_validation.search_string( |
148 | self.fail('Bugzilla issue ID is not correctly formatted - specify it with format: "[YOCTO #<bugzilla ID>]"', commit=commit) | 159 | commit.commit_message |
160 | ): | ||
161 | self.fail( | ||
162 | 'Bugzilla issue ID is not correctly formatted - specify it with format: "[YOCTO #<bugzilla ID>]"', | ||
163 | commit=commit, | ||
164 | ) | ||
149 | 165 | ||
150 | def test_author_valid(self): | 166 | def test_author_valid(self): |
151 | for commit in self.commits: | 167 | for commit in self.commits: |
152 | for invalid in self.invalids: | 168 | for invalid in patchtest_patterns.invalid_submitters: |
153 | if invalid.search_string(commit.author): | 169 | if invalid.search_string(commit.author): |
154 | self.fail('Invalid author %s. Resend the series with a valid patch author' % commit.author, commit=commit) | 170 | self.fail('Invalid author %s. Resend the series with a valid patch author' % commit.author, commit=commit) |
155 | 171 | ||
156 | def test_non_auh_upgrade(self): | 172 | def test_non_auh_upgrade(self): |
157 | for commit in self.commits: | 173 | for commit in self.commits: |
158 | if self.auh_email in commit.payload: | 174 | if patchtest_patterns.auh_email in commit.commit_message: |
159 | self.fail('Invalid author %s. Resend the series with a valid patch author' % self.auh_email, commit=commit) | 175 | self.fail( |
176 | "Invalid author %s. Resend the series with a valid patch author" | ||
177 | % patchtest_patterns.auh_email, | ||
178 | commit=commit, | ||
179 | ) | ||
diff --git a/meta/lib/patchtest/tests/test_metadata.py b/meta/lib/patchtest/tests/test_metadata.py index be609dbd04..2dee80b002 100644 --- a/meta/lib/patchtest/tests/test_metadata.py +++ b/meta/lib/patchtest/tests/test_metadata.py | |||
@@ -5,28 +5,16 @@ | |||
5 | # SPDX-License-Identifier: GPL-2.0-only | 5 | # SPDX-License-Identifier: GPL-2.0-only |
6 | 6 | ||
7 | import base | 7 | import base |
8 | import collections | ||
8 | import os | 9 | import os |
10 | import patchtest_patterns | ||
9 | import pyparsing | 11 | import pyparsing |
10 | from data import PatchTestInput, PatchTestDataStore | 12 | from patchtest_parser import PatchtestParser |
13 | |||
14 | # Data store commonly used to share values between pre and post-merge tests | ||
15 | PatchTestDataStore = collections.defaultdict(str) | ||
11 | 16 | ||
12 | class TestMetadata(base.Metadata): | 17 | class TestMetadata(base.Metadata): |
13 | metadata_lic = 'LICENSE' | ||
14 | invalid_license = 'PATCHTESTINVALID' | ||
15 | metadata_chksum = 'LIC_FILES_CHKSUM' | ||
16 | license_var = 'LICENSE' | ||
17 | closed = 'CLOSED' | ||
18 | lictag_re = pyparsing.AtLineStart("License-Update:") | ||
19 | lic_chksum_added = pyparsing.AtLineStart("+" + metadata_chksum) | ||
20 | lic_chksum_removed = pyparsing.AtLineStart("-" + metadata_chksum) | ||
21 | add_mark = pyparsing.Regex('\+ ') | ||
22 | max_length = 200 | ||
23 | metadata_src_uri = 'SRC_URI' | ||
24 | md5sum = 'md5sum' | ||
25 | sha256sum = 'sha256sum' | ||
26 | git_regex = pyparsing.Regex('^git\:\/\/.*') | ||
27 | metadata_summary = 'SUMMARY' | ||
28 | cve_check_ignore_var = 'CVE_CHECK_IGNORE' | ||
29 | cve_status_var = 'CVE_STATUS' | ||
30 | 18 | ||
31 | def test_license_presence(self): | 19 | def test_license_presence(self): |
32 | if not self.added: | 20 | if not self.added: |
@@ -41,13 +29,13 @@ class TestMetadata(base.Metadata): | |||
41 | open_flag = 'a' | 29 | open_flag = 'a' |
42 | with open(auto_conf, open_flag) as fd: | 30 | with open(auto_conf, open_flag) as fd: |
43 | for pn in self.added: | 31 | for pn in self.added: |
44 | fd.write('LICENSE ??= "%s"\n' % self.invalid_license) | 32 | fd.write('LICENSE ??= "%s"\n' % patchtest_patterns.invalid_license) |
45 | 33 | ||
46 | no_license = False | 34 | no_license = False |
47 | for pn in self.added: | 35 | for pn in self.added: |
48 | rd = self.tinfoil.parse_recipe(pn) | 36 | rd = self.tinfoil.parse_recipe(pn) |
49 | license = rd.getVar(self.metadata_lic) | 37 | license = rd.getVar(patchtest_patterns.metadata_lic) |
50 | if license == self.invalid_license: | 38 | if license == patchtest_patterns.invalid_license: |
51 | no_license = True | 39 | no_license = True |
52 | break | 40 | break |
53 | 41 | ||
@@ -74,11 +62,13 @@ class TestMetadata(base.Metadata): | |||
74 | # we are not interested in images | 62 | # we are not interested in images |
75 | if '/images/' in pathname: | 63 | if '/images/' in pathname: |
76 | continue | 64 | continue |
77 | lic_files_chksum = rd.getVar(self.metadata_chksum) | 65 | lic_files_chksum = rd.getVar(patchtest_patterns.metadata_chksum) |
78 | if rd.getVar(self.license_var) == self.closed: | 66 | if rd.getVar(patchtest_patterns.license_var) == patchtest_patterns.closed: |
79 | continue | 67 | continue |
80 | if not lic_files_chksum: | 68 | if not lic_files_chksum: |
81 | self.fail('%s is missing in newly added recipe' % self.metadata_chksum) | 69 | self.fail( |
70 | "%s is missing in newly added recipe" % patchtest_patterns.metadata_chksum | ||
71 | ) | ||
82 | 72 | ||
83 | def test_lic_files_chksum_modified_not_mentioned(self): | 73 | def test_lic_files_chksum_modified_not_mentioned(self): |
84 | if not self.modified: | 74 | if not self.modified: |
@@ -89,11 +79,13 @@ class TestMetadata(base.Metadata): | |||
89 | if patch.path.endswith('.patch'): | 79 | if patch.path.endswith('.patch'): |
90 | continue | 80 | continue |
91 | payload = str(patch) | 81 | payload = str(patch) |
92 | if (self.lic_chksum_added.search_string(payload) or self.lic_chksum_removed.search_string(payload)): | 82 | if patchtest_patterns.lic_chksum_added.search_string( |
83 | payload | ||
84 | ) or patchtest_patterns.lic_chksum_removed.search_string(payload): | ||
93 | # if any patch on the series contain reference on the metadata, fail | 85 | # if any patch on the series contain reference on the metadata, fail |
94 | for commit in self.commits: | 86 | for commit in self.commits: |
95 | if self.lictag_re.search_string(commit.commit_message): | 87 | if patchtest_patterns.lictag_re.search_string(commit.commit_message): |
96 | break | 88 | break |
97 | else: | 89 | else: |
98 | self.fail('LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message') | 90 | self.fail('LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message') |
99 | 91 | ||
@@ -104,16 +96,22 @@ class TestMetadata(base.Metadata): | |||
104 | continue | 96 | continue |
105 | payload = str(patch) | 97 | payload = str(patch) |
106 | for line in payload.splitlines(): | 98 | for line in payload.splitlines(): |
107 | if self.add_mark.search_string(line): | 99 | if patchtest_patterns.add_mark.search_string(line): |
108 | current_line_length = len(line[1:]) | 100 | current_line_length = len(line[1:]) |
109 | if current_line_length > self.max_length: | 101 | if current_line_length > patchtest_patterns.patch_max_line_length: |
110 | self.fail('Patch line too long (current length %s, maximum is %s)' % (current_line_length, self.max_length), | 102 | self.fail( |
111 | data=[('Patch', patch.path), ('Line', '%s ...' % line[0:80])]) | 103 | "Patch line too long (current length %s, maximum is %s)" |
104 | % (current_line_length, patchtest_patterns.patch_max_line_length), | ||
105 | data=[ | ||
106 | ("Patch", patch.path), | ||
107 | ("Line", "%s ..." % line[0:80]), | ||
108 | ], | ||
109 | ) | ||
112 | 110 | ||
113 | def pretest_src_uri_left_files(self): | 111 | def pretest_src_uri_left_files(self): |
114 | # these tests just make sense on patches that can be merged | 112 | # these tests just make sense on patches that can be merged |
115 | if not PatchTestInput.repo.canbemerged: | 113 | if not PatchtestParser.repo.canbemerged: |
116 | self.skip('Patch cannot be merged') | 114 | self.skip("Patch cannot be merged") |
117 | if not self.modified: | 115 | if not self.modified: |
118 | self.skip('No modified recipes, skipping pretest') | 116 | self.skip('No modified recipes, skipping pretest') |
119 | 117 | ||
@@ -123,12 +121,14 @@ class TestMetadata(base.Metadata): | |||
123 | if 'core-image' in pn: | 121 | if 'core-image' in pn: |
124 | continue | 122 | continue |
125 | rd = self.tinfoil.parse_recipe(pn) | 123 | rd = self.tinfoil.parse_recipe(pn) |
126 | PatchTestDataStore['%s-%s-%s' % (self.shortid(), self.metadata_src_uri, pn)] = rd.getVar(self.metadata_src_uri) | 124 | PatchTestDataStore[ |
125 | "%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn) | ||
126 | ] = rd.getVar(patchtest_patterns.metadata_src_uri) | ||
127 | 127 | ||
128 | def test_src_uri_left_files(self): | 128 | def test_src_uri_left_files(self): |
129 | # these tests just make sense on patches that can be merged | 129 | # these tests just make sense on patches that can be merged |
130 | if not PatchTestInput.repo.canbemerged: | 130 | if not PatchtestParser.repo.canbemerged: |
131 | self.skip('Patch cannot be merged') | 131 | self.skip("Patch cannot be merged") |
132 | if not self.modified: | 132 | if not self.modified: |
133 | self.skip('No modified recipes, skipping pretest') | 133 | self.skip('No modified recipes, skipping pretest') |
134 | 134 | ||
@@ -138,11 +138,17 @@ class TestMetadata(base.Metadata): | |||
138 | if 'core-image' in pn: | 138 | if 'core-image' in pn: |
139 | continue | 139 | continue |
140 | rd = self.tinfoil.parse_recipe(pn) | 140 | rd = self.tinfoil.parse_recipe(pn) |
141 | PatchTestDataStore['%s-%s-%s' % (self.shortid(), self.metadata_src_uri, pn)] = rd.getVar(self.metadata_src_uri) | 141 | PatchTestDataStore[ |
142 | "%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn) | ||
143 | ] = rd.getVar(patchtest_patterns.metadata_src_uri) | ||
142 | 144 | ||
143 | for pn in self.modified: | 145 | for pn in self.modified: |
144 | pretest_src_uri = PatchTestDataStore['pre%s-%s-%s' % (self.shortid(), self.metadata_src_uri, pn)].split() | 146 | pretest_src_uri = PatchTestDataStore[ |
145 | test_src_uri = PatchTestDataStore['%s-%s-%s' % (self.shortid(), self.metadata_src_uri, pn)].split() | 147 | "pre%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn) |
148 | ].split() | ||
149 | test_src_uri = PatchTestDataStore[ | ||
150 | "%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn) | ||
151 | ].split() | ||
146 | 152 | ||
147 | pretest_files = set([os.path.basename(patch) for patch in pretest_src_uri if patch.startswith('file://')]) | 153 | pretest_files = set([os.path.basename(patch) for patch in pretest_src_uri if patch.startswith('file://')]) |
148 | test_files = set([os.path.basename(patch) for patch in test_src_uri if patch.startswith('file://')]) | 154 | test_files = set([os.path.basename(patch) for patch in test_src_uri if patch.startswith('file://')]) |
@@ -175,23 +181,32 @@ class TestMetadata(base.Metadata): | |||
175 | if 'core-image' in pn: | 181 | if 'core-image' in pn: |
176 | continue | 182 | continue |
177 | rd = self.tinfoil.parse_recipe(pn) | 183 | rd = self.tinfoil.parse_recipe(pn) |
178 | summary = rd.getVar(self.metadata_summary) | 184 | summary = rd.getVar(patchtest_patterns.metadata_summary) |
179 | 185 | ||
180 | # "${PN} version ${PN}-${PR}" is the default, so fail if default | 186 | # "${PN} version ${PN}-${PR}" is the default, so fail if default |
181 | if summary.startswith('%s version' % pn): | 187 | if summary.startswith("%s version" % pn): |
182 | self.fail('%s is missing in newly added recipe' % self.metadata_summary) | 188 | self.fail( |
189 | "%s is missing in newly added recipe" % patchtest_patterns.metadata_summary | ||
190 | ) | ||
183 | 191 | ||
184 | def test_cve_check_ignore(self): | 192 | def test_cve_check_ignore(self): |
185 | # Skip if we neither modified a recipe or target branches are not | 193 | # Skip if we neither modified a recipe or target branches are not |
186 | # Nanbield and newer. CVE_CHECK_IGNORE was first deprecated in Nanbield. | 194 | # Nanbield and newer. CVE_CHECK_IGNORE was first deprecated in Nanbield. |
187 | if not self.modified or PatchTestInput.repo.branch == "kirkstone" or PatchTestInput.repo.branch == "dunfell": | 195 | if ( |
188 | self.skip('No modified recipes or older target branch, skipping test') | 196 | not self.modified |
197 | or PatchtestParser.repo.patch.branch == "kirkstone" | ||
198 | or PatchtestParser.repo.patch.branch == "dunfell" | ||
199 | ): | ||
200 | self.skip("No modified recipes or older target branch, skipping test") | ||
189 | for pn in self.modified: | 201 | for pn in self.modified: |
190 | # we are not interested in images | 202 | # we are not interested in images |
191 | if 'core-image' in pn: | 203 | if 'core-image' in pn: |
192 | continue | 204 | continue |
193 | rd = self.tinfoil.parse_recipe(pn) | 205 | rd = self.tinfoil.parse_recipe(pn) |
194 | cve_check_ignore = rd.getVar(self.cve_check_ignore_var) | 206 | cve_check_ignore = rd.getVar(patchtest_patterns.cve_check_ignore_var) |
195 | 207 | ||
196 | if cve_check_ignore is not None: | 208 | if cve_check_ignore is not None: |
197 | self.fail('%s is deprecated and should be replaced by %s' % (self.cve_check_ignore_var, self.cve_status_var)) | 209 | self.fail( |
210 | "%s is deprecated and should be replaced by %s" | ||
211 | % (patchtest_patterns.cve_check_ignore_var, patchtest_patterns.cve_status_var) | ||
212 | ) | ||
diff --git a/meta/lib/patchtest/tests/test_patch.py b/meta/lib/patchtest/tests/test_patch.py index d7187a0cb1..d08b8a5019 100644 --- a/meta/lib/patchtest/tests/test_patch.py +++ b/meta/lib/patchtest/tests/test_patch.py | |||
@@ -7,16 +7,11 @@ | |||
7 | 7 | ||
8 | import base | 8 | import base |
9 | import os | 9 | import os |
10 | import parse_signed_off_by | 10 | import patchtest_patterns |
11 | import parse_upstream_status | ||
12 | import pyparsing | 11 | import pyparsing |
13 | 12 | ||
14 | class TestPatch(base.Base): | 13 | class TestPatch(base.Base): |
15 | 14 | ||
16 | re_cve_pattern = pyparsing.Regex("CVE\-\d{4}\-\d+") | ||
17 | re_cve_payload_tag = pyparsing.Regex("\+CVE:(\s+CVE\-\d{4}\-\d+)+") | ||
18 | upstream_status_regex = pyparsing.AtLineStart("+" + "Upstream-Status") | ||
19 | |||
20 | @classmethod | 15 | @classmethod |
21 | def setUpClassLocal(cls): | 16 | def setUpClassLocal(cls): |
22 | cls.newpatches = [] | 17 | cls.newpatches = [] |
@@ -25,17 +20,17 @@ class TestPatch(base.Base): | |||
25 | if patch.path.endswith('.patch') and patch.is_added_file: | 20 | if patch.path.endswith('.patch') and patch.is_added_file: |
26 | cls.newpatches.append(patch) | 21 | cls.newpatches.append(patch) |
27 | 22 | ||
28 | cls.mark = str(parse_signed_off_by.signed_off_by_mark).strip('"') | 23 | cls.mark = str(patchtest_patterns.signed_off_by_prefix).strip('"') |
29 | 24 | ||
30 | # match PatchSignedOffBy.mark with '+' preceding it | 25 | # match PatchSignedOffBy.mark with '+' preceding it |
31 | cls.prog = parse_signed_off_by.patch_signed_off_by | 26 | cls.prog = patchtest_patterns.patch_signed_off_by |
32 | 27 | ||
33 | def setUp(self): | 28 | def setUp(self): |
34 | if self.unidiff_parse_error: | 29 | if self.unidiff_parse_error: |
35 | self.skip('Parse error %s' % self.unidiff_parse_error) | 30 | self.skip('Parse error %s' % self.unidiff_parse_error) |
36 | 31 | ||
37 | self.valid_status = ', '.join(parse_upstream_status.upstream_status_nonliteral_valid_status) | 32 | self.valid_status = ", ".join(patchtest_patterns.upstream_status_nonliteral_valid_status) |
38 | self.standard_format = 'Upstream-Status: <Valid status>' | 33 | self.standard_format = "Upstream-Status: <Valid status>" |
39 | 34 | ||
40 | # we are just interested in series that introduce CVE patches, thus discard other | 35 | # we are just interested in series that introduce CVE patches, thus discard other |
41 | # possibilities: modification to current CVEs, patch directly introduced into the | 36 | # possibilities: modification to current CVEs, patch directly introduced into the |
@@ -50,31 +45,62 @@ class TestPatch(base.Base): | |||
50 | 45 | ||
51 | for newpatch in TestPatch.newpatches: | 46 | for newpatch in TestPatch.newpatches: |
52 | payload = newpatch.__str__() | 47 | payload = newpatch.__str__() |
53 | if not self.upstream_status_regex.search_string(payload): | 48 | if not patchtest_patterns.upstream_status_regex.search_string(payload): |
54 | self.fail('Added patch file is missing Upstream-Status: <Valid status> in the commit message', | 49 | self.fail( |
55 | data=[('Standard format', self.standard_format), ('Valid status', self.valid_status)]) | 50 | "Added patch file is missing Upstream-Status: <Valid status> in the commit message", |
51 | data=[ | ||
52 | ("Standard format", self.standard_format), | ||
53 | ("Valid status", self.valid_status), | ||
54 | ], | ||
55 | ) | ||
56 | for line in payload.splitlines(): | 56 | for line in payload.splitlines(): |
57 | if self.patchmetadata_regex.match(line): | 57 | if patchtest_patterns.patchmetadata_regex.match(line): |
58 | continue | 58 | continue |
59 | if self.upstream_status_regex.search_string(line): | 59 | if patchtest_patterns.upstream_status_regex.search_string(line): |
60 | if parse_upstream_status.inappropriate_status_mark.searchString(line): | 60 | if patchtest_patterns.inappropriate.searchString(line): |
61 | try: | 61 | try: |
62 | parse_upstream_status.upstream_status_inappropriate_info.parseString(line.lstrip('+')) | 62 | patchtest_patterns.upstream_status_inappropriate_info.parseString( |
63 | except pyparsing.ParseException as pe: | 63 | line.lstrip("+") |
64 | self.fail('Upstream-Status is Inappropriate, but no reason was provided', | 64 | ) |
65 | data=[('Current', pe.pstr), ('Standard format', 'Upstream-Status: Inappropriate [reason]')]) | 65 | except pyparsing.ParseException as pe: |
66 | elif parse_upstream_status.submitted_status_mark.searchString(line): | 66 | self.fail( |
67 | try: | 67 | "Upstream-Status is Inappropriate, but no reason was provided", |
68 | parse_upstream_status.upstream_status_submitted_info.parseString(line.lstrip('+')) | 68 | data=[ |
69 | except pyparsing.ParseException as pe: | 69 | ("Current", pe.pstr), |
70 | self.fail('Upstream-Status is Submitted, but it is not mentioned where', | 70 | ( |
71 | data=[('Current', pe.pstr), ('Standard format', 'Upstream-Status: Submitted [where]')]) | 71 | "Standard format", |
72 | else: | 72 | "Upstream-Status: Inappropriate [reason]", |
73 | try: | 73 | ), |
74 | parse_upstream_status.upstream_status.parseString(line.lstrip('+')) | 74 | ], |
75 | except pyparsing.ParseException as pe: | 75 | ) |
76 | self.fail('Upstream-Status is in incorrect format', | 76 | elif patchtest_patterns.submitted.searchString(line): |
77 | data=[('Current', pe.pstr), ('Standard format', self.standard_format), ('Valid status', self.valid_status)]) | 77 | try: |
78 | patchtest_patterns.upstream_status_submitted_info.parseString( | ||
79 | line.lstrip("+") | ||
80 | ) | ||
81 | except pyparsing.ParseException as pe: | ||
82 | self.fail( | ||
83 | "Upstream-Status is Submitted, but it is not mentioned where", | ||
84 | data=[ | ||
85 | ("Current", pe.pstr), | ||
86 | ( | ||
87 | "Standard format", | ||
88 | "Upstream-Status: Submitted [where]", | ||
89 | ), | ||
90 | ], | ||
91 | ) | ||
92 | else: | ||
93 | try: | ||
94 | patchtest_patterns.upstream_status.parseString(line.lstrip("+")) | ||
95 | except pyparsing.ParseException as pe: | ||
96 | self.fail( | ||
97 | "Upstream-Status is in incorrect format", | ||
98 | data=[ | ||
99 | ("Current", pe.pstr), | ||
100 | ("Standard format", self.standard_format), | ||
101 | ("Valid status", self.valid_status), | ||
102 | ], | ||
103 | ) | ||
78 | 104 | ||
79 | def test_signed_off_by_presence(self): | 105 | def test_signed_off_by_presence(self): |
80 | if not TestPatch.newpatches: | 106 | if not TestPatch.newpatches: |
@@ -83,7 +109,7 @@ class TestPatch(base.Base): | |||
83 | for newpatch in TestPatch.newpatches: | 109 | for newpatch in TestPatch.newpatches: |
84 | payload = newpatch.__str__() | 110 | payload = newpatch.__str__() |
85 | for line in payload.splitlines(): | 111 | for line in payload.splitlines(): |
86 | if self.patchmetadata_regex.match(line): | 112 | if patchtest_patterns.patchmetadata_regex.match(line): |
87 | continue | 113 | continue |
88 | if TestPatch.prog.search_string(payload): | 114 | if TestPatch.prog.search_string(payload): |
89 | break | 115 | break |
@@ -92,10 +118,12 @@ class TestPatch(base.Base): | |||
92 | 118 | ||
93 | def test_cve_tag_format(self): | 119 | def test_cve_tag_format(self): |
94 | for commit in TestPatch.commits: | 120 | for commit in TestPatch.commits: |
95 | if self.re_cve_pattern.search_string(commit.shortlog) or self.re_cve_pattern.search_string(commit.commit_message): | 121 | if patchtest_patterns.cve.search_string( |
122 | commit.shortlog | ||
123 | ) or patchtest_patterns.cve.search_string(commit.commit_message): | ||
96 | tag_found = False | 124 | tag_found = False |
97 | for line in commit.payload.splitlines(): | 125 | for line in commit.payload.splitlines(): |
98 | if self.re_cve_payload_tag.search_string(line): | 126 | if patchtest_patterns.cve_payload_tag.search_string(line): |
99 | tag_found = True | 127 | tag_found = True |
100 | break | 128 | break |
101 | if not tag_found: | 129 | if not tag_found: |
diff --git a/meta/lib/patchtest/tests/test_python_pylint.py b/meta/lib/patchtest/tests/test_python_pylint.py index ef315e591c..ec9129bc79 100644 --- a/meta/lib/patchtest/tests/test_python_pylint.py +++ b/meta/lib/patchtest/tests/test_python_pylint.py | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | import base | 7 | import base |
8 | from io import StringIO | 8 | from io import StringIO |
9 | from data import PatchTestInput | 9 | from patchtest_parser import PatchtestParser |
10 | from pylint.reporters.text import TextReporter | 10 | from pylint.reporters.text import TextReporter |
11 | import pylint.lint as lint | 11 | import pylint.lint as lint |
12 | 12 | ||
diff --git a/meta/lib/patchtest/utils.py b/meta/lib/patchtest/utils.py deleted file mode 100644 index dd0abc22d9..0000000000 --- a/meta/lib/patchtest/utils.py +++ /dev/null | |||
@@ -1,168 +0,0 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # utils: common methods used by the patchtest framework | ||
5 | # | ||
6 | # Copyright (C) 2016 Intel Corporation | ||
7 | # | ||
8 | # SPDX-License-Identifier: GPL-2.0-only | ||
9 | # | ||
10 | |||
11 | import os | ||
12 | import subprocess | ||
13 | import logging | ||
14 | import re | ||
15 | import mailbox | ||
16 | |||
17 | class CmdException(Exception): | ||
18 | """ Simple exception class where its attributes are the ones passed when instantiated """ | ||
19 | def __init__(self, cmd): | ||
20 | self._cmd = cmd | ||
21 | def __getattr__(self, name): | ||
22 | value = None | ||
23 | if self._cmd.has_key(name): | ||
24 | value = self._cmd[name] | ||
25 | return value | ||
26 | |||
27 | def exec_cmd(cmd, cwd, ignore_error=False, input=None, strip=True, updateenv={}): | ||
28 | """ | ||
29 | Input: | ||
30 | |||
31 | cmd: dict containing the following keys: | ||
32 | |||
33 | cmd : the command itself as an array of strings | ||
34 | ignore_error: if False, no exception is raised | ||
35 | strip: indicates if strip is done on the output (stdout and stderr) | ||
36 | input: input data to the command (stdin) | ||
37 | updateenv: environment variables to be appended to the current | ||
38 | process environment variables | ||
39 | |||
40 | NOTE: keys 'ignore_error' and 'input' are optional; if not included, | ||
41 | the defaults are the ones specify in the arguments | ||
42 | cwd: directory where commands are executed | ||
43 | ignore_error: raise CmdException if command fails to execute and | ||
44 | this value is False | ||
45 | input: input data (stdin) for the command | ||
46 | |||
47 | Output: dict containing the following keys: | ||
48 | |||
49 | cmd: the same as input | ||
50 | ignore_error: the same as input | ||
51 | strip: the same as input | ||
52 | input: the same as input | ||
53 | stdout: Standard output after command's execution | ||
54 | stderr: Standard error after command's execution | ||
55 | returncode: Return code after command's execution | ||
56 | |||
57 | """ | ||
58 | cmddefaults = { | ||
59 | 'cmd':'', | ||
60 | 'ignore_error':ignore_error, | ||
61 | 'strip':strip, | ||
62 | 'input':input, | ||
63 | 'updateenv':updateenv, | ||
64 | } | ||
65 | |||
66 | # update input values if necessary | ||
67 | cmddefaults.update(cmd) | ||
68 | |||
69 | _cmd = cmddefaults | ||
70 | |||
71 | if not _cmd['cmd']: | ||
72 | raise CmdException({'cmd':None, 'stderr':'no command given'}) | ||
73 | |||
74 | # update the environment | ||
75 | env = os.environ | ||
76 | env.update(_cmd['updateenv']) | ||
77 | |||
78 | _command = [e for e in _cmd['cmd']] | ||
79 | p = subprocess.Popen(_command, | ||
80 | stdin=subprocess.PIPE, | ||
81 | stdout=subprocess.PIPE, | ||
82 | stderr=subprocess.PIPE, | ||
83 | universal_newlines=True, | ||
84 | cwd=cwd, | ||
85 | env=env) | ||
86 | |||
87 | # execute the command and strip output | ||
88 | (_stdout, _stderr) = p.communicate(_cmd['input']) | ||
89 | if _cmd['strip']: | ||
90 | _stdout, _stderr = map(str.strip, [_stdout, _stderr]) | ||
91 | |||
92 | # generate the result | ||
93 | result = _cmd | ||
94 | result.update({'cmd':_command,'stdout':_stdout,'stderr':_stderr,'returncode':p.returncode}) | ||
95 | |||
96 | # launch exception if necessary | ||
97 | if not _cmd['ignore_error'] and p.returncode: | ||
98 | raise CmdException(result) | ||
99 | |||
100 | return result | ||
101 | |||
102 | def exec_cmds(cmds, cwd): | ||
103 | """ Executes commands | ||
104 | |||
105 | Input: | ||
106 | cmds: Array of commands | ||
107 | cwd: directory where commands are executed | ||
108 | |||
109 | Output: Array of output commands | ||
110 | """ | ||
111 | results = [] | ||
112 | _cmds = cmds | ||
113 | |||
114 | for cmd in _cmds: | ||
115 | result = exec_cmd(cmd, cwd) | ||
116 | results.append(result) | ||
117 | |||
118 | return results | ||
119 | |||
120 | def logger_create(name): | ||
121 | logger = logging.getLogger(name) | ||
122 | loggerhandler = logging.StreamHandler() | ||
123 | loggerhandler.setFormatter(logging.Formatter("%(message)s")) | ||
124 | logger.addHandler(loggerhandler) | ||
125 | logger.setLevel(logging.INFO) | ||
126 | return logger | ||
127 | |||
128 | def get_subject_prefix(path): | ||
129 | prefix = "" | ||
130 | mbox = mailbox.mbox(path) | ||
131 | |||
132 | if len(mbox): | ||
133 | subject = mbox[0]['subject'] | ||
134 | if subject: | ||
135 | pattern = re.compile(r"(\[.*\])", re.DOTALL) | ||
136 | match = pattern.search(subject) | ||
137 | if match: | ||
138 | prefix = match.group(1) | ||
139 | |||
140 | return prefix | ||
141 | |||
142 | def valid_branch(branch): | ||
143 | """ Check if branch is valid name """ | ||
144 | lbranch = branch.lower() | ||
145 | |||
146 | invalid = lbranch.startswith('patch') or \ | ||
147 | lbranch.startswith('rfc') or \ | ||
148 | lbranch.startswith('resend') or \ | ||
149 | re.search(r'^v\d+', lbranch) or \ | ||
150 | re.search(r'^\d+/\d+', lbranch) | ||
151 | |||
152 | return not invalid | ||
153 | |||
154 | def get_branch(path): | ||
155 | """ Get the branch name from mbox """ | ||
156 | fullprefix = get_subject_prefix(path) | ||
157 | branch, branches, valid_branches = None, [], [] | ||
158 | |||
159 | if fullprefix: | ||
160 | prefix = fullprefix.strip('[]') | ||
161 | branches = [ b.strip() for b in prefix.split(',')] | ||
162 | valid_branches = [b for b in branches if valid_branch(b)] | ||
163 | |||
164 | if len(valid_branches): | ||
165 | branch = valid_branches[0] | ||
166 | |||
167 | return branch | ||
168 | |||