diff mbox series

oeqa/selftest/devtool: Fix for usrmerge in DISTRO_FEATURES

Message ID 20240507224726.3796162-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit afa211746a2aa1993a54cc5a5e1937679341da8e
Headers show
Series oeqa/selftest/devtool: Fix for usrmerge in DISTRO_FEATURES | expand

Commit Message

Richard Purdie May 7, 2024, 10:47 p.m. UTC
If usrmerge is in DISTRO_FEATURES, assumptions in one of the tests would
fail. Improve the test so it works in both cases.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/devtool.py | 2 ++
 1 file changed, 2 insertions(+)

Comments

Khem Raj May 7, 2024, 10:50 p.m. UTC | #1
On Tue, May 7, 2024 at 3:47 PM Richard Purdie via lists.openembedded.org
<richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:

> If usrmerge is in DISTRO_FEATURES, assumptions in one of the tests would
> fail. Improve the test so it works in both cases.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/lib/oeqa/selftest/cases/devtool.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/devtool.py
> b/meta/lib/oeqa/selftest/cases/devtool.py
> index c8f9534e416..882225dde34 100644
> --- a/meta/lib/oeqa/selftest/cases/devtool.py
> +++ b/meta/lib/oeqa/selftest/cases/devtool.py
> @@ -1773,6 +1773,8 @@ class DevtoolExtractTests(DevtoolBase):
>          # Definitions
>          testrecipe = 'mdadm'
>          testfile = '/sbin/mdadm'
> +        if "usrmerge" in get_bb_var('DISTRO_FEATURES'):
> +            testfile = '/usr/sbin/mdadm'
>          testimage = 'oe-selftest-image'
>          testcommand = '/sbin/mdadm --help'


Won’t this line also need to be covered as well ?
I wonder if these paths need to be absolute or can they be searched in
standard paths

>
>          # Build an image to run
> --
> 2.40.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#199109):
> https://lists.openembedded.org/g/openembedded-core/message/199109
> Mute This Topic: https://lists.openembedded.org/mt/105970675/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Richard Purdie May 8, 2024, 8:09 a.m. UTC | #2
On Tue, 2024-05-07 at 15:50 -0700, Khem Raj wrote:
> 
> 
> On Tue, May 7, 2024 at 3:47 PM Richard Purdie via
> lists.openembedded.org
> <richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
> > If usrmerge is in DISTRO_FEATURES, assumptions in one of the tests
> > would
> > fail. Improve the test so it works in both cases.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> >  meta/lib/oeqa/selftest/cases/devtool.py | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/meta/lib/oeqa/selftest/cases/devtool.py
> > b/meta/lib/oeqa/selftest/cases/devtool.py
> > index c8f9534e416..882225dde34 100644
> > --- a/meta/lib/oeqa/selftest/cases/devtool.py
> > +++ b/meta/lib/oeqa/selftest/cases/devtool.py
> > @@ -1773,6 +1773,8 @@ class DevtoolExtractTests(DevtoolBase):
> >          # Definitions
> >          testrecipe = 'mdadm'
> >          testfile = '/sbin/mdadm'
> > +        if "usrmerge" in get_bb_var('DISTRO_FEATURES'):
> > +            testfile = '/usr/sbin/mdadm'
> >          testimage = 'oe-selftest-image'
> >          testcommand = '/sbin/mdadm --help'
> > 
> 
> 
> Won’t this line also need to be covered as well ?
> I wonder if these paths need to be absolute or can they be searched
> in standard paths 
> 

Good question. I checked and it works due to the symlink present but it
would probably look better if that is tweaked as well.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index c8f9534e416..882225dde34 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1773,6 +1773,8 @@  class DevtoolExtractTests(DevtoolBase):
         # Definitions
         testrecipe = 'mdadm'
         testfile = '/sbin/mdadm'
+        if "usrmerge" in get_bb_var('DISTRO_FEATURES'):
+            testfile = '/usr/sbin/mdadm'
         testimage = 'oe-selftest-image'
         testcommand = '/sbin/mdadm --help'
         # Build an image to run