public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] igt_command_line.sh: Fix bashism
@ 2017-09-25  9:54 Petri Latvala
  2017-09-25 11:46 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Petri Latvala @ 2017-09-25  9:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

[[ a != b ]] is a bashism. As it's just comparing $1 to an empty
string, use -n with a normal [ ].

/bin/sh is dash in CI.

Fixes: f0243a761f1b ("tests/igt_command_line.sh: Allow testing individual tests")
CC: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/igt_command_line.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 57d105e9..a8baaaa1 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -112,7 +112,7 @@ if [ $? -ne 0 ]; then
 	exit 99
 fi
 
-if [[ "$1" != "" ]] ; then
+if [ -n "$1" ] ; then
 	check_test $1
 	exit 0
 fi
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for igt_command_line.sh: Fix bashism
  2017-09-25  9:54 [PATCH i-g-t] igt_command_line.sh: Fix bashism Petri Latvala
@ 2017-09-25 11:46 ` Patchwork
  2017-09-25 11:48 ` [PATCH i-g-t] " Jani Nikula
  2017-09-25 15:23 ` ✗ Fi.CI.IGT: warning for " Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-09-25 11:46 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

== Series Details ==

Series: igt_command_line.sh: Fix bashism
URL   : https://patchwork.freedesktop.org/series/30826/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
f16a799807487b6e2dcc8c7940a1a8b424f10802 igt_core: Rework igt_system()

with latest DRM-Tip kernel build CI_DRM_3128
47916f134a9c drm-tip: 2017y-09m-25d-09h-31m-48s UTC integration manifest

Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-b:
                incomplete -> DMESG-WARN (fi-cfl-s) fdo#102294
Test drv_module_reload:
        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (fi-glk-1) fdo#102777

fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294
fdo#102777 https://bugs.freedesktop.org/show_bug.cgi?id=102777

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:444s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:469s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:419s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:524s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:279s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:508s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:500s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:499s
fi-cfl-s         total:289  pass:223  dwarn:34  dfail:0   fail:0   skip:32  time:547s
fi-cnl-y         total:289  pass:256  dwarn:0   dfail:0   fail:6   skip:27  time:664s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:416s
fi-glk-1         total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:567s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:426s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:403s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:438s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:495s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:461s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:475s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:576s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:589s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:542s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:754s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:491s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:472s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:565s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:436s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_247/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH i-g-t] igt_command_line.sh: Fix bashism
  2017-09-25  9:54 [PATCH i-g-t] igt_command_line.sh: Fix bashism Petri Latvala
  2017-09-25 11:46 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-09-25 11:48 ` Jani Nikula
  2017-09-26 12:01   ` Daniel Vetter
  2017-09-25 15:23 ` ✗ Fi.CI.IGT: warning for " Patchwork
  2 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2017-09-25 11:48 UTC (permalink / raw)
  To: Petri Latvala, intel-gfx; +Cc: Daniel Vetter

On Mon, 25 Sep 2017, Petri Latvala <petri.latvala@intel.com> wrote:
> [[ a != b ]] is a bashism. As it's just comparing $1 to an empty
> string, use -n with a normal [ ].
>
> /bin/sh is dash in CI.

There's probably /bin/bash around anyway, but I'm tired of fighting the
fight. So never mind about that.

You could add shellcheck to your static checks, with a list of
exceptions of shellcheck tests you don't care about. It would tell you,

In igt_command_line.sh line 115:
if [[ "$1" != "" ]] ; then
   ^-- SC2039: In POSIX sh, [[ ]] is undefined.


BR,
Jani.


>
> Fixes: f0243a761f1b ("tests/igt_command_line.sh: Allow testing individual tests")
> CC: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> ---
>  tests/igt_command_line.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
> index 57d105e9..a8baaaa1 100755
> --- a/tests/igt_command_line.sh
> +++ b/tests/igt_command_line.sh
> @@ -112,7 +112,7 @@ if [ $? -ne 0 ]; then
>  	exit 99
>  fi
>  
> -if [[ "$1" != "" ]] ; then
> +if [ -n "$1" ] ; then
>  	check_test $1
>  	exit 0
>  fi

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✗ Fi.CI.IGT: warning for igt_command_line.sh: Fix bashism
  2017-09-25  9:54 [PATCH i-g-t] igt_command_line.sh: Fix bashism Petri Latvala
  2017-09-25 11:46 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-09-25 11:48 ` [PATCH i-g-t] " Jani Nikula
@ 2017-09-25 15:23 ` Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-09-25 15:23 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

== Series Details ==

Series: igt_command_line.sh: Fix bashism
URL   : https://patchwork.freedesktop.org/series/30826/
State : warning

== Summary ==

Test prime_mmap:
        Subgroup test_userptr:
                dmesg-warn -> PASS       (shard-hsw) fdo#102939
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-C-frame-sequence:
                pass       -> DMESG-WARN (shard-hsw)
Test gem_eio:
        Subgroup throttle:
                dmesg-warn -> PASS       (shard-hsw) fdo#102886

fdo#102939 https://bugs.freedesktop.org/show_bug.cgi?id=102939
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102886 https://bugs.freedesktop.org/show_bug.cgi?id=102886

shard-hsw        total:2429 pass:1330 dwarn:5   dfail:0   fail:11  skip:1083 time:9908s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_247/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH i-g-t] igt_command_line.sh: Fix bashism
  2017-09-25 11:48 ` [PATCH i-g-t] " Jani Nikula
@ 2017-09-26 12:01   ` Daniel Vetter
  2017-09-26 12:27     ` Petri Latvala
  2017-09-29  9:34     ` Joonas Lahtinen
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Vetter @ 2017-09-26 12:01 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Daniel Vetter, intel-gfx

On Mon, Sep 25, 2017 at 02:48:41PM +0300, Jani Nikula wrote:
> On Mon, 25 Sep 2017, Petri Latvala <petri.latvala@intel.com> wrote:
> > [[ a != b ]] is a bashism. As it's just comparing $1 to an empty
> > string, use -n with a normal [ ].
> >
> > /bin/sh is dash in CI.
> 
> There's probably /bin/bash around anyway, but I'm tired of fighting the
> fight. So never mind about that.

Yeah, let's just switch to /bin/bash and stop bothering with dash. At
least I don't see any value in trying to be posix compliant, we're not
going to run on anything that doesn't have bash anyway.
-Daniel

> 
> You could add shellcheck to your static checks, with a list of
> exceptions of shellcheck tests you don't care about. It would tell you,
> 
> In igt_command_line.sh line 115:
> if [[ "$1" != "" ]] ; then
>    ^-- SC2039: In POSIX sh, [[ ]] is undefined.
> 
> 
> BR,
> Jani.
> 
> 
> >
> > Fixes: f0243a761f1b ("tests/igt_command_line.sh: Allow testing individual tests")
> > CC: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > ---
> >  tests/igt_command_line.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
> > index 57d105e9..a8baaaa1 100755
> > --- a/tests/igt_command_line.sh
> > +++ b/tests/igt_command_line.sh
> > @@ -112,7 +112,7 @@ if [ $? -ne 0 ]; then
> >  	exit 99
> >  fi
> >  
> > -if [[ "$1" != "" ]] ; then
> > +if [ -n "$1" ] ; then
> >  	check_test $1
> >  	exit 0
> >  fi
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH i-g-t] igt_command_line.sh: Fix bashism
  2017-09-26 12:01   ` Daniel Vetter
@ 2017-09-26 12:27     ` Petri Latvala
  2017-09-29  9:34     ` Joonas Lahtinen
  1 sibling, 0 replies; 8+ messages in thread
From: Petri Latvala @ 2017-09-26 12:27 UTC (permalink / raw)
  To: intel-gfx

On Tue, Sep 26, 2017 at 02:01:46PM +0200, Daniel Vetter wrote:
> On Mon, Sep 25, 2017 at 02:48:41PM +0300, Jani Nikula wrote:
> > On Mon, 25 Sep 2017, Petri Latvala <petri.latvala@intel.com> wrote:
> > > [[ a != b ]] is a bashism. As it's just comparing $1 to an empty
> > > string, use -n with a normal [ ].
> > >
> > > /bin/sh is dash in CI.
> > 
> > There's probably /bin/bash around anyway, but I'm tired of fighting the
> > fight. So never mind about that.
> 
> Yeah, let's just switch to /bin/bash and stop bothering with dash. At
> least I don't see any value in trying to be posix compliant, we're not
> going to run on anything that doesn't have bash anyway.


This script is used only on build-time anyway so the shebang doesn't
really matter much.

I made the shebang use /bin/bash in v2 (in addition to the changes in
v1) so it doesn't need further handholding and pushed with an IRC ack
from Daniel.


-- 
Petri Latvala
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH i-g-t] igt_command_line.sh: Fix bashism
  2017-09-26 12:01   ` Daniel Vetter
  2017-09-26 12:27     ` Petri Latvala
@ 2017-09-29  9:34     ` Joonas Lahtinen
  2017-10-02  8:49       ` Daniel Vetter
  1 sibling, 1 reply; 8+ messages in thread
From: Joonas Lahtinen @ 2017-09-29  9:34 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula; +Cc: Daniel Vetter, intel-gfx

On Tue, 2017-09-26 at 14:01 +0200, Daniel Vetter wrote:
> On Mon, Sep 25, 2017 at 02:48:41PM +0300, Jani Nikula wrote:
> > On Mon, 25 Sep 2017, Petri Latvala <petri.latvala@intel.com> wrote:
> > > [[ a != b ]] is a bashism. As it's just comparing $1 to an empty
> > > string, use -n with a normal [ ].
> > > 
> > > /bin/sh is dash in CI.
> > 
> > There's probably /bin/bash around anyway, but I'm tired of fighting the
> > fight. So never mind about that.
> 
> Yeah, let's just switch to /bin/bash and stop bothering with dash. At
> least I don't see any value in trying to be posix compliant, we're not
> going to run on anything that doesn't have bash anyway.

I'm actively running I-G-T with busybox sh, so please cut with the
/bin/bash stuff, it's not that hard to be POSIX compliant.

Original patch is;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH i-g-t] igt_command_line.sh: Fix bashism
  2017-09-29  9:34     ` Joonas Lahtinen
@ 2017-10-02  8:49       ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2017-10-02  8:49 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: Daniel Vetter, intel-gfx

On Fri, Sep 29, 2017 at 12:34:48PM +0300, Joonas Lahtinen wrote:
> On Tue, 2017-09-26 at 14:01 +0200, Daniel Vetter wrote:
> > On Mon, Sep 25, 2017 at 02:48:41PM +0300, Jani Nikula wrote:
> > > On Mon, 25 Sep 2017, Petri Latvala <petri.latvala@intel.com> wrote:
> > > > [[ a != b ]] is a bashism. As it's just comparing $1 to an empty
> > > > string, use -n with a normal [ ].
> > > > 
> > > > /bin/sh is dash in CI.
> > > 
> > > There's probably /bin/bash around anyway, but I'm tired of fighting the
> > > fight. So never mind about that.
> > 
> > Yeah, let's just switch to /bin/bash and stop bothering with dash. At
> > least I don't see any value in trying to be posix compliant, we're not
> > going to run on anything that doesn't have bash anyway.
> 
> I'm actively running I-G-T with busybox sh, so please cut with the
> /bin/bash stuff, it's not that hard to be POSIX compliant.

Is that a machine which doesn't have any bash at all, or is busysbox
simply your /bin/sh?

And yes it's imo not justified to be posix compliant if there's no
use-case for it, afaiui we haven't ever made a decision for igt to be
posix compliant when building (running might be a different thing, with
android and all that). And this is a build-time script here.
-Daniel

> 
> Original patch is;
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> Regards, Joonas
> -- 
> Joonas Lahtinen
> Open Source Technology Center
> Intel Corporation

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-02  8:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25  9:54 [PATCH i-g-t] igt_command_line.sh: Fix bashism Petri Latvala
2017-09-25 11:46 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-25 11:48 ` [PATCH i-g-t] " Jani Nikula
2017-09-26 12:01   ` Daniel Vetter
2017-09-26 12:27     ` Petri Latvala
2017-09-29  9:34     ` Joonas Lahtinen
2017-10-02  8:49       ` Daniel Vetter
2017-09-25 15:23 ` ✗ Fi.CI.IGT: warning for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox