diff mbox series

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

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kundapura, Ganapati Sept. 16, 2021, 12:46 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(+)
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 */
 	}
 };