diff mbox series

[kvm-unit-tests,2/2] runtime: Use find_word with groups

Message ID 20211112133739.103327-3-drjones@redhat.com (mailing list archive)
State New, archived
Headers show
Series Groups are separated by spaces | expand

Commit Message

Andrew Jones Nov. 12, 2021, 1:37 p.m. UTC
Groups are space separated, so we can remove the 'grep -w', which has
caused problems in the past with testnames, see b373304853a0
("scripts: Fix the check whether testname is in the only_tests list")
and use find_word.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 scripts/runtime.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marc Orr Nov. 12, 2021, 3:47 p.m. UTC | #1
On Fri, Nov 12, 2021 at 5:37 AM Andrew Jones <drjones@redhat.com> wrote:
>
> Groups are space separated, so we can remove the 'grep -w', which has
> caused problems in the past with testnames, see b373304853a0
> ("scripts: Fix the check whether testname is in the only_tests list")
> and use find_word.
>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  scripts/runtime.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> index 132389c7dd59..4deb41ca251c 100644
> --- a/scripts/runtime.bash
> +++ b/scripts/runtime.bash
> @@ -132,7 +132,7 @@ function run()
>      }
>
>      cmdline=$(get_cmdline $kernel)
> -    if grep -qw "migration" <<<$groups ; then
> +    if find_word "migration" "$groups"; then
>          cmdline="MIGRATION=yes $cmdline"
>      fi
>      if [ "$verbose" = "yes" ]; then
> --
> 2.31.1
>

Reviewed-by: Marc Orr <marcorr@google.com>
diff mbox series

Patch

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 132389c7dd59..4deb41ca251c 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -132,7 +132,7 @@  function run()
     }
 
     cmdline=$(get_cmdline $kernel)
-    if grep -qw "migration" <<<$groups ; then
+    if find_word "migration" "$groups"; then
         cmdline="MIGRATION=yes $cmdline"
     fi
     if [ "$verbose" = "yes" ]; then