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

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-spell-check-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Ganapati Kundapura Sept. 12, 2021, 3:58 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(+)
  

Patch

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 9198767..ac6cb18 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -750,6 +750,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,
@@ -762,6 +783,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 */
 	}
 };