From fd06e4f2664b69a2776cdc8188dba6e6e958d86a Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Thu, 12 Oct 2023 09:24:59 -0400 Subject: patchtest: clean up test suite Various tweaks to make the test suite cleaner and more efficient: - Replace use of "re" module with "pyparsing" in tests (but not base.py) - Make test_mbox_cve only check for CVE tags in the commit if the added patch has them - Make test_mbox_cve SKIP instead of PASS if there's no CVE tag - Simplify the bugzilla tag checking test now that pyparsing is used - Modify the selftest script to correctly parse the new result output (From OE-Core rev: 7a187c2475aa762e2bc830950f608143f2535a72) Signed-off-by: Trevor Gamblin Signed-off-by: Richard Purdie --- meta/lib/patchtest/tests/test_metadata_src_uri.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/lib/patchtest/tests/test_metadata_src_uri.py') diff --git a/meta/lib/patchtest/tests/test_metadata_src_uri.py b/meta/lib/patchtest/tests/test_metadata_src_uri.py index ce2ace17bb..c19582ec2d 100644 --- a/meta/lib/patchtest/tests/test_metadata_src_uri.py +++ b/meta/lib/patchtest/tests/test_metadata_src_uri.py @@ -6,8 +6,8 @@ import subprocess import base -import re import os +import pyparsing from data import PatchTestInput, PatchTestDataStore class SrcUri(base.Metadata): @@ -15,7 +15,7 @@ class SrcUri(base.Metadata): metadata = 'SRC_URI' md5sum = 'md5sum' sha256sum = 'sha256sum' - git_regex = re.compile('^git\:\/\/.*') + git_regex = pyparsing.Regex('^git\:\/\/.*') def setUp(self): # these tests just make sense on patches that can be merged -- cgit v1.2.3-54-g00ecf