[v2] app/test: replace TEST_SKIPPED with -ENOTSUP
Checks
Commit Message
Return -ENOTSUP for unsupported tests
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
---
app/test/test_cryptodev_asym.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Comments
On Tue, Apr 09, 2019 at 05:03:39PM +0530, Ayuj Verma wrote:
> Return -ENOTSUP for unsupported tests
>
I disagree with this, since TEST_SKIPPED is the correct return value for
unsupported test conditions IMHO. If part of the current infrastructure
doesn't support that return value, I think the infrastructure should be
updated.
Ref: http://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors
/Bruce
Hi Ayuj,
> -----Original Message-----
> From: Ayuj Verma [mailto:ayverma@marvell.com]
> Sent: Tuesday, April 9, 2019 12:34 PM
> To: akhil.goyal@nxp.com; Trahe, Fiona <fiona.trahe@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: shallyv@marvell.com; ssahu@marvell.com; kkotamarthy@marvell.com; adesai@marvell.com;
> dev@dpdk.org; Ayuj Verma <ayverma@marvell.com>
> Subject: [PATCH v2] app/test: replace TEST_SKIPPED with -ENOTSUP
>
> Return -ENOTSUP for unsupported tests
>
> Signed-off-by: Ayuj Verma <ayverma@marvell.com>
> Signed-off-by: Shally Verma <shallyv@marvell.com>
> ---
> app/test/test_cryptodev_asym.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
> index d2efce9..feed3a8 100644
> --- a/app/test/test_cryptodev_asym.c
> +++ b/app/test/test_cryptodev_asym.c
> @@ -352,7 +352,7 @@ struct test_cases_array {
> RTE_LOG(INFO, USER1,
> "Device doesn't support sign op with "
> "exponent key type. Test Skipped\n");
> - return TEST_SKIPPED;
> + return -ENOTSUP;
> }
>
> sess = rte_cryptodev_asym_session_create(sess_mpool);
> @@ -498,7 +498,7 @@ struct test_cases_array {
> RTE_LOG(INFO, USER1,
> "Device doesn't support sign op with "
> "exponent key type. Test Skipped\n");
> - return TEST_SKIPPED;
> + return -ENOTSUP;
> }
>
> sess = rte_cryptodev_asym_session_create(sess_mpool);
> @@ -1261,7 +1261,7 @@ static inline void print_asym_capa(
> &modinv_xform.xform_type, "modinv") < 0) {
> RTE_LOG(ERR, USER1,
> "Invalid ASYNC algorithm specified\n");
> - return -1;
> + return -ENOTSUP;
[Fiona] this looks more like a test code bug rather than an indication that the device doesn't support modinv. SO should still return -1.
Also - while you're updating, can you please fix the typo in the trace - ASYNC should be ASYMM
> }
>
> cap_idx.type = modinv_xform.xform_type;
> @@ -1273,7 +1273,7 @@ static inline void print_asym_capa(
> modinv_xform.modinv.modulus.length)) {
> RTE_LOG(ERR, USER1,
> "Invalid MODULOUS length specified\n");
> - return -1;
> + return -ENOTSUP;
[Fiona] please update the trace to match the return, e.g. something like "modulus length %len not supported by this device"
> }
>
> sess = rte_cryptodev_asym_session_create(sess_mpool);
> @@ -1380,7 +1380,7 @@ static inline void print_asym_capa(
> < 0) {
> RTE_LOG(ERR, USER1,
> "Invalid ASYNC algorithm specified\n");
> - return -1;
> + return -ENOTSUP;
> }
[Fiona] same as above, i.e. code bug. And typo in trace.
>
> /* check for modlen capability */
> @@ -1391,7 +1391,7 @@ static inline void print_asym_capa(
> capability, modex_xform.modex.modulus.length)) {
> RTE_LOG(ERR, USER1,
> "Invalid MODULOUS length specified\n");
> - return -1;
> + return -ENOTSUP;
[Fiona] same as above. Fix trace.
> }
>
> /* generate crypto op data structure */
> --
> 1.8.3.1
Hi Bruce,
Have you gone through patch-set v1<http://mails.dpdk.org/archives/dev/2019-April/128407.html>
What's your opinion on them.
Thanks and regards
Ayuj Verma
On Wed, Apr 10, 2019 at 12:33:23PM +0000, Ayuj Verma wrote:
> Hi Bruce,
>
> Have you gone through patch-set [1]v1
>
> What's your opinion on them.
>
> Thanks and regards
>
> Ayuj Verma
Looked at http://mails.dpdk.org/archives/dev/2019-April/128407.html
I like the idea of tracking the skips, and I suggest you go further and
actually track the -ENOTSUP errors as skips too. I don't see any change in
the reported output in that patch though - how are the skips reported if at
all?
/Bruce
Hi Fiona,
Please see inline.
Thanks and regards
Ayuj Verma
Hi Ayuj
From: Ayuj Verma [mailto:ayverma@marvell.com]
Sent: Friday, April 12, 2019 8:08 AM
To: Trahe, Fiona <fiona.trahe@intel.com>; akhil.goyal@nxp.com; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
Cc: Shally Verma <shallyv@marvell.com>; Sunila Sahu <ssahu@marvell.com>; Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>; Arvind Desai <adesai@marvell.com>; dev@dpdk.org
Subject: Re: [PATCH v2] app/test: replace TEST_SKIPPED with -ENOTSUP
Hi Fiona,
Please see inline.
Thanks and regards
Ayuj Verma
@@ -352,7 +352,7 @@ struct test_cases_array {
RTE_LOG(INFO, USER1,
"Device doesn't support sign op with "
"exponent key type. Test Skipped\n");
- return TEST_SKIPPED;
+ return -ENOTSUP;
}
sess = rte_cryptodev_asym_session_create(sess_mpool);
@@ -498,7 +498,7 @@ struct test_cases_array {
RTE_LOG(INFO, USER1,
"Device doesn't support sign op with "
"exponent key type. Test Skipped\n");
- return TEST_SKIPPED;
+ return -ENOTSUP;
}
sess = rte_cryptodev_asym_session_create(sess_mpool);
@@ -1261,7 +1261,7 @@ static inline void print_asym_capa(
&modinv_xform.xform_type, "modinv") < 0) {
RTE_LOG(ERR, USER1,
"Invalid ASYNC algorithm specified\n");
- return -1;
+ return -ENOTSUP;
}
cap_idx.type = modinv_xform.xform_type;
@@ -1273,7 +1273,7 @@ static inline void print_asym_capa(
modinv_xform.modinv.modulus.length)) {
RTE_LOG(ERR, USER1,
"Invalid MODULOUS length specified\n");
- return -1;
+ return -ENOTSUP;
}
sess = rte_cryptodev_asym_session_create(sess_mpool);
@@ -1380,7 +1380,7 @@ static inline void print_asym_capa(
< 0) {
RTE_LOG(ERR, USER1,
"Invalid ASYNC algorithm specified\n");
- return -1;
+ return -ENOTSUP;
}
/* check for modlen capability */
@@ -1391,7 +1391,7 @@ static inline void print_asym_capa(
capability, modex_xform.modex.modulus.length)) {
RTE_LOG(ERR, USER1,
"Invalid MODULOUS length specified\n");
- return -1;
+ return -ENOTSUP;
}
/* generate crypto op data structure */