All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test
@ 2021-10-15 12:14 Kevin Stefanov
  2021-10-15 12:21 ` Jan Beulich
  2021-10-15 13:16 ` Ian Jackson
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Stefanov @ 2021-10-15 12:14 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>

v2: Adhere to coding style, use E2BIG instead of 7, set ret to 0
---
 tools/tests/xenstore/test-xenstore.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/tests/xenstore/test-xenstore.c b/tools/tests/xenstore/test-xenstore.c
index d3574b3fa2..f8423e568e 100644
--- a/tools/tests/xenstore/test-xenstore.c
+++ b/tools/tests/xenstore/test-xenstore.c
@@ -110,8 +110,17 @@ static int call_test(struct test *tst, int iters, bool no_clock)
             break;
     }
 
+    /* Make E2BIG non-fatal to the test */
     if ( ret )
-        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
+    {
+	if ( ret == E2BIG )
+        {
+            printf("%-10s: Not run - argument list too long\n", tst->name);
+            ret = 0;
+        }
+        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] 4+ messages in thread

* Re: [PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test
  2021-10-15 12:14 [PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test Kevin Stefanov
@ 2021-10-15 12:21 ` Jan Beulich
  2021-10-15 13:16 ` Ian Jackson
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2021-10-15 12:21 UTC (permalink / raw)
  To: Kevin Stefanov
  Cc: Ian Jackson, Wei Liu, Juergen Gross, Julien Grall, Andrew Cooper,
	Xen-devel

On 15.10.2021 14:14, Kevin Stefanov wrote:
> --- a/tools/tests/xenstore/test-xenstore.c
> +++ b/tools/tests/xenstore/test-xenstore.c
> @@ -110,8 +110,17 @@ static int call_test(struct test *tst, int iters, bool no_clock)
>              break;
>      }
>  
> +    /* Make E2BIG non-fatal to the test */
>      if ( ret )
> -        printf("%-10s: failed (ret = %d, stage %s)\n", tst->name, ret, stage);
> +    {
> +	if ( ret == E2BIG )

Just fyi that it looks like a hard tab has slipped in here.

Jan



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

* Re: [PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test
  2021-10-15 12:14 [PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test Kevin Stefanov
  2021-10-15 12:21 ` Jan Beulich
@ 2021-10-15 13:16 ` Ian Jackson
  2021-10-15 15:07   ` Juergen Gross
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2021-10-15 13:16 UTC (permalink / raw)
  To: Kevin Stefanov
  Cc: Xen-devel, Ian Jackson, Wei Liu, Juergen Gross, Julien Grall,
	Andrew Cooper

Kevin Stefanov writes ("[PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test"):
> 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.

I realise that I am late to this, but I'm not sure I agree with the
basic principle of this change.  In general tolerating particular
errors in a test, and simply abandoning the test if they occcur, is
normally not the best approach.

Questions that come to my mind (and which aren't answered in the
commit message and probably should be) include:

Why does test-xenstore using these large numbers for its tests ?
Why would you run the tests with a quota too low for the tests ?
Might this test change not in principle miss genuine bugs ?

Ian.


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

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


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

On 15.10.21 15:16, Ian Jackson wrote:
> Kevin Stefanov writes ("[PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test"):
>> 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.
> 
> I realise that I am late to this, but I'm not sure I agree with the
> basic principle of this change.  In general tolerating particular
> errors in a test, and simply abandoning the test if they occcur, is
> normally not the best approach.
> 
> Questions that come to my mind (and which aren't answered in the
> commit message and probably should be) include:
> 
> Why does test-xenstore using these large numbers for its tests ?

For testing large data packets.

> Why would you run the tests with a quota too low for the tests ?

Good question.

> Might this test change not in principle miss genuine bugs ?

Yes, e.g. if a test returns E2BIG even if it shouldn't.

So I agree to being more cautious here.

Maybe a parameter could be added to limit the allowed data size?
Then the "large data" test could be adjusted to not send more data
than allowed (it should be noted that the node size quota is
including data, names of children, and access right entries, so
the pure node data should be selected with some spare size in
mind, e.g. 100 bytes smaller than the quota).


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] 4+ messages in thread

end of thread, other threads:[~2021-10-15 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 12:14 [PATCH v2] tools/tests: Make E2BIG non-fatal to xenstore unit test Kevin Stefanov
2021-10-15 12:21 ` Jan Beulich
2021-10-15 13:16 ` Ian Jackson
2021-10-15 15:07   ` 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.