[dpdk-dev,v5,01/20] test/eventdev: pass timeout ticks unsupported

Message ID 1490374395-149320-2-git-send-email-harry.van.haaren@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Van Haaren, Harry March 24, 2017, 4:52 p.m. UTC
  This commit reworks the return value handling of the
timeout ticks test. This feature is not mandatory for
a pmd, the eventdev layer returns -ENOTSUP if the PMD
doesn't implement the function.

The test is modified to check if the return value is
-ENOTSUP, and return -ENOTSUP to the test framework,
which can handle "unsupported" tests since patch[1].

As such, this test will function correctly if the
patchset linked below is applied, it fails if the
patch is not applied and the PMD doesn't the timeout
ticks function.

Note it does not depend (as a compile time dependency)
on the patchset linked below.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

[1] http://dpdk.org/dev/patchwork/patch/21979/
---
 test/test/test_eventdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Jerin Jacob March 25, 2017, 5:38 a.m. UTC | #1
On Fri, Mar 24, 2017 at 04:52:56PM +0000, Harry van Haaren wrote:
> This commit reworks the return value handling of the
> timeout ticks test. This feature is not mandatory for
> a pmd, the eventdev layer returns -ENOTSUP if the PMD
> doesn't implement the function.
> 
> The test is modified to check if the return value is
> -ENOTSUP, and return -ENOTSUP to the test framework,
> which can handle "unsupported" tests since patch[1].
> 
> As such, this test will function correctly if the
> patchset linked below is applied, it fails if the
> patch is not applied and the PMD doesn't the timeout
> ticks function.
> 
> Note it does not depend (as a compile time dependency)
> on the patchset linked below.
> 
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> [1] http://dpdk.org/dev/patchwork/patch/21979/
> ---
>  test/test/test_eventdev.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c
> index 0f1deb6..7067970 100644
> --- a/test/test/test_eventdev.c
> +++ b/test/test/test_eventdev.c
> @@ -519,9 +519,10 @@ test_eventdev_timeout_ticks(void)
>  	uint64_t timeout_ticks;
>  
>  	ret = rte_event_dequeue_timeout_ticks(TEST_DEV_ID, 100, &timeout_ticks);
> -	TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks");
> +	if (ret != -ENOTSUP)
> +		TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks");
>  
> -	return TEST_SUCCESS;
> +	return -ENOTSUP;

It should be "return ret". Otherwise, The test case will return
-ENOTSUP irrespective of PMD supports or not.

With that change,
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

>  }
>  
>  
> -- 
> 2.7.4
>
  

Patch

diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c
index 0f1deb6..7067970 100644
--- a/test/test/test_eventdev.c
+++ b/test/test/test_eventdev.c
@@ -519,9 +519,10 @@  test_eventdev_timeout_ticks(void)
 	uint64_t timeout_ticks;
 
 	ret = rte_event_dequeue_timeout_ticks(TEST_DEV_ID, 100, &timeout_ticks);
-	TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks");
+	if (ret != -ENOTSUP)
+		TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks");
 
-	return TEST_SUCCESS;
+	return -ENOTSUP;
 }