Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-13 Thread Paul E. McKenney
On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote:
> Some of the scripts encode a default /bin/sh shell. On systems which use dash 
> as
> default shell, these scripts fail as they are bash scripts. I encountered this
> while testing the sprintf() changes on a Debian system where dash is the 
> default
> shell.
> 
> This commit changes all such uses to use bash explicitly.
> 
> Signed-off-by: Pranith Kumar 

Queued with Josh's Reviewed-by, thank you both!

One nit: In the future, please capitalize the word following the ":"
in the subject line.  So, instead of:

    [PATCH 1/1] rcutorture: use bash shell for all the test scripts

Write:

    [PATCH 1/1] rcutorture: Use bash shell for all the test scripts

I fixed this one and will fix your later permissions patch, but again,
please use this convention in future patches.

Thanx, Paul

> ---
>  tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
>  tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
>  tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
>  tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
>  tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
>  tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
>  tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
>  12 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
> b/tools/testing/selftests/rcutorture/bin/config2frag.sh
> index 9f9ffcd..4e394ef 100644
> --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
> +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
> @@ -1,5 +1,5 @@
> -#!/bin/sh
> -# Usage: sh config2frag.sh < .config > configfrag
> +#!/bin/bash
> +# Usage: bash config2frag.sh < .config > configfrag
>  #
>  # Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the
>  # resulting file becomes a legitimate Kconfig fragment.
> diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
> b/tools/testing/selftests/rcutorture/bin/configcheck.sh
> index d686537..6173ed5 100755
> --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
> +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
> @@ -1,5 +1,5 @@
> -#!/bin/sh
> -# Usage: sh configcheck.sh .config .config-template
> +#!/bin/bash
> +# Usage: bash configcheck.sh .config .config-template
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
> b/tools/testing/selftests/rcutorture/bin/configinit.sh
> index 9c3f3d3..d8f7418 100755
> --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
> +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
> @@ -1,6 +1,6 @@
> -#!/bin/sh
> +#!/bin/bash
>  #
> -# sh configinit.sh config-spec-file [ build output dir ]
> +# bash configinit.sh config-spec-file [ build output dir ]
>  #
>  # Create a .config file from the spec file.  Run from the kernel source tree.
>  # Exits with 0 if all went well, with 1 if all went well but the config
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
> b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> index 7c1e56b..e4bfb91 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> @@ -2,7 +2,7 @@
>  #
>  # Build a kvm-ready Linux kernel from the tree in the current directory.
>  #
> -# Usage: sh kvm-build.sh config-template build-dir more-configs
> +# Usage: bash kvm-build.sh config-template build-dir more-configs
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
> b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> index 7f1ff1a..30cbb63 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> @@ -2,7 +2,7 @@
>  #
>  # Analyze a given results directory for locktorture progress.
>  #
> -# Us

Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-13 Thread Paul E. McKenney
On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote:
 Some of the scripts encode a default /bin/sh shell. On systems which use dash 
 as
 default shell, these scripts fail as they are bash scripts. I encountered this
 while testing the sprintf() changes on a Debian system where dash is the 
 default
 shell.
 
 This commit changes all such uses to use bash explicitly.
 
 Signed-off-by: Pranith Kumar bobby.pr...@gmail.com

Queued with Josh's Reviewed-by, thank you both!

One nit: In the future, please capitalize the word following the :
in the subject line.  So, instead of:

[PATCH 1/1] rcutorture: use bash shell for all the test scripts

Write:

[PATCH 1/1] rcutorture: Use bash shell for all the test scripts

I fixed this one and will fix your later permissions patch, but again,
please use this convention in future patches.

Thanx, Paul

 ---
  tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
  tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
  tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
  12 files changed, 18 insertions(+), 18 deletions(-)
 
 diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
 b/tools/testing/selftests/rcutorture/bin/config2frag.sh
 index 9f9ffcd..4e394ef 100644
 --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
 +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
 @@ -1,5 +1,5 @@
 -#!/bin/sh
 -# Usage: sh config2frag.sh  .config  configfrag
 +#!/bin/bash
 +# Usage: bash config2frag.sh  .config  configfrag
  #
  # Converts the # CONFIG_XXX is not set to CONFIG_XXX=n so that the
  # resulting file becomes a legitimate Kconfig fragment.
 diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
 b/tools/testing/selftests/rcutorture/bin/configcheck.sh
 index d686537..6173ed5 100755
 --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
 +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
 @@ -1,5 +1,5 @@
 -#!/bin/sh
 -# Usage: sh configcheck.sh .config .config-template
 +#!/bin/bash
 +# Usage: bash configcheck.sh .config .config-template
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
 b/tools/testing/selftests/rcutorture/bin/configinit.sh
 index 9c3f3d3..d8f7418 100755
 --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
 +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
 @@ -1,6 +1,6 @@
 -#!/bin/sh
 +#!/bin/bash
  #
 -# sh configinit.sh config-spec-file [ build output dir ]
 +# bash configinit.sh config-spec-file [ build output dir ]
  #
  # Create a .config file from the spec file.  Run from the kernel source tree.
  # Exits with 0 if all went well, with 1 if all went well but the config
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 index 7c1e56b..e4bfb91 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 @@ -2,7 +2,7 @@
  #
  # Build a kvm-ready Linux kernel from the tree in the current directory.
  #
 -# Usage: sh kvm-build.sh config-template build-dir more-configs
 +# Usage: bash kvm-build.sh config-template build-dir more-configs
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 index 7f1ff1a..30cbb63 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 @@ -2,7 +2,7 @@
  #
  # Analyze a given results directory for locktorture progress.
  #
 -# Usage: sh kvm-recheck-lock.sh resdir
 +# Usage: bash kvm-recheck-lock.sh resdir
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
 index 307c4b9..6e94a5e 100755

Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread Pranith Kumar
On Fri, Jul 11, 2014 at 7:23 PM,   wrote:
> On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote:
>> Some of the scripts encode a default /bin/sh shell. On systems which use 
>> dash as
>> default shell, these scripts fail as they are bash scripts. I encountered 
>> this
>> while testing the sprintf() changes on a Debian system where dash is the 
>> default
>> shell.
>>
>> This commit changes all such uses to use bash explicitly.
>
> Good catch.
>
> Since these all have #! lines, can you please set the executable bit on
> any that don't have it set (looks like just config2frag.sh and kvm.sh),
> and then change the Usage lines to drop the shell entirely and just
> invoke the program directly?

OK. I will send that as a separate patch.

>
>> Signed-off-by: Pranith Kumar 
>
> With the above changed (perhaps in a separate patch):
> Reviewed-by: Josh Triplett 
>
>>  tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
>>  tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
>>  tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
>>  tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
>>  tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
>>  tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
>>  tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
>>  tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
>>  tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
>>  tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
>>  tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
>>  tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
>>  12 files changed, 18 insertions(+), 18 deletions(-)
>>
>> diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
>> b/tools/testing/selftests/rcutorture/bin/config2frag.sh
>> index 9f9ffcd..4e394ef 100644
>> --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
>> +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
>> @@ -1,5 +1,5 @@
>> -#!/bin/sh
>> -# Usage: sh config2frag.sh < .config > configfrag
>> +#!/bin/bash
>> +# Usage: bash config2frag.sh < .config > configfrag
>>  #
>>  # Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the
>>  # resulting file becomes a legitimate Kconfig fragment.
>> diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
>> b/tools/testing/selftests/rcutorture/bin/configcheck.sh
>> index d686537..6173ed5 100755
>> --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
>> +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
>> @@ -1,5 +1,5 @@
>> -#!/bin/sh
>> -# Usage: sh configcheck.sh .config .config-template
>> +#!/bin/bash
>> +# Usage: bash configcheck.sh .config .config-template
>>  #
>>  # This program is free software; you can redistribute it and/or modify
>>  # it under the terms of the GNU General Public License as published by
>> diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
>> b/tools/testing/selftests/rcutorture/bin/configinit.sh
>> index 9c3f3d3..d8f7418 100755
>> --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
>> +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
>> @@ -1,6 +1,6 @@
>> -#!/bin/sh
>> +#!/bin/bash
>>  #
>> -# sh configinit.sh config-spec-file [ build output dir ]
>> +# bash configinit.sh config-spec-file [ build output dir ]
>>  #
>>  # Create a .config file from the spec file.  Run from the kernel source 
>> tree.
>>  # Exits with 0 if all went well, with 1 if all went well but the config
>> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
>> b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
>> index 7c1e56b..e4bfb91 100755
>> --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
>> +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
>> @@ -2,7 +2,7 @@
>>  #
>>  # Build a kvm-ready Linux kernel from the tree in the current directory.
>>  #
>> -# Usage: sh kvm-build.sh config-template build-dir more-configs
>> +# Usage: bash kvm-build.sh config-template build-dir more-configs
>>  #
>>  # This program is free software; you can redistribute it and/or modify
>>  # it under the terms of the GNU General Public License as published by
>> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
>> b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
>> index 7f1ff1a..30cbb63 100755
>> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
>> +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
>> @@ -2,7 +2,7 @@
>>  #
>>  # Analyze a given results directory for locktorture progress.
>>  #
>> -# Usage: sh kvm-recheck-lock.sh resdir
>> +# Usage: bash kvm-recheck-lock.sh resdir
>>  #
>>  # This program is free software; you can redistribute it and/or modify
>>  # it under the terms of the GNU General Public License as published by
>> diff --git 

Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread josh
On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote:
> Some of the scripts encode a default /bin/sh shell. On systems which use dash 
> as
> default shell, these scripts fail as they are bash scripts. I encountered this
> while testing the sprintf() changes on a Debian system where dash is the 
> default
> shell.
> 
> This commit changes all such uses to use bash explicitly.

Good catch.

Since these all have #! lines, can you please set the executable bit on
any that don't have it set (looks like just config2frag.sh and kvm.sh),
and then change the Usage lines to drop the shell entirely and just
invoke the program directly?

> Signed-off-by: Pranith Kumar 

With the above changed (perhaps in a separate patch):
Reviewed-by: Josh Triplett 

>  tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
>  tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
>  tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
>  tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
>  tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
>  tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
>  tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
>  tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
>  12 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
> b/tools/testing/selftests/rcutorture/bin/config2frag.sh
> index 9f9ffcd..4e394ef 100644
> --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
> +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
> @@ -1,5 +1,5 @@
> -#!/bin/sh
> -# Usage: sh config2frag.sh < .config > configfrag
> +#!/bin/bash
> +# Usage: bash config2frag.sh < .config > configfrag
>  #
>  # Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the
>  # resulting file becomes a legitimate Kconfig fragment.
> diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
> b/tools/testing/selftests/rcutorture/bin/configcheck.sh
> index d686537..6173ed5 100755
> --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
> +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
> @@ -1,5 +1,5 @@
> -#!/bin/sh
> -# Usage: sh configcheck.sh .config .config-template
> +#!/bin/bash
> +# Usage: bash configcheck.sh .config .config-template
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
> b/tools/testing/selftests/rcutorture/bin/configinit.sh
> index 9c3f3d3..d8f7418 100755
> --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
> +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
> @@ -1,6 +1,6 @@
> -#!/bin/sh
> +#!/bin/bash
>  #
> -# sh configinit.sh config-spec-file [ build output dir ]
> +# bash configinit.sh config-spec-file [ build output dir ]
>  #
>  # Create a .config file from the spec file.  Run from the kernel source tree.
>  # Exits with 0 if all went well, with 1 if all went well but the config
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
> b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> index 7c1e56b..e4bfb91 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
> @@ -2,7 +2,7 @@
>  #
>  # Build a kvm-ready Linux kernel from the tree in the current directory.
>  #
> -# Usage: sh kvm-build.sh config-template build-dir more-configs
> +# Usage: bash kvm-build.sh config-template build-dir more-configs
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
> b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> index 7f1ff1a..30cbb63 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
> @@ -2,7 +2,7 @@
>  #
>  # Analyze a given results directory for locktorture progress.
>  #
> -# Usage: sh kvm-recheck-lock.sh resdir
> +# Usage: bash kvm-recheck-lock.sh resdir
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh 
> b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> index 307c4b9..6e94a5e 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
> +++ 

[PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread Pranith Kumar
Some of the scripts encode a default /bin/sh shell. On systems which use dash as
default shell, these scripts fail as they are bash scripts. I encountered this
while testing the sprintf() changes on a Debian system where dash is the default
shell.

This commit changes all such uses to use bash explicitly.

Signed-off-by: Pranith Kumar 
---
 tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
 tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
 tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
 tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
 tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
 tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
 tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
 12 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
b/tools/testing/selftests/rcutorture/bin/config2frag.sh
index 9f9ffcd..4e394ef 100644
--- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
+++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Usage: sh config2frag.sh < .config > configfrag
+#!/bin/bash
+# Usage: bash config2frag.sh < .config > configfrag
 #
 # Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the
 # resulting file becomes a legitimate Kconfig fragment.
diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
b/tools/testing/selftests/rcutorture/bin/configcheck.sh
index d686537..6173ed5 100755
--- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Usage: sh configcheck.sh .config .config-template
+#!/bin/bash
+# Usage: bash configcheck.sh .config .config-template
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
b/tools/testing/selftests/rcutorture/bin/configinit.sh
index 9c3f3d3..d8f7418 100755
--- a/tools/testing/selftests/rcutorture/bin/configinit.sh
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 #
-# sh configinit.sh config-spec-file [ build output dir ]
+# bash configinit.sh config-spec-file [ build output dir ]
 #
 # Create a .config file from the spec file.  Run from the kernel source tree.
 # Exits with 0 if all went well, with 1 if all went well but the config
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 7c1e56b..e4bfb91 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -2,7 +2,7 @@
 #
 # Build a kvm-ready Linux kernel from the tree in the current directory.
 #
-# Usage: sh kvm-build.sh config-template build-dir more-configs
+# Usage: bash kvm-build.sh config-template build-dir more-configs
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
index 7f1ff1a..30cbb63 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
@@ -2,7 +2,7 @@
 #
 # Analyze a given results directory for locktorture progress.
 #
-# Usage: sh kvm-recheck-lock.sh resdir
+# Usage: bash kvm-recheck-lock.sh resdir
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index 307c4b9..6e94a5e 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -2,7 +2,7 @@
 #
 # Analyze a given results directory for rcutorture progress.
 #
-# Usage: sh kvm-recheck-rcu.sh resdir
+# Usage: bash kvm-recheck-rcu.sh resdir
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index 3f6c9b7..3482b3f 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ 

[PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread Pranith Kumar
Some of the scripts encode a default /bin/sh shell. On systems which use dash as
default shell, these scripts fail as they are bash scripts. I encountered this
while testing the sprintf() changes on a Debian system where dash is the default
shell.

This commit changes all such uses to use bash explicitly.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
 tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
 tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
 tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
 tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
 tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
 tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
 tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
 12 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
b/tools/testing/selftests/rcutorture/bin/config2frag.sh
index 9f9ffcd..4e394ef 100644
--- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
+++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Usage: sh config2frag.sh  .config  configfrag
+#!/bin/bash
+# Usage: bash config2frag.sh  .config  configfrag
 #
 # Converts the # CONFIG_XXX is not set to CONFIG_XXX=n so that the
 # resulting file becomes a legitimate Kconfig fragment.
diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
b/tools/testing/selftests/rcutorture/bin/configcheck.sh
index d686537..6173ed5 100755
--- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Usage: sh configcheck.sh .config .config-template
+#!/bin/bash
+# Usage: bash configcheck.sh .config .config-template
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
b/tools/testing/selftests/rcutorture/bin/configinit.sh
index 9c3f3d3..d8f7418 100755
--- a/tools/testing/selftests/rcutorture/bin/configinit.sh
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 #
-# sh configinit.sh config-spec-file [ build output dir ]
+# bash configinit.sh config-spec-file [ build output dir ]
 #
 # Create a .config file from the spec file.  Run from the kernel source tree.
 # Exits with 0 if all went well, with 1 if all went well but the config
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 7c1e56b..e4bfb91 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -2,7 +2,7 @@
 #
 # Build a kvm-ready Linux kernel from the tree in the current directory.
 #
-# Usage: sh kvm-build.sh config-template build-dir more-configs
+# Usage: bash kvm-build.sh config-template build-dir more-configs
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
index 7f1ff1a..30cbb63 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
@@ -2,7 +2,7 @@
 #
 # Analyze a given results directory for locktorture progress.
 #
-# Usage: sh kvm-recheck-lock.sh resdir
+# Usage: bash kvm-recheck-lock.sh resdir
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index 307c4b9..6e94a5e 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -2,7 +2,7 @@
 #
 # Analyze a given results directory for rcutorture progress.
 #
-# Usage: sh kvm-recheck-rcu.sh resdir
+# Usage: bash kvm-recheck-rcu.sh resdir
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh 
b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index 3f6c9b7..3482b3f 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ 

Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread josh
On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote:
 Some of the scripts encode a default /bin/sh shell. On systems which use dash 
 as
 default shell, these scripts fail as they are bash scripts. I encountered this
 while testing the sprintf() changes on a Debian system where dash is the 
 default
 shell.
 
 This commit changes all such uses to use bash explicitly.

Good catch.

Since these all have #! lines, can you please set the executable bit on
any that don't have it set (looks like just config2frag.sh and kvm.sh),
and then change the Usage lines to drop the shell entirely and just
invoke the program directly?

 Signed-off-by: Pranith Kumar bobby.pr...@gmail.com

With the above changed (perhaps in a separate patch):
Reviewed-by: Josh Triplett j...@joshtriplett.org

  tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
  tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
  tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
  12 files changed, 18 insertions(+), 18 deletions(-)
 
 diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
 b/tools/testing/selftests/rcutorture/bin/config2frag.sh
 index 9f9ffcd..4e394ef 100644
 --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
 +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
 @@ -1,5 +1,5 @@
 -#!/bin/sh
 -# Usage: sh config2frag.sh  .config  configfrag
 +#!/bin/bash
 +# Usage: bash config2frag.sh  .config  configfrag
  #
  # Converts the # CONFIG_XXX is not set to CONFIG_XXX=n so that the
  # resulting file becomes a legitimate Kconfig fragment.
 diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
 b/tools/testing/selftests/rcutorture/bin/configcheck.sh
 index d686537..6173ed5 100755
 --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
 +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
 @@ -1,5 +1,5 @@
 -#!/bin/sh
 -# Usage: sh configcheck.sh .config .config-template
 +#!/bin/bash
 +# Usage: bash configcheck.sh .config .config-template
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
 b/tools/testing/selftests/rcutorture/bin/configinit.sh
 index 9c3f3d3..d8f7418 100755
 --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
 +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
 @@ -1,6 +1,6 @@
 -#!/bin/sh
 +#!/bin/bash
  #
 -# sh configinit.sh config-spec-file [ build output dir ]
 +# bash configinit.sh config-spec-file [ build output dir ]
  #
  # Create a .config file from the spec file.  Run from the kernel source tree.
  # Exits with 0 if all went well, with 1 if all went well but the config
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 index 7c1e56b..e4bfb91 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 @@ -2,7 +2,7 @@
  #
  # Build a kvm-ready Linux kernel from the tree in the current directory.
  #
 -# Usage: sh kvm-build.sh config-template build-dir more-configs
 +# Usage: bash kvm-build.sh config-template build-dir more-configs
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 index 7f1ff1a..30cbb63 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 @@ -2,7 +2,7 @@
  #
  # Analyze a given results directory for locktorture progress.
  #
 -# Usage: sh kvm-recheck-lock.sh resdir
 +# Usage: bash kvm-recheck-lock.sh resdir
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
 index 307c4b9..6e94a5e 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
 @@ -2,7 

Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread Pranith Kumar
On Fri, Jul 11, 2014 at 7:23 PM,  j...@joshtriplett.org wrote:
 On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote:
 Some of the scripts encode a default /bin/sh shell. On systems which use 
 dash as
 default shell, these scripts fail as they are bash scripts. I encountered 
 this
 while testing the sprintf() changes on a Debian system where dash is the 
 default
 shell.

 This commit changes all such uses to use bash explicitly.

 Good catch.

 Since these all have #! lines, can you please set the executable bit on
 any that don't have it set (looks like just config2frag.sh and kvm.sh),
 and then change the Usage lines to drop the shell entirely and just
 invoke the program directly?

OK. I will send that as a separate patch.


 Signed-off-by: Pranith Kumar bobby.pr...@gmail.com

 With the above changed (perhaps in a separate patch):
 Reviewed-by: Josh Triplett j...@joshtriplett.org

  tools/testing/selftests/rcutorture/bin/config2frag.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/configcheck.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/configinit.sh   | 4 ++--
  tools/testing/selftests/rcutorture/bin/kvm-build.sh| 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-recheck.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh   | 2 +-
  tools/testing/selftests/rcutorture/bin/kvm.sh  | 2 +-
  tools/testing/selftests/rcutorture/bin/parse-build.sh  | 4 ++--
  tools/testing/selftests/rcutorture/bin/parse-console.sh| 4 ++--
  tools/testing/selftests/rcutorture/bin/parse-torture.sh| 4 ++--
  12 files changed, 18 insertions(+), 18 deletions(-)

 diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh 
 b/tools/testing/selftests/rcutorture/bin/config2frag.sh
 index 9f9ffcd..4e394ef 100644
 --- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
 +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
 @@ -1,5 +1,5 @@
 -#!/bin/sh
 -# Usage: sh config2frag.sh  .config  configfrag
 +#!/bin/bash
 +# Usage: bash config2frag.sh  .config  configfrag
  #
  # Converts the # CONFIG_XXX is not set to CONFIG_XXX=n so that the
  # resulting file becomes a legitimate Kconfig fragment.
 diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh 
 b/tools/testing/selftests/rcutorture/bin/configcheck.sh
 index d686537..6173ed5 100755
 --- a/tools/testing/selftests/rcutorture/bin/configcheck.sh
 +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
 @@ -1,5 +1,5 @@
 -#!/bin/sh
 -# Usage: sh configcheck.sh .config .config-template
 +#!/bin/bash
 +# Usage: bash configcheck.sh .config .config-template
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh 
 b/tools/testing/selftests/rcutorture/bin/configinit.sh
 index 9c3f3d3..d8f7418 100755
 --- a/tools/testing/selftests/rcutorture/bin/configinit.sh
 +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
 @@ -1,6 +1,6 @@
 -#!/bin/sh
 +#!/bin/bash
  #
 -# sh configinit.sh config-spec-file [ build output dir ]
 +# bash configinit.sh config-spec-file [ build output dir ]
  #
  # Create a .config file from the spec file.  Run from the kernel source 
 tree.
  # Exits with 0 if all went well, with 1 if all went well but the config
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 index 7c1e56b..e4bfb91 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
 @@ -2,7 +2,7 @@
  #
  # Build a kvm-ready Linux kernel from the tree in the current directory.
  #
 -# Usage: sh kvm-build.sh config-template build-dir more-configs
 +# Usage: bash kvm-build.sh config-template build-dir more-configs
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 index 7f1ff1a..30cbb63 100755
 --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
 @@ -2,7 +2,7 @@
  #
  # Analyze a given results directory for locktorture progress.
  #
 -# Usage: sh kvm-recheck-lock.sh resdir
 +# Usage: bash kvm-recheck-lock.sh resdir
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
 diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh 
 b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
 index 307c4b9..6e94a5e 100755
 ---