diff mbox

[v3,6/9] scripts/runtime: skip tests that cannot run

Message ID 1460753571-20732-7-git-send-email-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář April 15, 2016, 8:52 p.m. UTC
A case where QEMU won't run the kernel should be considered as skipped.
Hyper-V tests used to FAIL on old QEMUs.  The infamous QEMU=/dev/null
FAIL streak is covered too.

Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
---
 scripts/runtime.bash | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andrew Jones April 19, 2016, 7:01 a.m. UTC | #1
On Fri, Apr 15, 2016 at 10:52:48PM +0200, Radim Kr?má? wrote:
> A case where QEMU won't run the kernel should be considered as skipped.
> Hyper-V tests used to FAIL on old QEMUs.  The infamous QEMU=/dev/null
> FAIL streak is covered too.
> 
> Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
> ---
>  scripts/runtime.bash | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> index ed073721216c..4f29a59307f3 100644
> --- a/scripts/runtime.bash
> +++ b/scripts/runtime.bash
> @@ -39,6 +39,12 @@ function run()
>          fi
>      done
>  
> +    cmdline="TIMEOUT=$timeout ACCEL=$accel $RUNTIME_arch_run /dev/null -smp $smp $opts"
> +    eval $cmdline |& grep -q "could not load kernel" || {
> +        echo "skip $1 (QEMU won't run)"
> +        return 2
> +    }

This doesn't seem to work for arm; qemu just hangs with a /dev/null
kernel. Also, this will echo an extra command line per test to the
test.log.

$(TEST_DIR)/run scripts already do some qemu testing to make sure their
machine model and testdevs are available. If not, they return 2. Isn't
that good enough? Don't we just need to add a '$ret = 2' condition in
run()?

> +
>      cmdline="TESTNAME=$testname TIMEOUT=$timeout ACCEL=$accel $RUNTIME_arch_run $kernel -smp $smp $opts"
>      if [ "$verbose" = "yes" ]; then
>          echo $cmdline
> -- 
> 2.8.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Radim Krčmář April 19, 2016, 12:01 p.m. UTC | #2
2016-04-19 09:01+0200, Andrew Jones:
> On Fri, Apr 15, 2016 at 10:52:48PM +0200, Radim Kr?má? wrote:
> > A case where QEMU won't run the kernel should be considered as skipped.
> > Hyper-V tests used to FAIL on old QEMUs.  The infamous QEMU=/dev/null
> > FAIL streak is covered too.
> > 
> > Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
> > ---
> >  scripts/runtime.bash | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> > index ed073721216c..4f29a59307f3 100644
> > --- a/scripts/runtime.bash
> > +++ b/scripts/runtime.bash
> > @@ -39,6 +39,12 @@ function run()
> >          fi
> >      done
> >  
> > +    cmdline="TIMEOUT=$timeout ACCEL=$accel $RUNTIME_arch_run /dev/null -smp $smp $opts"
> > +    eval $cmdline |& grep -q "could not load kernel" || {
> > +        echo "skip $1 (QEMU won't run)"
> > +        return 2
> > +    }
> 
> This doesn't seem to work for arm; qemu just hangs with a /dev/null
> kernel.

Thanks, I'll be using _NO_FILE_4Uhere_, like scripts/runtime does.

>         Also, this will echo an extra command line per test to the
> test.log.

Changing the logging mechanism in [8/9] got rid of it, but I forgot to
mention it.  Patches need a bit of reshufling to make it logical ...

> $(TEST_DIR)/run scripts already do some qemu testing to make sure their
> machine model and testdevs are available. If not, they return 2. Isn't
> that good enough?

QEMU can fail, because we appended something that isn't supported, like
hyperv tests do.  Then the test is a FAIL.

>                   Don't we just need to add a '$ret = 2' condition in
> run()?

What if we changed that return value to 77?  The test wasn't really run.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index ed073721216c..4f29a59307f3 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -39,6 +39,12 @@  function run()
         fi
     done
 
+    cmdline="TIMEOUT=$timeout ACCEL=$accel $RUNTIME_arch_run /dev/null -smp $smp $opts"
+    eval $cmdline |& grep -q "could not load kernel" || {
+        echo "skip $1 (QEMU won't run)"
+        return 2
+    }
+
     cmdline="TESTNAME=$testname TIMEOUT=$timeout ACCEL=$accel $RUNTIME_arch_run $kernel -smp $smp $opts"
     if [ "$verbose" = "yes" ]; then
         echo $cmdline