diff mbox series

[v5,2/2] test/event: Add rx queue conf get test in rx adapter autotest

Message ID 20210916125107.2024111-2-ganapati.kundapura@intel.com (mailing list archive)
State Accepted
Delegated to: Jerin Jacob
Headers show
Series [v5,1/2] eventdev: add rx queue conf get api | expand

Checks

Context Check Description
ci/intel-Testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Kundapura, Ganapati Sept. 16, 2021, 12:51 p.m. UTC
Add unit tests for rte_event_eth_rx_adapter_queue_conf_get()
in rx adapter autotest

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
---
 app/test/test_event_eth_rx_adapter.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Jayatheerthan, Jay Sept. 28, 2021, 9:35 a.m. UTC | #1
> -----Original Message-----
> From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> Sent: Thursday, September 16, 2021 6:21 PM
> To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>; jerinjacobk@gmail.com
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: [PATCH v5 2/2] test/event: Add rx queue conf get test in rx adapter autotest
> 
> Add unit tests for rte_event_eth_rx_adapter_queue_conf_get()
> in rx adapter autotest
> 
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
> ---
>  app/test/test_event_eth_rx_adapter.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
> index add4d8a..13664a3 100644
> --- a/app/test/test_event_eth_rx_adapter.c
> +++ b/app/test/test_event_eth_rx_adapter.c
> @@ -747,6 +747,27 @@ adapter_stats(void)
>  	return TEST_SUCCESS;
>  }
> 
> +static int
> +adapter_queue_conf(void)
> +{
> +	int err;
> +	struct rte_event_eth_rx_adapter_queue_conf queue_conf;
> +
> +	err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
> +						      0, &queue_conf);
> +	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +
> +	err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
> +						      -1, &queue_conf);
> +	TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
> +
> +	err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
> +						      0, NULL);
> +	TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
> +
> +	return TEST_SUCCESS;
> +}
> +
>  static struct unit_test_suite event_eth_rx_tests = {
>  	.suite_name = "rx event eth adapter test suite",
>  	.setup = testsuite_setup,
> @@ -759,6 +780,7 @@ static struct unit_test_suite event_eth_rx_tests = {
>  					adapter_multi_eth_add_del),
>  		TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop),
>  		TEST_CASE_ST(adapter_create, adapter_free, adapter_stats),
> +		TEST_CASE_ST(adapter_create, adapter_free, adapter_queue_conf),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
>  	}
>  };
> --
> 2.6.4

Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
diff mbox series

Patch

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index add4d8a..13664a3 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -747,6 +747,27 @@  adapter_stats(void)
 	return TEST_SUCCESS;
 }
 
+static int
+adapter_queue_conf(void)
+{
+	int err;
+	struct rte_event_eth_rx_adapter_queue_conf queue_conf;
+
+	err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
+						      0, &queue_conf);
+	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+	err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
+						      -1, &queue_conf);
+	TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
+
+	err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
+						      0, NULL);
+	TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
+
+	return TEST_SUCCESS;
+}
+
 static struct unit_test_suite event_eth_rx_tests = {
 	.suite_name = "rx event eth adapter test suite",
 	.setup = testsuite_setup,
@@ -759,6 +780,7 @@  static struct unit_test_suite event_eth_rx_tests = {
 					adapter_multi_eth_add_del),
 		TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop),
 		TEST_CASE_ST(adapter_create, adapter_free, adapter_stats),
+		TEST_CASE_ST(adapter_create, adapter_free, adapter_queue_conf),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };