[v2] app/test: replace TEST_SKIPPED with -ENOTSUP

Message ID 1554809619-21164-2-git-send-email-ayverma@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series [v2] app/test: replace TEST_SKIPPED with -ENOTSUP |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Ayuj Verma April 9, 2019, 11:33 a.m. UTC
  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

Bruce Richardson April 9, 2019, 2:55 p.m. UTC | #1
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
  
Fiona Trahe April 9, 2019, 3:17 p.m. UTC | #2
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
  
Ayuj Verma April 10, 2019, 12:33 p.m. UTC | #3
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
  
Bruce Richardson April 10, 2019, 12:48 p.m. UTC | #4
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
  
Ayuj Verma April 12, 2019, 7:08 a.m. UTC | #5
Hi Fiona,


Please see inline.


Thanks and regards

Ayuj Verma
  
Fiona Trahe April 12, 2019, 10:25 a.m. UTC | #6
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
  

Patch

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;
 	}
 
 	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 */