fix return value for skipped tests
PATCH v3 1/1 fix return value for skipped tests
Currently some tests return TEST_SKIPPED/-1 when tests or params are not supported for particular PMD because of which tests adds to FAILED test counter in place of Skipped/Unsupported counter.
Since unsupported test is not a failure case, replace return value TEST_SKIPPED/-1 with -ENOTSUP
Changes in v3:
- retain '-1' for app error.
- add NULL check for rte_cryptodev_asym_capability_get()
- Typo correction
Changes in v2:
- Replace TEST_SKIPPED/-1 with -ENOTSUP
Ayuj Verma (1):
app/test: replace TEST_SKIPPED with -ENOTSUP
app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v3 1/1 app/test: replace TEST_SKIPPED with -ENOTSUP
- Return -ENOTSUP for unsupported tests
- add NULL check for rte_cryptodev_asym_capability_get()
- Typo correction
--- app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-)
app/test/test_cryptodev_asym.c +32 -13
@@ -119,6 +119,18 @@ struct test_cases_array {int status =TEST_SUCCESS ; + xform_tc.next =NULL ; + xform_tc.xform_type = data_tc->modex.xform_type; + + cap_idx.type = xform_tc.xform_type; + capability =rte_cryptodev_asym_capability_get (dev_id, &cap_idx); + +if (capability ==NULL ) { +RTE_LOG (INFO ,USER1 , +"Device doesn't support MODEX. Test Skipped\n" ); +return -ENOTSUP ; + } +/* Generate crypto op data structure */ op =rte_crypto_op_alloc (ts_params->op_mpool,RTE_CRYPTO_OP_TYPE_ASYMMETRIC );
@@ -133,11 +145,6 @@ struct test_cases_array { } asym_op = op->asym; - xform_tc.next =NULL ; - xform_tc.xform_type = data_tc->modex.xform_type; - - cap_idx.type = xform_tc.xform_type; - capability =rte_cryptodev_asym_capability_get (dev_id, &cap_idx);switch (xform_tc.xform_type) {case RTE_CRYPTO_ASYM_XFORM_MODEX :
@@ -352,7 +359,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 +505,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);
@@ -1260,7 +1267,7 @@ static inline void print_asym_capa(if (rte_cryptodev_asym_get_xform_enum ( &modinv_xform.xform_type,"modinv" ) <0 ) {RTE_LOG (ERR ,USER1 , -"Invalid ASYNC algorithm specified\n" ); +"Invalid ASYM algorithm specified\n" );return -1 ; }
@@ -1268,12 +1275,18 @@ static inline void print_asym_capa( capability =rte_cryptodev_asym_capability_get (dev_id, &cap_idx); +if (capability ==NULL ) { +RTE_LOG (INFO ,USER1 , +"Device doesn't support MOD INV. Test Skipped\n" ); +return -ENOTSUP ; + } +if (rte_cryptodev_asym_xform_capability_check_modlen ( capability, modinv_xform.modinv.modulus.length)) {RTE_LOG (ERR ,USER1 , -"Invalid MODULOUS length specified\n" ); -return -1 ; +"Invalid MODULUS length specified\n" ); +return -ENOTSUP ; } sess =rte_cryptodev_asym_session_create (sess_mpool);
@@ -1379,7 +1392,7 @@ static inline void print_asym_capa( "modexp") < 0) {RTE_LOG (ERR ,USER1 , -"Invalid ASYNC algorithm specified\n" ); +"Invalid ASYM algorithm specified\n" );return -1 ; }
@@ -1387,11 +1400,17 @@ static inline void print_asym_capa( cap_idx.type = modex_xform.xform_type; capability =rte_cryptodev_asym_capability_get (dev_id, &cap_idx); +if (capability ==NULL ) { +RTE_LOG (INFO ,USER1 , +"Device doesn't support MOD EXP. Test Skipped\n" ); +return -ENOTSUP ; + } +if (rte_cryptodev_asym_xform_capability_check_modlen ( capability, modex_xform.modex.modulus.length)) {RTE_LOG (ERR ,USER1 , -"Invalid MODULOUS length specified\n" ); -return -1 ; +"Invalid MODULUS length specified\n" ); +return -ENOTSUP ; }/* generate crypto op data structure */
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v3] app/test: replace TEST_SKIPPED with -ENOTSUP
Quoted 11 lines
-----Original Message-----
From: Ayuj Verma [mailto:[email protected]]
Sent: Wednesday, April 24, 2019 8:28 PM
To: [email protected]; Kusztal, ArkadiuszX <[email protected]>; Trahe, Fiona <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ayuj Verma <[email protected]>
Subject: [PATCH v3] app/test: replaceTEST_SKIPPEDwith-ENOTSUP
Quoted 6 lines
- Return
-ENOTSUPfor unsupported tests
- add NULL check forrte_cryptodev_asym_capability_get()
- Typo correctionSigned-off-by Ayuj Verma <[email protected]>Signed-off-by Shally Verma <[email protected]>
Re: [dpdk-dev] [PATCH v3] app/test: replace TEST_SKIPPED with -ENOTSUP
In reply to Ayuj Verma24/04/2019 21:28, Ayuj Verma:
Quoted 1 line
- Return
-ENOTSUPfor unsupported tests
Sorry if you already explained it before,
please could you add the reason for this change
in the commit log?
Re: [dpdk-dev] [PATCH v3] app/test: replace TEST_SKIPPED with -ENOTSUP
Hi Ayuj,
Could you please address Thomas's comment? We need to close RC4 today, if it is not getting closed today, we may need to defer it for next release.
Thanks,
Akhil
Quoted 18 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Sunday, May 5, 2019 2:25 AM
To: Ayuj Verma <[email protected]>
Cc: [email protected]; Akhil Goyal <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] app/test: replaceTEST_SKIPPEDwith - ENOTSUP24/04/2019 21:28, Ayuj Verma:
Quoted 1 line
- Return
-ENOTSUPfor unsupported testsSorry if you already explained it before, please could you add the reason for this change in the commit log?
Re: [dpdk-dev] [PATCH v3] app/test: replace TEST_SKIPPED with -ENOTSUP
Hi Akhil,
Sorry for delay.
I have sent v4 for this.
Thanks for the heads up.
Regards
Ayuj Verma
________________________________
From: Akhil Goyal <[email protected]>
Sent: 09 May 2019 14:23:25
To: Ayuj Verma
Cc: [email protected]; [email protected]; [email protected]; Shally Verma; Sunila Sahu; Kanaka Durga Kotamarthy; Arvind Desai; [email protected]; Thomas Monjalon
Subject: RE: [dpdk-dev] [PATCH v3] app/test: replace TEST_SKIPPED with -ENOTSUP
Hi Ayuj,
Could you please address Thomas's comment? We need to close RC4 today, if it is not getting closed today, we may need to defer it for next release.
Thanks,
Akhil
Quoted 18 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Sunday, May 5, 2019 2:25 AM
To: Ayuj Verma <[email protected]>
Cc: [email protected]; Akhil Goyal <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] app/test: replaceTEST_SKIPPEDwith - ENOTSUP24/04/2019 21:28, Ayuj Verma:
Quoted 1 line
- Return
-ENOTSUPfor unsupported testsSorry if you already explained it before, please could you add the reason for this change in the commit log?