[dpdk-dev] [PATCH 14/14] test: skip tests when missing requirements

Honnappa Nagarahalli Honnappa.Nagarahalli at arm.com
Fri Jun 7 22:54:48 CEST 2019


> 
> Let's mark as skipped the tests when they are missing some requirements like a
> number of used cores or specific hardware availability, like compress, crypto or
> eventdev devices.
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
>  app/test/test.c                     | 24 ++++++++++++++++--------
>  app/test/test_compressdev.c         |  4 ++--
>  app/test/test_cryptodev.c           |  4 ++--
>  app/test/test_distributor.c         |  4 ++--
>  app/test/test_distributor_perf.c    |  4 ++--
>  app/test/test_event_timer_adapter.c |  5 +++--
>  app/test/test_eventdev.c            |  2 ++
>  app/test/test_func_reentrancy.c     |  6 +++---
>  app/test/test_hash_multiwriter.c    |  7 +++----
>  app/test/test_hash_readwrite.c      |  7 +++----
>  app/test/test_hash_readwrite_lf.c   |  8 ++++----
>  app/test/test_ipsec.c               |  4 ++--
>  app/test/test_mbuf.c                | 13 ++++++-------
>  app/test/test_rcu_qsbr.c            | 10 +++++-----
>  app/test/test_rcu_qsbr_perf.c       |  9 +++++----
>  app/test/test_service_cores.c       | 14 ++++++++++++++
>  app/test/test_stack.c               |  8 +++++---
>  app/test/test_timer.c               | 10 +++++-----
>  app/test/test_timer_secondary.c     | 10 ++++++----
>  19 files changed, 90 insertions(+), 63 deletions(-)
> 

<snip>

> 
>  	RTE_LCORE_FOREACH_SLAVE(core_id) {
> diff --git a/app/test/test_hash_readwrite_lf.c
> b/app/test/test_hash_readwrite_lf.c
> index 5644361..2664f51 100644
> --- a/app/test/test_hash_readwrite_lf.c
> +++ b/app/test/test_hash_readwrite_lf.c
> @@ -1254,10 +1254,10 @@ struct {
>  	int htm;
>  	int use_jhash = 0;
>  	int ext_bkt = 0;
> -	if (rte_lcore_count() == 1) {
> -		printf("More than one lcore is required "
> -			"to do read write lock-free concurrency test\n");
> -		return -1;
> +
> +	if (rte_lcore_count() < 2) {
> +		printf("Not enough cores for hash_readwrite_lf_autotest,
> expecting at least 2\n");
> +		return TEST_SKIPPED;
>  	}
Looks good

> diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c index
> 92ab0c2..725d27d 100644
> --- a/app/test/test_rcu_qsbr.c
> +++ b/app/test/test_rcu_qsbr.c
> @@ -949,14 +949,14 @@
>  static int
>  test_rcu_qsbr_main(void)
>  {
> +	if (rte_lcore_count() < 5) {
Should be '4'. 4 cores are enough for the test.

> +		printf("Not enough cores for rcu_qsbr_autotest, expecting at
> least 5\n");
> +		return TEST_SKIPPED;
> +	}
> +
>  	if (get_enabled_cores_mask() != 0)
>  		return -1;
> 
> -	if (num_cores < 4) {
> -		printf("Test failed! Need 4 or more cores\n");
> -		goto test_fail;
> -	}
There is another check in 'get_enabled_cores_mask' function. We should convert that as well. Suggest pulling the check in 'get_enabled_cores_mask' to 'test_rcu_qsbr_main'

> -
>  	/* Error-checking test cases */
>  	if (test_rcu_qsbr_get_memsize() < 0)
>  		goto test_fail;
> diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c
> index 6b1912c..dcdd9da 100644
> --- a/app/test/test_rcu_qsbr_perf.c
> +++ b/app/test/test_rcu_qsbr_perf.c
> @@ -623,6 +623,11 @@
>  static int
>  test_rcu_qsbr_main(void)
>  {
> +	if (rte_lcore_count() < 3) {
Should be 2. Minimum 2 cores are required.

> +		printf("Not enough cores for rcu_qsbr_perf_autotest,
> expecting at least 3\n");
> +		return TEST_SKIPPED;
> +	}
> +
>  	rte_atomic64_init(&updates);
>  	rte_atomic64_init(&update_cycles);
>  	rte_atomic64_init(&checks);
> @@ -632,10 +637,6 @@
>  		return -1;
> 
>  	printf("Number of cores provided = %d\n", num_cores);
> -	if (num_cores < 2) {
> -		printf("Test failed! Need 2 or more cores\n");
> -		goto test_fail;
> -	}
>  	if (num_cores > TEST_RCU_MAX_LCORE) {
Should convert this check as well to return TEST_SKIPPED.

>  		printf("Test failed! %d cores supported\n",
> TEST_RCU_MAX_LCORE);
>  		goto test_fail;

<snip>



More information about the dev mailing list