diff mbox series

rteval: fix regex in kcompile to calculate patch number for kernel prefix

Message ID 20220804192825.1207283-1-magodse@redhat.com
State New
Headers show
Series rteval: fix regex in kcompile to calculate patch number for kernel prefix | expand

Commit Message

Manasi Godse Aug. 4, 2022, 7:28 p.m. UTC
Updated the regular expression to find the kernel prefix of the source
file. If there are kernel source files with the same major.minor version
but different patch numbers, kcompile would pick up the first one that
is listed based on the kernel prefix and ignore the patch number.
Example: linux-5.17.11.tar.xz and linux-5.17.13.tar.xz. If 5.17.13 had
to be tested, kcompile could pick up linux-5.17.11.tar.xz

Signed-off-by: Manasi Godse <magodse@redhat.com>
---
 rteval/modules/loads/kcompile.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Kacur Aug. 4, 2022, 8:36 p.m. UTC | #1
On Thu, 4 Aug 2022, Manasi Godse wrote:

> Updated the regular expression to find the kernel prefix of the source
> file. If there are kernel source files with the same major.minor version
> but different patch numbers, kcompile would pick up the first one that
> is listed based on the kernel prefix and ignore the patch number.
> Example: linux-5.17.11.tar.xz and linux-5.17.13.tar.xz. If 5.17.13 had
> to be tested, kcompile could pick up linux-5.17.11.tar.xz
> 
> Signed-off-by: Manasi Godse <magodse@redhat.com>
> ---
>  rteval/modules/loads/kcompile.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
> index 4a8659c042e6..6dd8d940f8b3 100644
> --- a/rteval/modules/loads/kcompile.py
> +++ b/rteval/modules/loads/kcompile.py
> @@ -176,7 +176,7 @@ class Kcompile(CommandLineLoad):
>              if not os.path.exists(tarfile):
>                  raise rtevalRuntimeError(self, f" tarfile {tarfile} does not exist!")
>              self.source = tarfile
> -            kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}", self.source).group(0)
> +            kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}\.*\d{1,2}", self.source).group(0)
>          else:
>              tarfiles = glob.glob(os.path.join(self.srcdir, f"{DEFAULT_KERNEL_PREFIX}*"))
>              if tarfiles:
> -- 
> 2.31.1
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index 4a8659c042e6..6dd8d940f8b3 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -176,7 +176,7 @@  class Kcompile(CommandLineLoad):
             if not os.path.exists(tarfile):
                 raise rtevalRuntimeError(self, f" tarfile {tarfile} does not exist!")
             self.source = tarfile
-            kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}", self.source).group(0)
+            kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}\.*\d{1,2}", self.source).group(0)
         else:
             tarfiles = glob.glob(os.path.join(self.srcdir, f"{DEFAULT_KERNEL_PREFIX}*"))
             if tarfiles: