All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/tests: Make E2BIG non-fatal to xenstore unit test
@ 2021-10-13  9:35 Kevin Stefanov
  2021-10-13  9:52 ` Juergen Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Stefanov @ 2021-10-13  9:35 UTC (permalink / raw)
  To: Xen-devel
  Cc: Kevin Stefanov, Ian Jackson, Wei Liu, Juergen Gross,
	Julien Grall, Andrew Cooper

Xenstore's unit test fails on read and write of big numbers if
quota-maxsize is set to a lower number than those test cases use.

Output a special warning instead of a failure message in such cases
and make the error non-fatal to the unit test.

Signed-off-by: Kevin Stefanov <kevin.stefanov@citrix.com>
---
CC: Ian Jackson <iwj@xenproject.org>
CC: Wei Liu <wl@xen.org>
CC: Juergen Gross <jgross@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/xenstore/test-xenstore.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/tests/xenstore/test-xenstore.c b/tools/tests/xenstore/test-xenstore.c
index d3574b3fa2..ec8c63a65d 100644
--- a/tools/tests/xenstore/test-xenstore.c
+++ b/tools/tests/xenstore/test-xenstore.c
@@ -110,8 +110,13 @@ static int call_test(struct test *tst, int iters, bool no_clock)
             break;
     }
 
-    if ( ret )
-        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
+    /* Make E2BIG non-fatal to the test */
+    if ( ret ){
+	if( ret == 7 )
+            printf("%-10s: Not run - argument list too long\n", tst->name);
+        else      
+            printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
+    }
     else if ( !no_clock )
     {
         printf("%-10s:", tst->name);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools/tests: Make E2BIG non-fatal to xenstore unit test
  2021-10-13  9:35 [PATCH] tools/tests: Make E2BIG non-fatal to xenstore unit test Kevin Stefanov
@ 2021-10-13  9:52 ` Juergen Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Juergen Gross @ 2021-10-13  9:52 UTC (permalink / raw)
  To: Kevin Stefanov, Xen-devel
  Cc: Ian Jackson, Wei Liu, Julien Grall, Andrew Cooper


[-- Attachment #1.1.1: Type: text/plain, Size: 1790 bytes --]

On 13.10.21 11:35, Kevin Stefanov wrote:
> Xenstore's unit test fails on read and write of big numbers if
> quota-maxsize is set to a lower number than those test cases use.
> 
> Output a special warning instead of a failure message in such cases
> and make the error non-fatal to the unit test.
> 
> Signed-off-by: Kevin Stefanov <kevin.stefanov@citrix.com>
> ---
> CC: Ian Jackson <iwj@xenproject.org>
> CC: Wei Liu <wl@xen.org>
> CC: Juergen Gross <jgross@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>   tools/tests/xenstore/test-xenstore.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/tests/xenstore/test-xenstore.c b/tools/tests/xenstore/test-xenstore.c
> index d3574b3fa2..ec8c63a65d 100644
> --- a/tools/tests/xenstore/test-xenstore.c
> +++ b/tools/tests/xenstore/test-xenstore.c
> @@ -110,8 +110,13 @@ static int call_test(struct test *tst, int iters, bool no_clock)
>               break;
>       }
>   
> -    if ( ret )
> -        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
> +    /* Make E2BIG non-fatal to the test */
> +    if ( ret ){
> +	if( ret == 7 )

Why not use E2BIG instead of the literal 7 here?

And please adhere to the coding style! There are some blanks missing and
the '{' wants to go into a separate line.

> +            printf("%-10s: Not run - argument list too long\n", tst->name);

Not setting ret to 0 here will result in Xenstore not being cleaned up
after the test.

> +        else
> +            printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
> +    }
>       else if ( !no_clock )
>       {
>           printf("%-10s:", tst->name);
> 


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-13  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  9:35 [PATCH] tools/tests: Make E2BIG non-fatal to xenstore unit test Kevin Stefanov
2021-10-13  9:52 ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.