diff mbox series

tools/tests: let test-xenstore exit with non-0 status in case of error

Message ID 20240502092213.15163-1-jgross@suse.com (mailing list archive)
State New
Headers show
Series tools/tests: let test-xenstore exit with non-0 status in case of error | expand

Commit Message

Juergen Gross May 2, 2024, 9:22 a.m. UTC
In case a test is failing in test-xenstore, let the tool exit with an
exit status other than 0.

Fix a typo in an error message.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Fixes: 3afc5e4a5b75 ("tools/tests: add xenstore testing framework")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/tests/xenstore/test-xenstore.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Andrew Cooper May 2, 2024, 9:26 a.m. UTC | #1
On 02/05/2024 10:22 am, Juergen Gross wrote:
> In case a test is failing in test-xenstore, let the tool exit with an
> exit status other than 0.
>
> Fix a typo in an error message.
>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Fixes: 3afc5e4a5b75 ("tools/tests: add xenstore testing framework")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Thanks.  Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> although
this could do with waiting until after we've fixed whatever else is
causing it to fail.

I'll try to find someone to work on that bug too.

~Andrew
diff mbox series

Patch

diff --git a/tools/tests/xenstore/test-xenstore.c b/tools/tests/xenstore/test-xenstore.c
index d491dac53b..d7d44cc0fa 100644
--- a/tools/tests/xenstore/test-xenstore.c
+++ b/tools/tests/xenstore/test-xenstore.c
@@ -506,14 +506,14 @@  int main(int argc, char *argv[])
         stop = time(NULL) + randtime;
         srandom((unsigned int)stop);
 
-        while ( time(NULL) < stop )
+        while ( time(NULL) < stop && !ret )
         {
             t = random() % ARRAY_SIZE(tests);
             ret = call_test(tests + t, iters, true);
         }
     }
     else
-        for ( t = 0; t < ARRAY_SIZE(tests); t++ )
+        for ( t = 0; t < ARRAY_SIZE(tests) && !ret; t++ )
         {
             if ( !test || !strcmp(test, tests[t].name) )
                 ret = call_test(tests + t, iters, false);
@@ -525,10 +525,10 @@  int main(int argc, char *argv[])
     xs_close(xsh);
 
     if ( ta_loops )
-        printf("Exhaustive transaction retries (%d) occurrred %d times.\n",
+        printf("Exhaustive transaction retries (%d) occurred %d times.\n",
                MAX_TA_LOOPS, ta_loops);
 
-    return 0;
+    return ret ? 3 : 0;
 }
 
 /*