[Qemu-devel] [PATCH v2] tests/prom-env: Ease time-out problems on slow hosts

Thomas Huth posted 1 patch 7 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1486739699-1076-1-git-send-email-thuth@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
tests/prom-env-test.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
[Qemu-devel] [PATCH v2] tests/prom-env: Ease time-out problems on slow hosts
Posted by Thomas Huth 7 years, 2 months ago
Peter Maydell recently ran into time-out problems with the
prom-env test on a rather slow ARM board. To tackle this issue,
we can speed up the test by running QEMU with "-nodefaults" for
the pseries machine, so that SLOF has less devices to scan during
boot, and by using the "nvramrc" environment variable instead of
"boot-command", since this variable is evaluated earlier in the
boot process.
And to be really sure that we do not face such time out problems
again, let's also increase the time out value from 100s to 120s
instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 v2: Use "-nodefaults" only for the pseries machine, since the
     sparc machines have a built-in ethernet controller and spill
     out a warning otherwise.

 tests/prom-env-test.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tests/prom-env-test.c b/tests/prom-env-test.c
index 0ba6f48..bd33bc3 100644
--- a/tests/prom-env-test.c
+++ b/tests/prom-env-test.c
@@ -30,8 +30,8 @@ static void check_guest_memory(void)
     uint32_t signature;
     int i;
 
-    /* Poll until code has run and modified memory. Wait at most 30 seconds */
-    for (i = 0; i < 10000; ++i) {
+    /* Poll until code has run and modified memory. Wait at most 120 seconds */
+    for (i = 0; i < 12000; ++i) {
         signature = readl(ADDRESS);
         if (signature == MAGIC) {
             break;
@@ -45,9 +45,14 @@ static void check_guest_memory(void)
 static void test_machine(const void *machine)
 {
     char *args;
+    const char *extra_args;
 
-    args = g_strdup_printf("-M %s,accel=tcg -prom-env 'boot-command=%x %x l!'",
-                           (const char *)machine, MAGIC, ADDRESS);
+    /* The pseries firmware boots much faster without the default devices */
+    extra_args = strcmp(machine, "pseries") == 0 ? "-nodefaults" : "";
+
+    args = g_strdup_printf("-M %s,accel=tcg %s -prom-env 'use-nvramrc?=true' "
+                           "-prom-env 'nvramrc=%x %x l!' ",
+                           (const char *)machine, extra_args, MAGIC, ADDRESS);
 
     qtest_start(args);
     check_guest_memory();
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH v2] tests/prom-env: Ease time-out problems on slow hosts
Posted by Peter Maydell 7 years, 2 months ago
On 10 February 2017 at 15:14, Thomas Huth <thuth@redhat.com> wrote:
> Peter Maydell recently ran into time-out problems with the
> prom-env test on a rather slow ARM board. To tackle this issue,
> we can speed up the test by running QEMU with "-nodefaults" for
> the pseries machine, so that SLOF has less devices to scan during
> boot, and by using the "nvramrc" environment variable instead of
> "boot-command", since this variable is evaluated earlier in the
> boot process.
> And to be really sure that we do not face such time out problems
> again, let's also increase the time out value from 100s to 120s
> instead.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  v2: Use "-nodefaults" only for the pseries machine, since the
>      sparc machines have a built-in ethernet controller and spill
>      out a warning otherwise.
>
>  tests/prom-env-test.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)

Applied to master, thanks.

-- PMM