diff mbox series

meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU

Message ID 20181016232143.5016-1-anibal.limon@linaro.org
State Superseded
Headers show
Series meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU | expand

Commit Message

Anibal Limon Oct. 16, 2018, 11:21 p.m. UTC
When use simpleremote target the flash/boot process is executed
manually, the IMAGE_FSTYPES validation is only needed when execute
testimage against qemu.

The supported_fstypes comes from oeqa.core.target.qemu module.

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
---
 meta/classes/testimage.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Richard Purdie Oct. 20, 2018, 7:11 a.m. UTC | #1
On Tue, 2018-10-16 at 18:21 -0500, Aníbal Limón wrote:
> When use simpleremote target the flash/boot process is executed
> manually, the IMAGE_FSTYPES validation is only needed when execute
> testimage against qemu.
> 
> The supported_fstypes comes from oeqa.core.target.qemu module.
> 
> Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
> ---
>  meta/classes/testimage.bbclass | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
> index 2642a722e7..734cb7caae 100644
> --- a/meta/classes/testimage.bbclass
> +++ b/meta/classes/testimage.bbclass
> @@ -194,12 +194,13 @@ def testimage_main(d):
>      machine = d.getVar("MACHINE")
>  
>      # Get rootfs
> -    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
> -                  if fs in supported_fstypes]
> -    if not fstypes:
> -        bb.fatal('Unsupported image type built. Add a comptible image to '
> -                 'IMAGE_FSTYPES. Supported types: %s' %
> -                 ', '.join(supported_fstypes))
> +    fstypes = d.getVar('IMAGE_FSTYPES')
> +    if d.getVar("TEST_TARGET") == "qemu":
> +        fstypes = [fs for fs in fstypes if fs in supported_fstypes]
> +        if not fstypes:
> +            bb.fatal('Unsupported image type built. Add a comptible image to '
> +                     'IMAGE_FSTYPES. Supported types: %s' %
> +                     ', '.join(supported_fstypes))
>      rootfs = '%s.%s' % (image_name, fstypes[0])
>  
>      # Get tmpdir (not really used, just for compatibility)

This causes the autobuilder to break and there is a bug in the logic
above:

https://autobuilder.yoctoproject.org/typhoon/#/builders/32/builds/128/steps/7/logs/step1c

(one of many failures as everything broke)

Cheers,

Richard
Anibal Limon Oct. 23, 2018, 12:38 a.m. UTC | #2
On Sat, 20 Oct 2018 at 02:11, <richard.purdie@linuxfoundation.org> wrote:

> On Tue, 2018-10-16 at 18:21 -0500, Aníbal Limón wrote:

> > When use simpleremote target the flash/boot process is executed

> > manually, the IMAGE_FSTYPES validation is only needed when execute

> > testimage against qemu.

> >

> > The supported_fstypes comes from oeqa.core.target.qemu module.

> >

> > Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>

> > ---

> >  meta/classes/testimage.bbclass | 13 +++++++------

> >  1 file changed, 7 insertions(+), 6 deletions(-)

> >

> > diff --git a/meta/classes/testimage.bbclass

> b/meta/classes/testimage.bbclass

> > index 2642a722e7..734cb7caae 100644

> > --- a/meta/classes/testimage.bbclass

> > +++ b/meta/classes/testimage.bbclass

> > @@ -194,12 +194,13 @@ def testimage_main(d):

> >      machine = d.getVar("MACHINE")

> >

> >      # Get rootfs

> > -    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')

> > -                  if fs in supported_fstypes]

> > -    if not fstypes:

> > -        bb.fatal('Unsupported image type built. Add a comptible image

> to '

> > -                 'IMAGE_FSTYPES. Supported types: %s' %

> > -                 ', '.join(supported_fstypes))

> > +    fstypes = d.getVar('IMAGE_FSTYPES')

> > +    if d.getVar("TEST_TARGET") == "qemu":

> > +        fstypes = [fs for fs in fstypes if fs in supported_fstypes]

> > +        if not fstypes:

> > +            bb.fatal('Unsupported image type built. Add a comptible

> image to '

> > +                     'IMAGE_FSTYPES. Supported types: %s' %

> > +                     ', '.join(supported_fstypes))

> >      rootfs = '%s.%s' % (image_name, fstypes[0])

> >

> >      # Get tmpdir (not really used, just for compatibility)

>

> This causes the autobuilder to break and there is a bug in the logic

> above:

>

>

> https://autobuilder.yoctoproject.org/typhoon/#/builders/32/builds/128/steps/7/logs/step1c



I'm not seeing this error, I executed testimage in qemuarm and qemux86,
I'm looking at the configuration but should not fail because I added only a
conditional to filter only
when the target is qemu.

Regards,
Anibal

>

>

> (one of many failures as everything broke)

>

> Cheers,

>

> Richard

>

>

>
<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, 20 Oct 2018 at 02:11, &lt;<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 2018-10-16 at 18:21 -0500, Aníbal Limón wrote:<br>
&gt; When use simpleremote target the flash/boot process is executed<br>
&gt; manually, the IMAGE_FSTYPES validation is only needed when execute<br>
&gt; testimage against qemu.<br>
&gt; <br>
&gt; The supported_fstypes comes from oeqa.core.target.qemu module.<br>
&gt; <br>
&gt; Signed-off-by: Aníbal Limón &lt;<a href="mailto:anibal.limon@linaro.org" target="_blank">anibal.limon@linaro.org</a>&gt;<br>
&gt; ---<br>
&gt;  meta/classes/testimage.bbclass | 13 +++++++------<br>
&gt;  1 file changed, 7 insertions(+), 6 deletions(-)<br>
&gt; <br>
&gt; diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass<br>
&gt; index 2642a722e7..734cb7caae 100644<br>
&gt; --- a/meta/classes/testimage.bbclass<br>
&gt; +++ b/meta/classes/testimage.bbclass<br>
&gt; @@ -194,12 +194,13 @@ def testimage_main(d):<br>
&gt;      machine = d.getVar(&quot;MACHINE&quot;)<br>
&gt;  <br>
&gt;      # Get rootfs<br>
&gt; -    fstypes = [fs for fs in d.getVar(&#39;IMAGE_FSTYPES&#39;).split(&#39; &#39;)<br>
&gt; -                  if fs in supported_fstypes]<br>
&gt; -    if not fstypes:<br>
&gt; -        bb.fatal(&#39;Unsupported image type built. Add a comptible image to &#39;<br>
&gt; -                 &#39;IMAGE_FSTYPES. Supported types: %s&#39; %<br>
&gt; -                 &#39;, &#39;.join(supported_fstypes))<br>
&gt; +    fstypes = d.getVar(&#39;IMAGE_FSTYPES&#39;)<br>
&gt; +    if d.getVar(&quot;TEST_TARGET&quot;) == &quot;qemu&quot;:<br>
&gt; +        fstypes = [fs for fs in fstypes if fs in supported_fstypes]<br>
&gt; +        if not fstypes:<br>
&gt; +            bb.fatal(&#39;Unsupported image type built. Add a comptible image to &#39;<br>
&gt; +                     &#39;IMAGE_FSTYPES. Supported types: %s&#39; %<br>
&gt; +                     &#39;, &#39;.join(supported_fstypes))<br>
&gt;      rootfs = &#39;%s.%s&#39; % (image_name, fstypes[0])<br>
&gt;  <br>
&gt;      # Get tmpdir (not really used, just for compatibility)<br>
<br>
This causes the autobuilder to break and there is a bug in the logic<br>
above:<br>
<br>
<a href="https://autobuilder.yoctoproject.org/typhoon/#/builders/32/builds/128/steps/7/logs/step1c" rel="noreferrer" target="_blank">https://autobuilder.yoctoproject.org/typhoon/#/builders/32/builds/128/steps/7/logs/step1c</a></blockquote><div><br></div><div>I&#39;m not seeing this error, I executed testimage in qemuarm and qemux86, </div><div>I&#39;m looking at the configuration but should not fail because I added only a conditional to filter only<br></div><div>when the target is qemu.</div><div><br></div><div>Regards,</div><div>Anibal </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
(one of many failures as everything broke)<br>
<br>
Cheers,<br>
<br>
Richard<br>
<br>
<br>
</blockquote></div></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton Nov. 15, 2018, 1:07 p.m. UTC | #3
On Tue, 23 Oct 2018 at 01:38, Anibal Limon <anibal.limon@linaro.org> wrote:
>> > -    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')


>> > +    fstypes = d.getVar('IMAGE_FSTYPES')

>> > +        fstypes = [fs for fs in fstypes if fs in supported_fstypes]


That's the problem, the old code takes IMAGE_FSTYPES and splits it on
whitespace, the new code iterates over each *character*

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Anibal Limon Jan. 2, 2019, 4:07 p.m. UTC | #4
On Thu, 15 Nov 2018 at 07:08, Burton, Ross <ross.burton@intel.com> wrote:

> On Tue, 23 Oct 2018 at 01:38, Anibal Limon <anibal.limon@linaro.org>

> wrote:

> >> > -    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')

>

> >> > +    fstypes = d.getVar('IMAGE_FSTYPES')

> >> > +        fstypes = [fs for fs in fstypes if fs in supported_fstypes]

>

> That's the problem, the old code takes IMAGE_FSTYPES and splits it on

> whitespace, the new code iterates over each *character*

>


I sent an old version, sorry for that, sending v3...

Anibal


>

> Ross

>
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 15 Nov 2018 at 07:08, Burton, Ross &lt;<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 23 Oct 2018 at 01:38, Anibal Limon &lt;<a href="mailto:anibal.limon@linaro.org" target="_blank">anibal.limon@linaro.org</a>&gt; wrote:<br>
&gt;&gt; &gt; -    fstypes = [fs for fs in d.getVar(&#39;IMAGE_FSTYPES&#39;).split(&#39; &#39;)<br>
<br>
&gt;&gt; &gt; +    fstypes = d.getVar(&#39;IMAGE_FSTYPES&#39;)<br>
&gt;&gt; &gt; +        fstypes = [fs for fs in fstypes if fs in supported_fstypes]<br>
<br>
That&#39;s the problem, the old code takes IMAGE_FSTYPES and splits it on<br>
whitespace, the new code iterates over each *character*<br></blockquote><div><br></div><div>I sent an old version, sorry for that, sending v3...</div><div><br></div><div>Anibal</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Ross<br>
</blockquote></div></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 2642a722e7..734cb7caae 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -194,12 +194,13 @@  def testimage_main(d):
     machine = d.getVar("MACHINE")
 
     # Get rootfs
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
-                  if fs in supported_fstypes]
-    if not fstypes:
-        bb.fatal('Unsupported image type built. Add a comptible image to '
-                 'IMAGE_FSTYPES. Supported types: %s' %
-                 ', '.join(supported_fstypes))
+    fstypes = d.getVar('IMAGE_FSTYPES')
+    if d.getVar("TEST_TARGET") == "qemu":
+        fstypes = [fs for fs in fstypes if fs in supported_fstypes]
+        if not fstypes:
+            bb.fatal('Unsupported image type built. Add a comptible image to '
+                     'IMAGE_FSTYPES. Supported types: %s' %
+                     ', '.join(supported_fstypes))
     rootfs = '%s.%s' % (image_name, fstypes[0])
 
     # Get tmpdir (not really used, just for compatibility)