X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=test%2Ftest%2Ftest_cryptodev.c;h=2f31ec9bd8805d359b13981487276ecad089241c;hb=4ed1e79e78195b56acdcd204159322249799d70d;hp=d1d79252108bdc18a72e2e3c741985e11bb2f9c3;hpb=8144eada328029a42cf2be979cf264f4ba0b6651;p=dpdk.git diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index d1d7925210..2f31ec9bd8 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -1819,6 +1819,25 @@ test_AES_cipheronly_qat_all(void) return TEST_SUCCESS; } +static int +test_AES_cipheronly_virtio_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + int status; + + status = test_blockcipher_all_tests(ts_params->mbuf_pool, + ts_params->op_mpool, + ts_params->session_mpool, + ts_params->valid_devs[0], + rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD)), + BLKCIPHER_AES_CIPHERONLY_TYPE); + + TEST_ASSERT_EQUAL(status, 0, "Test failed"); + + return TEST_SUCCESS; +} + static int test_AES_chain_dpaa_sec_all(void) { @@ -8879,6 +8898,18 @@ static struct unit_test_suite cryptodev_qat_testsuite = { } }; +static struct unit_test_suite cryptodev_virtio_testsuite = { + .suite_name = "Crypto VIRTIO Unit Test Suite", + .setup = testsuite_setup, + .teardown = testsuite_teardown, + .unit_test_cases = { + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_cipheronly_virtio_all), + + TEST_CASES_END() /**< NULL terminate unit test array */ + } +}; + static struct unit_test_suite cryptodev_aesni_mb_testsuite = { .suite_name = "Crypto Device AESNI MB Unit Test Suite", .setup = testsuite_setup, @@ -9807,6 +9838,22 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/) return unit_test_suite_runner(&cryptodev_qat_testsuite); } +static int +test_cryptodev_virtio(void /*argv __rte_unused, int argc __rte_unused*/) +{ + gbl_driver_id = rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD)); + + if (gbl_driver_id == -1) { + RTE_LOG(ERR, USER1, "VIRTIO PMD must be loaded. Check if " + "CONFIG_RTE_LIBRTE_PMD_VIRTIO_CRYPTO is enabled " + "in config file to run this testsuite.\n"); + return TEST_FAILED; + } + + return unit_test_suite_runner(&cryptodev_virtio_testsuite); +} + static int test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/) { @@ -10040,3 +10087,4 @@ REGISTER_TEST_COMMAND(cryptodev_sw_mrvl_autotest, test_cryptodev_mrvl); REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_autotest, test_cryptodev_dpaa2_sec); REGISTER_TEST_COMMAND(cryptodev_dpaa_sec_autotest, test_cryptodev_dpaa_sec); REGISTER_TEST_COMMAND(cryptodev_ccp_autotest, test_cryptodev_ccp); +REGISTER_TEST_COMMAND(cryptodev_virtio_autotest, test_cryptodev_virtio);