test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1 0/6] rework cryptodev test script and conf
@ 2020-06-04  0:54 xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 1/6] conf: simplify conf settings for cryptodev test xinfengx
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

conf: simplify conf settings for cryptodev test
tests/cryptodev_common: improve cryptodev common methods
tests/crypto_perf_cryptodev_perf: rework crypto_perf test script
tests/l2fwd_cryptodev_func: rework l2fwd_crypto test script
tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec test script
tests/unit_tests_cryptodev_func: rework cryptodev unit test script

 conf/crypto_perf_cryptodev_perf.cfg           |  115 +-
 conf/cryptodev_sample.cfg                     |    6 +
 conf/ipsec_gw_cryptodev_func.cfg              |  156 +--
 conf/l2fwd_cryptodev_func.cfg                 |   35 -
 conf/unit_tests_cryptodev_func.cfg            |   11 -
 tests/TestSuite_crypto_perf_cryptodev_perf.py |  628 ++++------
 tests/TestSuite_ipsec_gw_cryptodev_func.py    |  624 ++--------
 tests/TestSuite_l2fwd_cryptodev_func.py       | 1036 ++++-------------
 tests/TestSuite_unit_tests_cryptodev_func.py  |   56 +-
 tests/cryptodev_common.py                     |  117 +-
 10 files changed, 785 insertions(+), 1999 deletions(-)
 create mode 100644 conf/cryptodev_sample.cfg
 delete mode 100644 conf/l2fwd_cryptodev_func.cfg
 delete mode 100644 conf/unit_tests_cryptodev_func.cfg

-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dts] [PATCH V1 1/6] conf: simplify conf settings for cryptodev test
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
@ 2020-06-04  0:54 ` xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 2/6] tests/cryptodev_common: improve cryptodev common methods xinfengx
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 conf/crypto_perf_cryptodev_perf.cfg | 115 ++++++++++++--------
 conf/cryptodev_sample.cfg           |   6 ++
 conf/ipsec_gw_cryptodev_func.cfg    | 156 +++++++++-------------------
 conf/l2fwd_cryptodev_func.cfg       |  35 -------
 conf/unit_tests_cryptodev_func.cfg  |  11 --
 5 files changed, 124 insertions(+), 199 deletions(-)
 create mode 100644 conf/cryptodev_sample.cfg
 delete mode 100644 conf/l2fwd_cryptodev_func.cfg
 delete mode 100644 conf/unit_tests_cryptodev_func.cfg

diff --git a/conf/crypto_perf_cryptodev_perf.cfg b/conf/crypto_perf_cryptodev_perf.cfg
index 05dc6af..f0c86a4 100644
--- a/conf/crypto_perf_cryptodev_perf.cfg
+++ b/conf/crypto_perf_cryptodev_perf.cfg
@@ -1,25 +1,15 @@
 [suite]
-# Cryptodev common options qat device id
-crypto_dev_id="37c9"
-
 # eal config
 l="9,10"
-socket-mem="2048,0 --legacy-mem"
-n=6
-
-# default crypto device and sw device config, it could be overrided by test case
-w="0000:1a:01.0"
-vdev="crypto_aesni_mb_1"
-
 total-ops=30000000
 buffer-sz="64,128,256,512,1024,2048"
 
 [test_verify_aesni_mb]
-buffer-sz=32
 ptest="verify"
+devtype="crypto_aesni_mb"
+buffer-sz="32"
 auth-key-sz=64
 cipher-key-sz=32
-devtype="crypto_aesni_mb"
 cipher-iv-sz=16
 auth-op="generate"
 digest-sz=12
@@ -30,11 +20,11 @@ test-name="sha1_hmac_buff_32"
 test-file="/tmp/test_aes_cbc.data"
 
 [test_verify_qat]
-buffer-sz=32
 ptest="verify"
+devtype="crypto_qat"
+buffer-sz="32"
 auth-key-sz=64
 cipher-key-sz=32
-devtype="crypto_qat"
 cipher-iv-sz=16
 auth-op="generate"
 digest-sz=20
@@ -45,9 +35,9 @@ test-name="sha1_hmac_buff_32"
 test-file="/tmp/test_aes_cbc.data"
 
 [test_verify_openssl_qat]
-l="9,10,11,12"
-vdev="crypto_openssl"
+ptest="verify"
 devtype="crypto_openssl"
+buffer-sz="32"
 aead-algo="aes-gcm"
 aead-key-sz=16
 aead-iv-sz=12
@@ -55,15 +45,13 @@ aead-op="encrypt"
 aead-aad-sz=16
 digest-sz=16
 optype="aead"
-ptest="verify"
-buffer-sz=32
 test-name="aes_gcm_buff_32"
 test-file="/tmp/test_aes_gcm.data"
 
 [test_verify_openssl]
-l="9,10,11,12"
-vdev="crypto_openssl"
+ptest="verify"
 devtype="crypto_openssl"
+buffer-sz="32"
 aead-algo="aes-gcm"
 aead-key-sz=16
 aead-iv-sz=12
@@ -71,25 +59,19 @@ aead-op="encrypt"
 aead-aad-sz=16
 digest-sz=16
 optype="aead"
-ptest="verify"
-buffer-sz=32
 test-name="aes_gcm_buff_32"
 test-file="/tmp/test_aes_gcm.data"
 
 [test_latency_qat]
-l="9,10,11,12"
-w="0000:1a:01.0  -w 0000:1a:01.1  -w 0000:1a:01.2"
+ptest="latency"
 devtype="crypto_qat"
 cipher-algo="aes-cbc"
 cipher-key-sz=16
 cipher-iv-sz=16
 cipher-op="encrypt"
 optype="cipher-only"
-ptest="latency"
 
 [test_latency_auth_qat]
-l="9,10,11,12"
-w="0000:1a:01.0  -w 0000:1a:01.1  -w 0000:1a:01.2"
 ptest="latency"
 devtype="crypto_qat"
 cipher-algo="aes-cbc"
@@ -102,31 +84,28 @@ digest-sz=12
 silent=None
 
 [test_latency_aead_qat]
+ptest="latency"
+devtype="crypto_qat"
 aead-key-sz=16
 optype="aead"
-ptest="latency"
 aead-aad-sz=16
-devtype="crypto_qat"
 aead-op="encrypt"
 digest-sz=16
 aead-algo="aes-gcm"
 aead-iv-sz=12
 
 [test_latency_aesni_gcm]
-vdev="crypto_aesni_gcm_pmd_1"
+ptest="latency"
+devtype="crypto_aesni_gcm"
 aead-key-sz=16
 optype="aead"
-ptest="latency"
 aead-aad-sz=16
-devtype="crypto_aesni_gcm"
 aead-op="encrypt"
 digest-sz=16
 aead-algo="aes-gcm"
 aead-iv-sz=12
 
 [test_latency_auth_aesni_mb]
-l="9,10,11,12"
-vdev="crypto_aesni_mb1 --vdev crypto_aesni_mb2"
 ptest="latency"
 devtype="crypto_aesni_mb"
 cipher-algo="aes-cbc"
@@ -139,7 +118,6 @@ silent=None
 digest-sz=12
 
 [test_latency_aesni_mb]
-vdev="crypto_aesni_mb1 --vdev crypto_aesni_mb2"
 devtype="crypto_aesni_mb"
 cipher-algo="aes-cbc"
 cipher-key-sz=16
@@ -203,9 +181,8 @@ aead-aad-sz=16
 digest-sz=16
 
 [test_sw_aes_gcm]
-vdev="crypto_aesni_gcm_pmd_1"
-optype="aead"
 devtype="crypto_aesni_gcm"
+optype="aead"
 aead-algo="aes-gcm"
 aead-op="encrypt"
 aead-key-sz=16
@@ -261,7 +238,6 @@ auth-key-sz=16
 digest-sz=4
 
 [test_sw_kasumi]
-vdev="crypto_kasumi_1"
 total-ops=1000000
 devtype="crypto_kasumi"
 cipher-algo="kasumi-f8"
@@ -286,7 +262,6 @@ auth-iv-sz=16
 digest-sz=4
 
 [test_sw_snow3g]
-vdev="crypto_snow3g_1"
 total-ops=1000000
 devtype="crypto_snow3g"
 cipher-algo="snow3g-uea2"
@@ -312,7 +287,6 @@ auth-iv-sz=16
 digest-sz=4
 
 [test_sw_zuc]
-vdev="crypto_zuc_1"
 total-ops=1000000
 devtype="crypto_zuc"
 cipher-algo="zuc-eea3"
@@ -326,19 +300,68 @@ auth-iv-sz=16
 digest-sz=4
 
 [test_scheduler_aes_cbc_sha1_hmac]
-test_skip="Y"
+devtype="crypto_scheduler"
+cipher-algo="aes-cbc"
+cipher-op="encrypt"
+cipher-key-sz=16
+cipher-iv-sz=16
+auth-algo="sha1-hmac"
+auth-op="generate"
+auth-key-sz=64
+digest-sz=20
 
 [test_scheduler_aes_cbc_sha2_hmac]
-test_skip="Y"
+devtype="crypto_scheduler"
+cipher-algo="aes-cbc"
+cipher-op="encrypt"
+cipher-key-sz=16
+cipher-iv-sz=16
+auth-algo="sha2-256-hmac"
+auth-op="generate"
+auth-key-sz=64
+digest-sz=32
 
 [test_scheduler_aes_gcm]
-test_skip="Y"
+devtype="crypto_scheduler"
+optype="aead"
+aead-algo="aes-gcm"
+aead-op="encrypt"
+aead-key-sz=16
+aead-iv-sz=12
+aead-aad-sz=16
+digest-sz=16
 
 [test_scheduler_kasumi]
-test_skip="Y"
+devtype="crypto_scheduler"
+cipher-algo="kasumi-f8"
+cipher-op="encrypt"
+cipher-key-sz=16
+cipher-iv-sz=8
+auth-algo="kasumi-f9"
+auth-op="generate"
+auth-key-sz=16
+digest-sz=4
 
 [test_scheduler_snow3g]
-test_skip="Y"
+devtype="crypto_scheduler"
+cipher-algo="snow3g-uea2"
+cipher-op="encrypt"
+cipher-key-sz=16
+cipher-iv-sz=16
+auth-algo="snow3g-uia2"
+auth-op="generate"
+auth-key-sz=16
+auth-iv-sz=16
+digest-sz=4
 
 [test_scheduler_zuc]
-test_skip="Y"
+devtype="crypto_scheduler"
+cipher-algo="zuc-eea3"
+cipher-op="encrypt"
+cipher-key-sz=16
+cipher-iv-sz=16
+auth-algo="zuc-eia3"
+auth-op="generate"
+auth-key-sz=16
+auth-iv-sz=16
+digest-sz=4
diff --git a/conf/cryptodev_sample.cfg b/conf/cryptodev_sample.cfg
new file mode 100644
index 0000000..4aade66
--- /dev/null
+++ b/conf/cryptodev_sample.cfg
@@ -0,0 +1,6 @@
+[suite]
+# Cryptodev common option qat hardware device id
+crypto_dev_id="37c8"
+
+# your special settings for eal
+socket-mem="2048,0"
diff --git a/conf/ipsec_gw_cryptodev_func.cfg b/conf/ipsec_gw_cryptodev_func.cfg
index b22436d..8ecf7c8 100644
--- a/conf/ipsec_gw_cryptodev_func.cfg
+++ b/conf/ipsec_gw_cryptodev_func.cfg
@@ -1,20 +1,9 @@
 [suite]
-# Cryptodev common options qat device id
-crypto_dev_id="37c9"
-
-# eal config
-l="9,10,11"
-socket-mem="2048,0"
-
-# enables or disables code-path that uses librte_ipsec
+# enable or disable  librte_ipsec
 librte_ipsec=False
 
-# IPsec gw app configuration
-f="/root/ipsec_ep0.cfg"
-
 [test_qat_aes_128_cbc_ipv4_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.105.100"
 src_ip="192.168.105.200"
 expected_dst_ip="172.16.2.5"
@@ -22,8 +11,7 @@ expected_src_ip="172.16.1.5"
 expected_spi="0x5"
 
 [test_qat_aes_128_ctr_ipv4_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.125.100"
 src_ip="192.168.125.200"
 expected_dst_ip="172.16.2.6"
@@ -31,8 +19,7 @@ expected_src_ip="172.16.1.6"
 expected_spi="0x2d"
 
 [test_qat_aes_256_cbc_ipv4_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.25.100"
 src_ip="192.168.25.200"
 expected_dst_ip="172.16.2.5"
@@ -40,8 +27,7 @@ expected_src_ip="172.16.1.5"
 expected_spi="0x23"
 
 [test_qat_aes_gcm_ipv4_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.106.100"
 src_ip="192.168.106.200"
 expected_dst_ip="172.16.2.6"
@@ -49,8 +35,7 @@ expected_src_ip="172.16.1.6"
 expected_spi="0x6"
 
 [test_qat_null_ipv4_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.200.100"
 src_ip="192.168.200.200"
 expected_dst_ip="172.16.2.5"
@@ -58,8 +43,7 @@ expected_src_ip="172.16.1.5"
 expected_spi="0xf"
 
 [test_qat_3des_cbc_ipv4_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.220.100"
 src_ip="192.168.220.200"
 expected_dst_ip="172.16.2.6"
@@ -67,8 +51,7 @@ expected_src_ip="172.16.1.6"
 expected_spi="0x32"
 
 [test_qat_aes_128_cbc_ipv4_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.175.100"
 src_ip="192.168.175.200"
 expected_dst_ip="192.168.175.100"
@@ -76,8 +59,7 @@ expected_src_ip="192.168.175.200"
 expected_spi="0xa"
 
 [test_qat_aes_128_ctr_ipv4_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.76.100"
 src_ip="192.168.76.200"
 expected_dst_ip="192.168.76.100"
@@ -85,8 +67,7 @@ expected_src_ip="192.168.76.200"
 expected_spi="0x1f"
 
 [test_qat_aes_256_cbc_ipv4_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.26.100"
 src_ip="192.168.26.200"
 expected_dst_ip="192.168.26.100"
@@ -94,8 +75,7 @@ expected_src_ip="192.168.26.200"
 expected_spi="0x24"
 
 [test_qat_aes_gcm_ipv4_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.176.100"
 src_ip="192.168.176.200"
 expected_dst_ip="192.168.176.100"
@@ -103,8 +83,7 @@ expected_src_ip="192.168.176.200"
 expected_spi="0xb"
 
 [test_qat_null_ipv4_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.141.100"
 src_ip="192.168.141.200"
 expected_dst_ip="192.168.141.100"
@@ -112,8 +91,7 @@ expected_src_ip="192.168.141.200"
 expected_spi="0x38"
 
 [test_qat_3des_cbc_ipv4_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.140.100"
 src_ip="192.168.140.200"
 expected_dst_ip="192.168.140.100"
@@ -121,8 +99,7 @@ expected_src_ip="192.168.140.200"
 expected_spi="0x37"
 
 [test_qat_aes_128_ctr_ipv6_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.126.100"
 src_ip="192.168.126.200"
 expected_dst_ip="bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:2222"
@@ -130,8 +107,7 @@ expected_src_ip="aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:1111"
 expected_spi="0x2e"
 
 [test_qat_aes_128_cbc_ipv6_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.55.100"
 src_ip="192.168.55.200"
 expected_dst_ip="2222:2222:2222:2222:2222:2222:2222:5555"
@@ -139,8 +115,7 @@ expected_src_ip="1111:1111:1111:1111:1111:1111:1111:5555"
 expected_spi="0x19"
 
 [test_qat_aes_256_cbc_ipv6_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.75.100"
 src_ip="192.168.75.200"
 expected_dst_ip="8888:8888:8888:8888:8888:8888:8888:2222"
@@ -148,8 +123,7 @@ expected_src_ip="7777:7777:7777:7777:7777:7777:7777:1111"
 expected_spi="0x1e"
 
 [test_qat_aes_gcm_ipv6_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.56.100"
 src_ip="192.168.56.200"
 expected_dst_ip="2222:2222:2222:2222:2222:2222:2222:6666"
@@ -157,8 +131,7 @@ expected_src_ip="1111:1111:1111:1111:1111:1111:1111:6666"
 expected_spi="0x1a"
 
 [test_qat_null_ipv6_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.201.100"
 src_ip="192.168.201.200"
 expected_dst_ip="5555:5555:5555:5555:5555:5555:5555:2222"
@@ -166,8 +139,7 @@ expected_src_ip="4444:4444:4444:4444:4444:4444:4444:1111"
 expected_spi="0x10"
 
 [test_qat_3des_cbc_ipv6_tunnel]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="192.168.221.100"
 src_ip="192.168.221.200"
 expected_dst_ip="bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:2222"
@@ -175,8 +147,7 @@ expected_src_ip="aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:1111"
 expected_spi="0x33"
 
 [test_qat_aes_128_cbc_ipv6_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="0000:1111:1111:1111:0000:0000:0000:0000"
 src_ip="0000:1111:1111:1111:0000:0000:0000:1111"
 expected_dst_ip="0:1111:1111:1111::"
@@ -184,8 +155,7 @@ expected_src_ip="0:1111:1111:1111::1111"
 expected_spi="0x50"
 
 [test_qat_aes_128_ctr_ipv6_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="0000:1111:1111:1111:2222:2222:0000:0000"
 src_ip="0000:1111:1111:1111:2222:2222:0000:1111"
 expected_dst_ip="0:1111:1111:1111:2222:2222::"
@@ -193,8 +163,7 @@ expected_src_ip="0:1111:1111:1111:2222:2222:0:1111"
 expected_spi="0x52"
 
 [test_qat_aes_256_cbc_ipv6_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="0000:1111:1111:1111:3333:3333:0000:0000"
 src_ip="0000:1111:1111:1111:3333:3333:0000:1111"
 expected_dst_ip="0:1111:1111:1111:3333:3333::"
@@ -202,8 +171,7 @@ expected_src_ip="0:1111:1111:1111:3333:3333:0:1111"
 expected_spi="0x53"
 
 [test_qat_aes_gcm_ipv6_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="0000:1111:1111:1111:1111:1111:0000:0000"
 src_ip="0000:1111:1111:1111:1111:1111:0000:1111"
 expected_dst_ip="0:1111:1111:1111:1111:1111::"
@@ -211,8 +179,7 @@ expected_src_ip="0:1111:1111:1111:1111:1111:0:1111"
 expected_spi="0x51"
 
 [test_qat_null_ipv6_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="0000:1111:1111:1111:5555:5555:0000:0000"
 src_ip="0000:1111:1111:1111:5555:5555:0000:1111"
 expected_dst_ip="0:1111:1111:1111:5555:5555::"
@@ -220,8 +187,7 @@ expected_src_ip="0:1111:1111:1111:5555:5555:0:1111"
 expected_spi="0x55"
 
 [test_qat_3des_cbc_ipv6_transport]
-w="0000:1a:01.0"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_qat"
 dst_ip="0000:1111:1111:1111:4444:4444:0000:0000"
 src_ip="0000:1111:1111:1111:4444:4444:0000:1111"
 expected_dst_ip="0:1111:1111:1111:4444:4444::"
@@ -230,8 +196,7 @@ expected_spi="0x54"
 
 ###### SW #######
 [test_sw_aes_128_cbc_ipv4_tunnel]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.105.100"
 src_ip="192.168.105.200"
 expected_dst_ip="172.16.2.5"
@@ -239,8 +204,7 @@ expected_src_ip="172.16.1.5"
 expected_spi="0x5"
 
 [test_sw_aes_128_ctr_ipv4_tunnel]
-vdev="crypto_openssl_pmd_1 --vdev=crypto_openssl_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_openssl"
 dst_ip="192.168.125.100"
 src_ip="192.168.125.200"
 expected_dst_ip="172.16.2.6"
@@ -248,8 +212,7 @@ expected_src_ip="172.16.1.6"
 expected_spi="0x2d"
 
 [test_sw_aes_256_cbc_ipv4_tunnel]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.25.100"
 src_ip="192.168.25.200"
 expected_dst_ip="172.16.2.5"
@@ -257,8 +220,7 @@ expected_src_ip="172.16.1.5"
 expected_spi="0x23"
 
 [test_sw_aes_gcm_ipv4_tunnel]
-vdev="crypto_aesni_gcm_pmd_1 --vdev=crypto_aesni_gcm_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_gcm"
 dst_ip="192.168.106.100"
 src_ip="192.168.106.200"
 expected_dst_ip="172.16.2.6"
@@ -266,8 +228,7 @@ expected_src_ip="172.16.1.6"
 expected_spi="0x6"
 
 [test_sw_null_ipv4_tunnel]
-vdev="crypto_null_pmd_1 --vdev=crypto_null_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_null"
 dst_ip="192.168.200.100"
 src_ip="192.168.200.200"
 expected_dst_ip="172.16.2.5"
@@ -275,8 +236,7 @@ expected_src_ip="172.16.1.5"
 expected_spi="0xf"
 
 [test_sw_3des_cbc_ipv4_tunnel]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.220.100"
 src_ip="192.168.220.200"
 expected_dst_ip="172.16.2.6"
@@ -284,8 +244,7 @@ expected_src_ip="172.16.1.6"
 expected_spi="0x32"
 
 [test_sw_aes_128_cbc_ipv4_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.175.100"
 src_ip="192.168.175.200"
 expected_dst_ip="192.168.175.100"
@@ -293,8 +252,7 @@ expected_src_ip="192.168.175.200"
 expected_spi="0xa"
 
 [test_sw_aes_128_ctr_ipv4_transport]
-vdev="crypto_openssl_pmd_1 --vdev=crypto_openssl_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_openssl"
 dst_ip="192.168.76.100"
 src_ip="192.168.76.200"
 expected_dst_ip="192.168.76.100"
@@ -302,8 +260,7 @@ expected_src_ip="192.168.76.200"
 expected_spi="0x1f"
 
 [test_sw_aes_256_cbc_ipv4_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.26.100"
 src_ip="192.168.26.200"
 expected_dst_ip="192.168.26.100"
@@ -311,8 +268,7 @@ expected_src_ip="192.168.26.200"
 expected_spi="0x24"
 
 [test_sw_aes_gcm_ipv4_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.176.100"
 src_ip="192.168.176.200"
 expected_dst_ip="192.168.176.100"
@@ -320,8 +276,7 @@ expected_src_ip="192.168.176.200"
 expected_spi="0xb"
 
 [test_sw_null_ipv4_transport]
-vdev="crypto_null_pmd_1 --vdev=crypto_null_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_null"
 dst_ip="192.168.141.100"
 src_ip="192.168.141.200"
 expected_dst_ip="192.168.141.100"
@@ -329,8 +284,7 @@ expected_src_ip="192.168.141.200"
 expected_spi="0x38"
 
 [test_sw_3des_cbc_ipv4_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.140.100"
 src_ip="192.168.140.200"
 expected_dst_ip="192.168.140.100"
@@ -338,8 +292,7 @@ expected_src_ip="192.168.140.200"
 expected_spi="0x37"
 
 [test_sw_aes_128_cbc_ipv6_tunnel]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.55.100"
 src_ip="192.168.55.200"
 expected_dst_ip="2222:2222:2222:2222:2222:2222:2222:5555"
@@ -347,8 +300,7 @@ expected_src_ip="1111:1111:1111:1111:1111:1111:1111:5555"
 expected_spi="0x19"
 
 [test_sw_aes_128_ctr_ipv6_tunnel]
-vdev="crypto_openssl_pmd_1 --vdev=crypto_openssl_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_openssl"
 dst_ip="192.168.126.100"
 src_ip="192.168.126.200"
 expected_dst_ip="bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:2222"
@@ -356,8 +308,7 @@ expected_src_ip="aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:1111"
 expected_spi="0x2e"
 
 [test_sw_aes_256_cbc_ipv6_tunnel]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.75.100"
 src_ip="192.168.75.200"
 expected_dst_ip="8888:8888:8888:8888:8888:8888:8888:2222"
@@ -365,8 +316,7 @@ expected_src_ip="7777:7777:7777:7777:7777:7777:7777:1111"
 expected_spi="0x1e"
 
 [test_sw_aes_gcm_ipv6_tunnel]
-vdev="crypto_aesni_gcm_pmd_1 --vdev=crypto_aesni_gcm_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_gcm"
 dst_ip="192.168.56.100"
 src_ip="192.168.56.200"
 expected_dst_ip="2222:2222:2222:2222:2222:2222:2222:6666"
@@ -374,8 +324,7 @@ expected_src_ip="1111:1111:1111:1111:1111:1111:1111:6666"
 expected_spi="0x1a"
 
 [test_sw_null_ipv6_tunnel]
-vdev="crypto_null_pmd_1 --vdev=crypto_null_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_null"
 dst_ip="192.168.201.100"
 src_ip="192.168.201.200"
 expected_dst_ip="5555:5555:5555:5555:5555:5555:5555:2222"
@@ -383,8 +332,7 @@ expected_src_ip="4444:4444:4444:4444:4444:4444:4444:1111"
 expected_spi="0x10"
 
 [test_sw_3des_cbc_ipv6_tunnel]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="192.168.221.100"
 src_ip="192.168.221.200"
 expected_dst_ip="bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:bbbb:2222"
@@ -392,8 +340,7 @@ expected_src_ip="aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:1111"
 expected_spi="0x33"
 
 [test_sw_aes_128_cbc_ipv6_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="0000:1111:1111:1111:0000:0000:0000:0000"
 src_ip="0000:1111:1111:1111:0000:0000:0000:1111"
 expected_dst_ip="0:1111:1111:1111::"
@@ -401,8 +348,7 @@ expected_src_ip="0:1111:1111:1111::1111"
 expected_spi="0x50"
 
 [test_sw_aes_128_ctr_ipv6_transport]
-vdev="crypto_openssl_pmd_1 --vdev=crypto_openssl_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_openssl"
 dst_ip="0000:1111:1111:1111:2222:2222:0000:0000"
 src_ip="0000:1111:1111:1111:2222:2222:0000:1111"
 expected_dst_ip="0:1111:1111:1111:2222:2222::"
@@ -410,8 +356,7 @@ expected_src_ip="0:1111:1111:1111:2222:2222:0:1111"
 expected_spi="0x52"
 
 [test_sw_aes_256_cbc_ipv6_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="0000:1111:1111:1111:3333:3333:0000:0000"
 src_ip="0000:1111:1111:1111:3333:3333:0000:1111"
 expected_dst_ip="0:1111:1111:1111:3333:3333::"
@@ -419,8 +364,7 @@ expected_src_ip="0:1111:1111:1111:3333:3333:0:1111"
 expected_spi="0x53"
 
 [test_sw_aes_gcm_ipv6_transport]
-vdev="crypto_aesni_gcm_pmd_1 --vdev=crypto_aesni_gcm_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_gcm"
 dst_ip="0000:1111:1111:1111:1111:1111:0000:0000"
 src_ip="0000:1111:1111:1111:1111:1111:0000:1111"
 expected_dst_ip="0:1111:1111:1111:1111:1111::"
@@ -428,8 +372,7 @@ expected_src_ip="0:1111:1111:1111:1111:1111:0:1111"
 expected_spi="0x51"
 
 [test_sw_null_ipv6_transport]
-vdev="crypto_null_pmd_1 --vdev=crypto_null_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_null"
 dst_ip="0000:1111:1111:1111:5555:5555:0000:0000"
 src_ip="0000:1111:1111:1111:5555:5555:0000:1111"
 expected_dst_ip="0:1111:1111:1111:5555:5555::"
@@ -437,8 +380,7 @@ expected_src_ip="0:1111:1111:1111:5555:5555:0:1111"
 expected_spi="0x55"
 
 [test_sw_3des_cbc_ipv6_transport]
-vdev="crypto_aesni_mb_pmd_1 --vdev=crypto_aesni_mb_pmd_2"
-config='"(0,0,10),(1,0,11)"'
+devtype="crypto_aesni_mb"
 dst_ip="0000:1111:1111:1111:4444:4444:0000:0000"
 src_ip="0000:1111:1111:1111:4444:4444:0000:1111"
 expected_dst_ip="0:1111:1111:1111:4444:4444::"
diff --git a/conf/l2fwd_cryptodev_func.cfg b/conf/l2fwd_cryptodev_func.cfg
deleted file mode 100644
index a1b2418..0000000
--- a/conf/l2fwd_cryptodev_func.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-[suite]
-# Cryptodev common options qat device id
-crypto_dev_id="37c9"
-
-# eal config
-l="9,10,66"
-socket-mem="2048,0"
-n=4
-
-# specify the qat devices in eal white list
-w="0000:1a:01.0 -w 0000:1c:01.0 -w 0000:1e:01.0"
-
-[test_scheduler_rr_AES_CBC_auto]
-vdev="crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=0000:3f:01.0_qat_sym,slave=0000:3d:01.0_qat_sym,mode=round-robin"
-
-[test_scheduler_rr_AES_GCM_auto]
-vdev="crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=0000:3f:01.0_qat_sym,slave=0000:3d:01.0_qat_sym,mode=round-robin"
-
-[test_scheduler_psb_AES_CBC_auto]
-vdev="crypto_aesni_mb0,name=aesni_mb_1 --vdev crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=aesni_mb_1,mode=packet-size-distr"
-
-[test_scheduler_psb_AES_GCM_auto]
-vdev="crypto_aesni_mb0,name=aesni_mb_1 --vdev crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=aesni_mb_1,mode=packet-size-distr"
-
-[test_scheduler_fo_AES_CBC_auto]
-vdev="crypto_aesni_mb0,name=aesni_mb_1 --vdev crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=aesni_mb_1,mode=fail-over"
-
-[test_scheduler_fo_AES_GCM_auto]
-vdev="crypto_aesni_mb0,name=aesni_mb_1 --vdev crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=aesni_mb_1,mode=fail-over"
-
-[test_scheduler_mm_AES_CBC_auto]
-vdev="crypto_aesni_mb0,name=aesni_mb_1 --vdev crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=aesni_mb_1,mode=multi-core"
-
-[test_scheduler_mm_AES_GCM_auto]
-vdev="crypto_aesni_mb0,name=aesni_mb_1 --vdev crypto_scheduler_pmd_1,slave=0000:1a:01.0_qat_sym,slave=aesni_mb_1,mode=multi-core"
diff --git a/conf/unit_tests_cryptodev_func.cfg b/conf/unit_tests_cryptodev_func.cfg
deleted file mode 100644
index d5b3b30..0000000
--- a/conf/unit_tests_cryptodev_func.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-[suite]
-# Cryptodev common options qat device id
-crypto_dev_id="37c9"
-
-# eal config
-l="9,10,66"
-socket-mem="2048,0 --legacy-mem"
-n=4
-
-# specify the qat device in eal white list to avoid reach the maximum number of crypto devices
-w="0000:1a:01.0"
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dts] [PATCH V1 2/6] tests/cryptodev_common: improve cryptodev common methods
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 1/6] conf: simplify conf settings for cryptodev test xinfengx
@ 2020-06-04  0:54 ` xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 3/6] tests/crypto_perf_cryptodev_perf: rework crypto_perf test script xinfengx
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/cryptodev_common.py | 117 ++++++++++++++++++++++++++------------
 1 file changed, 81 insertions(+), 36 deletions(-)

diff --git a/tests/cryptodev_common.py b/tests/cryptodev_common.py
index a20dd51..832b3bf 100644
--- a/tests/cryptodev_common.py
+++ b/tests/cryptodev_common.py
@@ -29,32 +29,37 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+from net_device import GetNicObj
+from config import SuiteConf
+
+conf = SuiteConf('cryptodev_sample')
+
 
 def build_dpdk_with_cryptodev(test_case):
     # Rebuild the dpdk with cryptodev pmds
     snow3g_lib_path = "/root/libsso_snow3g/snow3g/"
-    if "snow3g_lib_path" in test_case.get_suite_cfg():
-        snow3g_lib_path = test_case.get_suite_cfg()["snow3g_lib_path"]
+    if "snow3g_lib_path" in conf.suite_cfg:
+        snow3g_lib_path = conf.suite_cfg["snow3g_lib_path"]
 
     zuc_lib_path = "/root/libsso_zuc.1.0.1.1-8/zuc"
-    if "zuc_lib_path" in test_case.get_suite_cfg():
-        zuc_lib_path = test_case.get_suite_cfg()["zuc_lib_path"]
+    if "zuc_lib_path" in conf.suite_cfg:
+        zuc_lib_path = conf.suite_cfg["zuc_lib_path"]
 
     kasumi_lib_path = "/root/LibSSO_0_3_1/isg_cid-wireless_libs/ciphers/kasumi/"
-    if "kasumi_lib_path" in test_case.get_suite_cfg():
-        kasumi_lib_path = test_case.get_suite_cfg()["kasumi_lib_path"]
+    if "kasumi_lib_path" in conf.suite_cfg:
+        kasumi_lib_path = conf.suite_cfg["kasumi_lib_path"]
 
     fip_cflags_path = "'-I/opt/openssl-fips-2.0.16/include/'"
-    if "fip_cflags_path" in test_case.get_suite_cfg():
-        fip_cflags_path = test_case.get_suite_cfg()["fip_cflags_path"]
+    if "fip_cflags_path" in conf.suite_cfg:
+        fip_cflags_path = conf.suite_cfg["fip_cflags_path"]
 
     fip_ldflags_path = "'-L/opt/openssl-fips-2.0.16/'"
-    if "fip_ldflags_path" in test_case.get_suite_cfg():
-        fip_cflags_path = test_case.get_suite_cfg()["fip_ldflags_path"]
+    if "fip_ldflags_path" in conf.suite_cfg:
+        fip_cflags_path = conf.suite_cfg["fip_ldflags_path"]
 
     fip_library_path = "/opt/openssl-fips-2.0.16/"
-    if "fip_library_path" in test_case.get_suite_cfg():
-        fip_cflags_path = test_case.get_suite_cfg()["fip_library_path"]
+    if "fip_library_path" in conf.suite_cfg:
+        fip_cflags_path = conf.suite_cfg["fip_library_path"]
 
     test_case.dut.send_expect(
         "export LIBSSO_SNOW3G_PATH={}".format(snow3g_lib_path), "#")
@@ -91,30 +96,61 @@ def build_dpdk_with_cryptodev(test_case):
 
 
 def bind_qat_device(test_case, driver = "igb_uio"):
-    if not driver:
-        test_case.logger.error("Please configure the driver of qat device to bind")
     if driver == 'vfio-pci':
+        test_case.dut.send_expect('modprobe vfio', '#', 10)
         test_case.dut.send_expect('modprobe vfio-pci', '#', 10)
 
-    if "crypto_dev_id" in test_case.get_suite_cfg():
-        crypto_dev_id = test_case.get_suite_cfg()["crypto_dev_id"]
+    if "crypto_dev_id" in conf.suite_cfg:
+        dev_id = conf.suite_cfg["crypto_dev_id"]
+        test_case.logger.info("specified the qat hardware device id in cfg: {}".format(dev_id))
+        out = test_case.dut.send_expect("lspci -D -d:{}|awk '{{print $1}}'".format(dev_id), "# ", 10)
     else:
-        crypto_dev_id = "443"
-    test_case.logger.info("crypto device id: " + crypto_dev_id)
+        out = test_case.dut.send_expect("lspci -D | grep QuickAssist |awk '{{print $1}}'", "# ", 10)
 
-    # Bind QAT VF devices
-    out = test_case.dut.send_expect("lspci -d:{}|awk '{{print $1}}'".format(crypto_dev_id), "# ", 10)
-    crypto_list = out.replace("\r", "\n").replace("\n\n", "\n").split("\n")
-    test_case._crypto_pci = crypto_list[0]
-    test_case.dut.send_expect(
-        'echo "8086 {}" > /sys/bus/pci/drivers/{}/new_id'.format(crypto_dev_id, driver), "# ", 10)
-    for line in crypto_list:
-        cmd = "echo 0000:{} > /sys/bus/pci/devices/0000\:{}/driver/unbind".format(
-            line, line.replace(":", "\:"))
-        test_case.dut.send_expect(cmd, "# ", 10)
-        cmd = "echo 0000:{} > /sys/bus/pci/drivers/{}/bind".format(
-            line, driver)
-        test_case.dut.send_expect(cmd, "# ", 10)
+    pf_list = out.replace("\r", "\n").replace("\n\n", "\n").split("\n")
+
+    dev = {}
+    for line in pf_list:
+        addr_array = line.strip().split(':')
+        if len(addr_array) !=3:
+            continue
+        domain_id = addr_array[0]
+        bus_id = addr_array[1]
+        devfun_id = addr_array[2]
+        pf_port = GetNicObj(test_case.dut, domain_id, bus_id, devfun_id)
+
+        sriov_vfs_pci = pf_port.get_sriov_vfs_pci()
+        if not sriov_vfs_pci:
+            raise Exception("can not get vf pci")
+
+        dev[line.strip()] = sriov_vfs_pci
+
+        test_case.dut.bind_eventdev_port(driver, ' '.join(sriov_vfs_pci))
+
+    if not dev:
+        raise Exception("can not find qat device")
+
+    test_case.dev = dev
+
+
+def get_qat_devices(test_case, cpm_num=None, num=1):
+    if not cpm_num:
+        cpm_num = len(test_case.dev.keys())
+    n, dev_list = 0, []
+    if cpm_num > len(test_case.dev.keys()):
+        self.logger.warning("QAT card only {} cpm, but {} required".format(
+            len(test_case.dev), cpm_num))
+        return []
+    for i in range(num):
+        for cpm in list(test_case.dev.keys())[:cpm_num]:
+            if n >= num:
+                break
+            if i < len(test_case.dev[cpm]):
+                dev_list.append(test_case.dev[cpm][i])
+            else:
+                self.logger.warning("not enough vf in cpm: {}".format(cpm))
+            n += 1
+    return dev_list
 
 
 def clear_dpdk_config(test_case):
@@ -147,6 +183,15 @@ default_eal_opts = {
 
 
 def get_eal_opt_str(test_case, override_eal_opts={}, add_port=False):
+    cores = ','.join(test_case.dut.get_core_list("1S/3C/1T"))
+    if "l" in conf.suite_cfg:
+        cores = conf.suite_cfg["l"]
+    default_eal_opts.update({'l': cores})
+    if "socket-mem" in conf.suite_cfg:
+        default_eal_opts.update({"socket-mem": (conf.suite_cfg["socket-mem"])})
+    mem_channel = test_case.dut.get_memory_channels()
+    default_eal_opts.update({'n': mem_channel})
+
     return get_opt_str(test_case, default_eal_opts, override_eal_opts, add_port)
 
 
@@ -158,15 +203,15 @@ def get_opt_str(test_case, default_opts, override_opts={}, add_port=False):
         if key in test_case.get_case_cfg():
             opts[key] = test_case.get_case_cfg()[key]
 
+    # Update options with func input
+    opts.update(override_opts)
+
     pci_list = [port["pci"] for port in test_case.dut.ports_info]
     if 'w' in list(opts.keys()) and opts['w']:
         pci_list.append(opts['w'])
     if add_port and pci_list:
         opts['w'] = " -w ".join(pci_list)
 
-    # Update options with func input
-    opts.update(override_opts)
-
     # Generate option string
     opt_str = ""
     for key,value in list(opts.items()):
@@ -192,7 +237,7 @@ def is_test_skip(test_case):
 
 
 def is_build_skip(test_case):
-    if "build_skip" in test_case.get_suite_cfg() \
-       and test_case.get_suite_cfg()["build_skip"] == "Y":
+    if "build_skip" in conf.suite_cfg \
+       and conf.suite_cfg["build_skip"] == "Y":
         test_case.logger.info("Build Skip is YES")
         return True
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dts] [PATCH V1 3/6] tests/crypto_perf_cryptodev_perf: rework crypto_perf test script
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 1/6] conf: simplify conf settings for cryptodev test xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 2/6] tests/cryptodev_common: improve cryptodev common methods xinfengx
@ 2020-06-04  0:54 ` xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 4/6] tests/l2fwd_cryptodev_func: rework l2fwd_crypto " xinfengx
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

rework crypto_perf test script
remove the redundant code
record more detailed test cases

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/TestSuite_crypto_perf_cryptodev_perf.py | 628 +++++++-----------
 1 file changed, 247 insertions(+), 381 deletions(-)

diff --git a/tests/TestSuite_crypto_perf_cryptodev_perf.py b/tests/TestSuite_crypto_perf_cryptodev_perf.py
index 8584aa3..fc8f502 100644
--- a/tests/TestSuite_crypto_perf_cryptodev_perf.py
+++ b/tests/TestSuite_crypto_perf_cryptodev_perf.py
@@ -100,352 +100,160 @@ class PerfTestsCryptodev(TestCase):
     def tear_down(self):
         self.dut.kill_all()
 
-    def _run_func(self, eal_opt_str, crypto_func_opt_str, case_name):
-        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path,
-                                          eal_opt_str,
-                                          crypto_func_opt_str)
-        self.logger.info(cmd_str)
-        try:
-            out = self.dut.send_expect(cmd_str+">%s/%s.txt" % (self.dut_file_dir, case_name), "#", 600)
-        except Exception as ex:
-            self.logger.error(ex)
-            raise ex
-        out = self.dut.send_expect("cat %s/%s.txt | grep fail" % (self.dut_file_dir, case_name), "#")
-        return out
-
     def test_verify_aesni_mb(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_verify_aesni_mb")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_verify_qat(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_verify_qat")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_verify_openssl_qat(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_verify_openssl_qat")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_verify_openssl(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_verify_openssl")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_latency_qat(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_latency_qat")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_latency_auth_qat(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_latency_auth_qat")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_latency_aead_qat(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_latency_aead_qat")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_latency_aesni_gcm(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str, crypto_func_opt_str, "test_latency_aesni_gcm")
-        self.verify(len(out) == 0, "Test function failed")
+        self._run_crypto_func()
 
     def test_latency_auth_aesni_mb(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str,crypto_func_opt_str,"test_latency_auth_aesni_mb")
-        self.verify(len(out) ==0 , "Test function failed")
+        self._run_crypto_func()
 
     def test_latency_aesni_mb(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_func_opt_str = self._get_crypto_perf_opt_str()
-        out = self._run_func(eal_opt_str,crypto_func_opt_str,"test_latency_aesni_mb")
-        self.verify(len(out) ==0 , "Test function failed")
+        self._run_crypto_func()
 
     def test_qat_aes_cbc_sha1_hmac(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_aes_cbc_sha1_hmac")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_aes_cbc_sha1_hmac(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_aes_cbc_sha1_hmac")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_aes_cbc_sha2_hmac(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_aes_cbc_sha2_hmac")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_aes_cbc_sha2_hmac(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_aes_cbc_sha2_hmac")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_aes_gcm(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_aes_gcm")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_aes_gcm(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_aes_gcm")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_encrypt_aes_docsisbpi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_encrypt_aes_docsisbpi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_encrypt_aes_docsisbpi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_encrypt_aes_docsisbpi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_decrypt_aes_docsisbpi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_decrypt_aes_docsisbpi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_decrypt_aes_docsisbpi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_decrypt_aes_docsisbpi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_kasumi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_kasumi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_kasumi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_kasumi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_snow3g(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_snow3g")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_snow3g(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_snow3g")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_qat_zuc(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self, {"vdev":None})
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "qat_zuc")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_sw_zuc(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "sw_zuc")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_scheduler_aes_cbc_sha1_hmac(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "scheduler_aes_cbc_sha1_hmac")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_scheduler_aes_cbc_sha2_hmac(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "scheduler_aes_cbc_sha2_hmac")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_scheduler_aes_gcm(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "scheduler_aes_gcm")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_scheduler_kasumi(self):
-        if cc.is_test_skip(self):
-            return
-
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "scheduler_kasumi")
-        self.verify(result, "Test failed")
+        self._run_crypto_perf_throughput()
 
     def test_scheduler_snow3g(self):
+        self._run_crypto_perf_throughput()
+
+    def test_scheduler_zuc(self):
+        self._run_crypto_perf_throughput()
+
+    # Private functions
+    def _run_crypto_func(self):
         if cc.is_test_skip(self):
             return
 
-        eal_opt_str = cc.get_eal_opt_str(self)
-        crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "scheduler_snow3g")
-        self.verify(result, "Test failed")
+        cores = ','.join(self.dut.get_core_list("1S/2C/1T"))
+        config = {'l': cores}
+        devices = self._get_crypto_device(1)
+        if not devices:
+            self.logger.info("can not get device or unsupported, skip.")
+            return
 
-    def test_scheduler_zuc(self):
+        config.update(devices)
+        eal_opt_str = cc.get_eal_opt_str(self, config)
+        crypto_func_opt_str = self._get_crypto_perf_opt_str()
+
+        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path,
+                                          eal_opt_str,
+                                          crypto_func_opt_str)
+        try:
+            self.dut.send_expect(cmd_str + ">%s/%s.txt" % (
+                self.dut_file_dir, self.running_case), "#", 600)
+        except Exception as ex:
+            self.logger.error(ex)
+            raise ex
+
+        out = self.dut.send_command("cat %s/%s.txt" % (
+            self.dut_file_dir, self.running_case), 30)
+
+        self.verify('Error' not in out, "Test function failed")
+        self.verify('failed' not in out, "Test function failed")
+
+    def _run_crypto_perf(self):
         if cc.is_test_skip(self):
             return
 
-        eal_opt_str = cc.get_eal_opt_str(self)
+        self.c_num, self.t_num = self._get_core_and_thread_num()
+        devices = self._get_crypto_device(self.t_num)
+        if not devices:
+            self.logger.info("can not get device or unsupported, skip.")
+            return
+
+        eal_opt_str = cc.get_eal_opt_str(self, devices)
         crypto_perf_opt_str = self._get_crypto_perf_opt_str()
-        result = self._run_crypto_perf_throughput(eal_opt_str,
-                                                  crypto_perf_opt_str,
-                                                  "scheduler_zuc")
-        self.verify(result, "Test failed")
 
-    # Private functions
+        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path,
+                                          eal_opt_str,
+                                          crypto_perf_opt_str)
+        try:
+            out = self.dut.send_expect(cmd_str, "#", 600)
+        except Exception as ex:
+            self.logger.error(ex)
+            raise ex
+
+        results = self._parse_output(out)
+
+        return results
+
     def _get_crypto_perf_opt_str(self, override_crypto_perf_opts={}):
         return cc.get_opt_str(self, self._default_crypto_perf_opts,
                               override_crypto_perf_opts)
@@ -456,16 +264,15 @@ class PerfTestsCryptodev(TestCase):
             line_nb = len(lines)
             self.logger.debug("Total output lines: " + str(line_nb))
 
-            # Find data line
             for line_index in range(line_nb):
                 if lines[line_index].startswith("    lcore id"):
                     self.logger.debug("data output line from: " + str(line_index))
                     break
-            data_line = line_index + 2
 
             results = []
             pattern = re.compile(r'\s+')
-            for line in lines[data_line:-1]:
+            for line in lines[line_index:]:
+                print(line)
                 result = {}
                 result_list = pattern.split(line.strip(" "))
                 if result_list[0] == "lcore id" or result_list[0] == "lcore" or not result_list[0]:
@@ -486,7 +293,7 @@ class PerfTestsCryptodev(TestCase):
             return results
         except Exception as ex:
             self.logger.error(ex)
-            raise ex
+            return []
 
     def _stat_results_by_buf_size(self, results):
         stats_results = {}
@@ -521,121 +328,180 @@ class PerfTestsCryptodev(TestCase):
         self.logger.debug(stats_results)
         return stats_results
 
-    def _run_crypto_perf(self, eal_opt_str, crypto_perf_opt_str):
-        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path,
-                                          eal_opt_str,
-                                          crypto_perf_opt_str)
-        self.logger.info(cmd_str)
-        try:
-            out = self.dut.send_expect(cmd_str, "#", 600)
-        except Exception as ex:
-            self.logger.error(ex)
-            raise ex
-
-        results = self._parse_output(out)
-
-        return results
-
     def _get_core_and_thread_num(self):
         cpu_info ={}
         out = self.dut.send_expect("lscpu", "#")
         for each_line in out.split('\n'):
+            if each_line.find(':') == -1:
+                continue
             key, value = each_line.split(':')
             cpu_info[key] = value.strip()
-
         core, thread = 0, 0
         lcores = self.get_case_cfg()["l"].split(",")
         for lcore in lcores[1:]:
-            if int(lcore) < int(cpu_info['Core(s) per socket']) * int(cpu_info['Socket(s)']):
+            if int(lcore.strip()) < int(cpu_info['Core(s) per socket']) * int(cpu_info['Socket(s)']):
                 core += 1
                 thread += 1
             elif int(lcore) < int(cpu_info['CPU(s)']):
                 thread += 1
         return core, thread
 
-    def _run_crypto_perf_throughput(self, eal_opt_str, crypto_perf_opt_str,
-                                    case_name):
-        c_num, t_num = self._get_core_and_thread_num()
-        try:
-            results = self._run_crypto_perf(eal_opt_str, crypto_perf_opt_str)
-
-            stats_results = self._stat_results_by_buf_size(results)
-            if not stats_results:
-                return False
-
-            json_result = []
-            for buf_size, values in list(stats_results.items()):
-                status, delta = "PASS", 0
-                # delta, status
-                if 'accepted_tolerance' in self.get_suite_cfg():
-                    self.accepted_gap = self.get_suite_cfg()['accepted_tolerance']
-                    self.expected_throughput =\
-                    self.get_suite_cfg()['expected_throughput'][case_name][buf_size]
-                    delta = (values["gbps"] - self.expected_throughput)/self.expected_throughput
-                    if abs(delta) > self.accepted_gap:
+    def _get_crypto_device(self, num):
+        device = {}
+        if self.get_case_cfg()["devtype"] == "crypto_aesni_mb":
+            dev = "crypto_aesni_mb"
+        elif self.get_case_cfg()["devtype"] == "crypto_qat":
+            w = cc.get_qat_devices(self, cpm_num=1, num=num)
+            device["w"] = ' -w '.join(w)
+            device["vdev"] = None
+        elif self.get_case_cfg()["devtype"] == "crypto_openssl":
+            dev = "crypto_openssl"
+        elif self.get_case_cfg()["devtype"] == "crypto_aesni_gcm":
+            dev = "crypto_aesni_gcm"
+        elif self.get_case_cfg()["devtype"] == "crypto_kasumi":
+            dev = "crypto_kasumi"
+        elif self.get_case_cfg()["devtype"] == "crypto_snow3g":
+            dev = "crypto_snow3g"
+        elif self.get_case_cfg()["devtype"] == "crypto_zuc":
+            dev = "crypto_zuc"
+        elif self.get_case_cfg()["devtype"] == "crypto_scheduler":
+            dev = "crypto_scheduler"
+            w = cc.get_qat_devices(self, cpm_num=3, num=num * 3)
+            if not w:
+                return {}
+            vdev_list = []
+            for i in range(num):
+                vdev = "{}{},slave={}_qat_sym,slave={}_qat_sym,slave={}_qat_sym,mode=round-robin".format(dev,
+                        i, w[i*3], w[i*3 + 1], w[i*3 + 2])
+                vdev_list.append(vdev)
+            device["w"] = ' -w '.join(w)
+            device["vdev"] = ' --vdev '.join(vdev_list)
+        else:
+            return {}
+
+        if not device:
+            vdev_list = []
+            for i in range(num):
+                vdev = "{}{}".format(dev, i)
+                vdev_list.append(vdev)
+            device["w"] = "0000:00:00.0"
+            device["vdev"] = ' --vdev '.join(vdev_list)
+
+        return device
+
+    def _run_crypto_perf_throughput(self):
+        results = self._run_crypto_perf()
+
+        stats_results = self._stat_results_by_buf_size(results)
+        json_result = []
+
+        framesizes = self.get_case_cfg()['buffer-sz'].split(',')
+        running_case = self.running_case
+        dut = self.dut.crb["IP"]
+        dut_index = self._suite_result.internals.index(dut)
+        target_index = self._suite_result.internals[dut_index+1].index(self.target)
+        suite_index = self._suite_result.internals[dut_index+1][target_index+2].index(self.suite_name)
+        case_index = self._suite_result.internals[dut_index+1][target_index+2][suite_index+1].index(running_case)
+        self._suite_result.internals[dut_index+1][target_index+2][suite_index+1].pop(case_index+1)
+        self._suite_result.internals[dut_index+1][target_index+2][suite_index+1].pop(case_index)
+
+        for buf_size in framesizes:
+            buf_size = int(buf_size)
+            status = "PASS"
+            self._suite_result.test_case = '_'.join([running_case,
+                str(buf_size), "{}C{}T".format(self.c_num, self.t_num)])
+            if buf_size in stats_results.keys():
+                try:
+                    values = stats_results[buf_size]
+                    perf_info = self.format_json(buf_size, values, status)
+                    json_result.append(perf_info)
+
+                    if perf_info['status'] == "PASS":
+                        self._suite_result.test_case_passed()
+                    else:
                         status = "FAIL"
+                        self._suite_result.test_case_failed("Test failed")
+                except Exception as ex:
+                    self.logger.error(ex)
+                    status = "FAIL"
+                    self._suite_result.test_case_failed("Test failed")
+            else:
+                status = "FAIL"
+                self._suite_result.test_case_failed("Test failed")
+
+        self._perf_result[self.running_case] = json_result
+        self.logger.debug(self._perf_result)
+        self.verify(status == "PASS", "Test Failed")
+
+    def format_json(self, buf_size, values, status="PASS"):
+        status, delta = "PASS", 0
+        # delta, status
+        if 'accepted_tolerance' in self.get_suite_cfg():
+            self.accepted_gap = self.get_suite_cfg()['accepted_tolerance']
+            if self.running_case in self.get_suite_cfg()['expected_throughput']:
+                self.expected_throughput =\
+                        self.get_suite_cfg()['expected_throughput'][self.running_case][buf_size]
+                delta = (values["gbps"] - self.expected_throughput)/self.expected_throughput
+                delta = round(delta, 4)
+            if abs(delta) > self.accepted_gap:
+                self.logger.warning("Failed, buf_size: {}, delta: {}, > accepted tolerance {}"\
+                        .format(buf_size, delta, self.accepted_gap))
+                status = "FAIL"
+
+        perf_info={
+                "status": status,
+                "performance":
+                [
+                    {
+                        "name": "throughput",
+                        "value": values["gbps"],
+                        "unit": "Gbps",
+                        "delta": delta
+                    },
+                    {
+                        "name":"failed_enq",
+                        "unit": "ops",
+                        "value": values["enqueue_failures"]
+                    },
+                    {
+                        "name":"failed_deq",
+                        "unit": "ops",
+                        "value": values["dequeue_failures"]
+                    },
+                    {
+                        "name":"throughput_mops",
+                        "unit": "Mops",
+                        "value": values["mops"]
+                    },
+                    {
+                        "name":"cycle_buf",
+                        "unit": "Cycles",
+                        "value": values["cycle_buf"]/values["nr"]
+                    },
+                ],
+                "parameters":
+                [
+                    {
+                        "name": "core_num/thread_num",
+                        "unit": "C/T",
+                        "value": "{}/{}".format(self.c_num, self.t_num)
+                    },
+                    {
+                        "name":"frame_size",
+                        "unit": "bytes",
+                        "value": buf_size
+                    },
+                    {
+                        "name":"burst_size",
+                        "unit": "bytes",
+                        "value": values["burst_size"]
+                    },
+                    {
+                        "name":"total_ops",
+                        "unit": "ops",
+                        "value": values["enqueue"]
+                    },
+                    ]
+                }
+        return perf_info
 
-                perf_info={
-                                "status": status,
-                                "performance":
-                                    [
-                                        {
-                                        "name": "throughput",
-                                        "value": values["gbps"],
-                                        "unit": "Gbps",
-                                        "delta": delta
-                                        },
-                                        {
-                                        "name":"failed_enq",
-                                        "unit": "ops",
-                                        "value": values["enqueue_failures"]
-                                        },
-                                        {
-                                        "name":"failed_deq",
-                                        "unit": "ops",
-                                        "value": values["dequeue_failures"]
-                                        },
-                                        {
-                                        "name":"throughput_mops",
-                                        "unit": "Mops",
-                                        "value": values["mops"]
-                                        },
-                                        {
-                                        "name":"cycle_buf",
-                                        "unit": "Cycles",
-                                        "value": values["cycle_buf"]/values["nr"]
-                                        },
-                                    ],
-                                "parameters":
-                                    [
-                                        {
-                                        "name": "core_num/thread_num",
-                                        "unit": "num/num",
-                                        "value": "{}/{}".format(c_num, t_num)
-                                        },
-                                        {
-                                        "name":"frame_size",
-                                        "unit": "bytes",
-                                        "value": buf_size
-                                        },
-                                        {
-                                        "name":"burst_size",
-                                        "unit": "bytes",
-                                        "value": values["burst_size"]
-                                        },
-                                        {
-                                        "name":"total_ops",
-                                        "unit": "ops",
-                                        "value": values["enqueue"]
-                                        },
-                                    ]
-                                }
-
-                self.logger.debug(perf_info)
-                json_result.append(perf_info)
-            self._perf_result[case_name] = json_result
-            self.logger.debug(self._perf_result)
-            return True
-        except Exception as ex:
-            self.logger.error(ex)
-            return False
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dts] [PATCH V1 4/6] tests/l2fwd_cryptodev_func: rework l2fwd_crypto test script
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
                   ` (2 preceding siblings ...)
  2020-06-04  0:54 ` [dts] [PATCH V1 3/6] tests/crypto_perf_cryptodev_perf: rework crypto_perf test script xinfengx
@ 2020-06-04  0:54 ` " xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 5/6] tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec " xinfengx
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

rework l2fwd_crypto test script
remove the redundant code
record more detailed test cases

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/TestSuite_l2fwd_cryptodev_func.py | 1036 +++++------------------
 1 file changed, 215 insertions(+), 821 deletions(-)

diff --git a/tests/TestSuite_l2fwd_cryptodev_func.py b/tests/TestSuite_l2fwd_cryptodev_func.py
index 4a8d31f..a40956e 100644
--- a/tests/TestSuite_l2fwd_cryptodev_func.py
+++ b/tests/TestSuite_l2fwd_cryptodev_func.py
@@ -52,9 +52,8 @@ import cryptodev_common as cc
 class TestL2fwdCrypto(TestCase):
 
     def set_up_all(self):
-
-        self.core_config = "1S/2C/1T"
-        self.number_of_ports = 1
+        self.core_config = "1S/3C/1T"
+        self.number_of_ports = 2
         self.dut_ports = self.dut.get_ports(self.nic)
         self.verify(len(self.dut_ports) >= self.number_of_ports,
                     "Not enough ports for " + self.nic)
@@ -65,13 +64,12 @@ class TestL2fwdCrypto(TestCase):
         self.logger.info("dut ports = " + str(self.dut_ports))
         self.logger.info("ports_socket = " + str(self.ports_socket))
 
-        self.core_mask = utils.create_mask(self.dut.get_core_list(
-                                         self.core_config,
-                                         socket=self.ports_socket))
-        self.port_mask = utils.create_mask([self.dut_ports[0]])
+        self.core_list = self.dut.get_core_list(self.core_config, socket=self.ports_socket)
+        self.core_mask = utils.create_mask(self.core_list)
+        self.port_mask = utils.create_mask([self.dut_ports[0], self.dut_ports[1]])
 
         self.tx_port = self.tester.get_local_port(self.dut_ports[0])
-        self.rx_port = self.tester.get_local_port(self.dut_ports[0])
+        self.rx_port = self.tester.get_local_port(self.dut_ports[1])
 
         self.tx_interface = self.tester.get_interface(self.tx_port)
         self.rx_interface = self.tester.get_interface(self.rx_port)
@@ -91,593 +89,190 @@ class TestL2fwdCrypto(TestCase):
 
         cc.bind_qat_device(self)
 
-
     def set_up(self):
         pass
 
     def test_qat_AES_XTS_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_AES_XTS_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_AES_XTS_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_AES_XTS_00")
 
     def test_qat_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_AES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_AES_CBC_00")
 
     def test_qat_AES_CTR_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_AES_CTR_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_AES_CTR_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_AES_CTR_00")
 
     def test_qat_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_AES_GCM_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_AES_GCM_00")
 
     def test_qat_AES_CCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_AES_CCM_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_AES_CCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_AES_CCM_00")
 
     def test_qat_h_MD_SHA_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_h_MD_SHA_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_h_MD_SHA_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_h_MD_SHA_00")
 
     def test_qat_h_AES_XCBC_MAC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_h_AES_XCBC_MAC_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_h_AES_XCBC_MAC_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_h_AES_XCBC_MAC_01")
 
     def test_qat_3DES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_3DES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_3DES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_3DES_CBC_00")
 
     def test_qat_3DES_CTR_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_3DES_CTR_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_3DES_CTR_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_3DES_CTR_00")
 
     def test_qat_AES_DOCSISBPI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_AES_DOCSISBPI_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_AES_DOCSISBPI_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_AES_DOCSISBPI_01")
 
     def test_qat_DES_DOCSISBPI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_DES_DOCSISBPI_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_DES_DOCSISBPI_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_DES_DOCSISBPI_01")
 
     def test_qat_SNOW3G_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_c_UEA2_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_c_UEA2_01"):
-            result = False
-
-        self.logger.info("Test qat_h_UIA2_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_h_UIA2_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_snow3g_00")
 
     def test_qat_KASUMI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_kasumi_c_F8_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_kasumi_c_F8_01"):
-            result = False
-
-        self.logger.info("Test qat_kasumi_h_F9_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_kasumi_h_F9_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_kasumi_00")
 
     def test_qat_ZUC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_c_EEA3_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_c_EEA3_01"):
-            result = False
-
-        self.logger.info("Test qat_h_EIA3_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_h_EIA3_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_zuc_00")
 
     def test_qat_NULL_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test qat_NULL_auto")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "qat_NULL_auto"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "qat_NULL_auto")
 
     def test_aesni_mb_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_AES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_AES_CBC_00")
 
     def test_aesni_mb_AES_CTR_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_AES_CTR_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_AES_CTR_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_AES_CTR_00")
 
     def test_aesni_mb_AES_DOCSISBPI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_AES_DOCSISBPI_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_AES_DOCSISBPI_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_AES_DOCSISBPI_01")
 
     def test_aesni_mb_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_aead_AES_GCM_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_aead_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
-
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_aead_AES_GCM_00")
 
     def test_aesni_mb_AES_CCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_AES_CCM_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_AES_CCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_AES_CCM_00")
 
     def test_aesni_gcm_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_gcm_aead_AES_GCM_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_gcm_aead_AES_GCM_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_gcm_aead_AES_GCM_01")
 
     def test_aesni_mb_h_MD_SHA_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_h_MD_SHA_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_h_MD_SHA_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_h_MD_SHA_00")
 
     def test_aesni_mb_3DES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_3DES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_3DES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_3DES_CBC_00")
 
     def test_kasumi_KASUMI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test kasumi_c_F8_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "kasumi_c_F8_01"):
-            result = False
-
-        self.logger.info("Test kasumi_h_F9_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "kasumi_h_F9_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "kasumi_kasumi_00")
 
     def test_null_NULL_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test null_NULL_auto")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "null_NULL_auto"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "null_NULL_auto")
 
     def test_snow3g_SNOW3G_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test snow3g_c_UEA2_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "snow3g_c_UEA2_01"):
-            result = False
-
-        self.logger.info("Test snow3g_h_UIA2_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "snow3g_h_UIA2_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "snow3g_snow3g_00")
 
     def test_zuc_ZUC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test zuc_c_EEA3_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "zuc_c_EEA3_01"):
-            result = False
-
-        self.logger.info("Test zuc_h_EIA3_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "zuc_h_EIA3_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "zuc_zuc_00")
 
-    # openssl pmd cases
     def test_openssl_3DES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_3DES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_3DES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_3DES_CBC_00")
 
     def test_openssl_3DES_CTR_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_3DES_CTR_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_3DES_CTR_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_3DES_CTR_00")
 
     def test_openssl_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_AES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_AES_CBC_00")
 
     def test_openssl_AES_CTR_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_AES_CTR_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_AES_CTR_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_AES_CTR_00")
 
     def test_openssl_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_AES_GCM_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_AES_GCM_00")
 
     def test_openssl_AES_CCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_AES_CCM_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_AES_CCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_AES_CCM_00")
 
     def test_openssl_h_MD_SHA_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_h_MD_SHA_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_h_MD_SHA_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_h_MD_SHA_00")
 
     def test_openssl_DES_DOCSISBPI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_DES_DOCSISBPI_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_DES_DOCSISBPI_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_DES_DOCSISBPI_01")
 
     def test_aesni_mb_DES_DOCSISBPI_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_DES_DOCSISBPI_01")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_DES_DOCSISBPI_01"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_DES_DOCSISBPI_01")
 
     def test_aesni_mb_DES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test aesni_mb_DES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "aesni_mb_DES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "aesni_mb_DES_CBC_00")
 
     def test_openssl_DES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test openssl_DES_CBC_00")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "openssl_DES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        self.__execute_l2fwd_crypto_test(test_vectors, "openssl_DES_CBC_00")
 
     def test_scheduler_rr_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_rr_AES_CBC")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_rr_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=3))
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=%s_qat_sym,slave=%s_qat_sym,\
+                mode=round-robin" % tuple(cc.get_qat_devices(self, num=3))
+        test_vectors["scheduler_AES_CBC_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_CBC_00"]['mode'] = "rr"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_CBC_00")
 
     def test_scheduler_rr_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_rr_AES_GCM")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_rr_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = "-w 0000:00:00.0 --vdev crypto_aesni_mb1,name=aesni_mb_1"
+        vdev += " --vdev crypto_aesni_mb2,name=aesni_mb_2"
+        vdev += " --vdev crypto_aesni_mb3,name=aesni_mb_3"
+        vdev += " --vdev crypto_scheduler0,slave=aesni_mb_1,slave=aesni_mb_2,slave=aesni_mb_3,mode=round-robin"
+        test_vectors["scheduler_AES_GCM_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_GCM_00"]['mode'] = "rr"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00")
 
     def test_scheduler_psb_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_psb_AES_CBC")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_psb_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=2))
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=%s_qat_sym,\
+                mode=packet-size-distr" % tuple(cc.get_qat_devices(self, num=2))
+        test_vectors["scheduler_AES_CBC_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_CBC_00"]['mode'] = "psb"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_CBC_00")
 
     def test_scheduler_psb_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_psb_AES_GCM")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_psb_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=1))
+        vdev += " --vdev crypto_aesni_mb1,name=aesni_mb_1"
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=aesni_mb_1,\
+                mode=packet-size-distr"% tuple(cc.get_qat_devices(self, num=1))
+        test_vectors["scheduler_AES_GCM_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_GCM_00"]['mode'] = "psb"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00")
 
     def test_scheduler_fo_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_fo_AES_CBC")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_fo_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=2))
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=%s_qat_sym,\
+                mode=fail-over" % tuple(cc.get_qat_devices(self, num=2))
+        test_vectors["scheduler_AES_CBC_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_CBC_00"]['mode'] = "fo"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_CBC_00")
 
     def test_scheduler_fo_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_fo_AES_GCM")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_fo_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=1))
+        vdev += " --vdev crypto_aesni_mb1,name=aesni_mb_1"
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=aesni_mb_1,\
+                mode=fail-over"% tuple(cc.get_qat_devices(self, num=1))
+        test_vectors["scheduler_AES_GCM_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_GCM_00"]['mode'] = "fo"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00")
 
     def test_scheduler_mm_AES_CBC_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_mm_AES_CBC")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_mm_AES_CBC_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=2))
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=%s_qat_sym\
+                mode=multi-core" % tuple(cc.get_qat_devices(self, num=2))
+        test_vectors["scheduler_AES_CBC_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_CBC_00"]['mode'] = "mm"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_CBC_00")
 
     def test_scheduler_mm_AES_GCM_auto(self):
-        if cc.is_test_skip(self):
-            return
-
-        result = True
-        self.logger.info("Test scheduler_mm_AES_GCM")
-        if not self.__execute_l2fwd_crypto_test(
-                test_vectors, "scheduler_mm_AES_GCM_00"):
-            result = False
-
-        self.verify(result, "Test failed")
+        vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=1))
+        vdev += " --vdev crypto_aesni_mb1,name=aesni_mb_1"
+        vdev += " --vdev crypto_scheduler0,slave=%s_qat_sym,slave=aesni_mb_1,\
+                mode=multi-core"% tuple(cc.get_qat_devices(self, num=1))
+        test_vectors["scheduler_AES_GCM_00"]['vdev'] = vdev
+        test_vectors["scheduler_AES_GCM_00"]['mode'] = "mm"
+        self.__execute_l2fwd_crypto_test(test_vectors, "scheduler_AES_GCM_00")
 
     def __calculate_total_cases_numb(self):
         alg_map = {}
@@ -736,6 +331,8 @@ class TestL2fwdCrypto(TestCase):
         self.logger.info("Total cases:\t\t\t {0}".format(count))
 
     def __execute_l2fwd_crypto_test(self, test_vectors, test_vector_name):
+        if cc.is_test_skip(self):
+            return
 
         if test_vector_name not in test_vectors:
             self.logger.warning("SKIP : " + test_vector_name)
@@ -747,21 +344,34 @@ class TestL2fwdCrypto(TestCase):
                            core_mask=self.core_mask,
                            port_mask=self.port_mask)
 
-        result = True
         self.logger.info("Total Generated {0} Tests".format(len(test_vector_list)))
+
+        running_case = self.running_case
+        dut = self.dut.crb["IP"]
+        dut_index = self._suite_result.internals.index(dut)
+        target_index = self._suite_result.internals[dut_index+1].index(self.target)
+        suite_index = self._suite_result.internals[dut_index+1][target_index+2].index(self.suite_name)
+        if running_case in self._suite_result.internals[dut_index+1][target_index+2][suite_index+1]:
+            case_index = self._suite_result.internals[dut_index+1][target_index+2][suite_index+1].index(running_case)
+            self._suite_result.internals[dut_index+1][target_index+2][suite_index+1].pop(case_index+1)
+            self._suite_result.internals[dut_index+1][target_index+2][suite_index+1].pop(case_index)
+
         for test_vector in test_vector_list:
+            result = True
             self.logger.debug(test_vector)
+            self.vector = []
             cmd_str = self.__test_vector_to_cmd(test_vector,
                                                 core_mask=self.core_mask,
                                                 port_mask=self.port_mask)
+            self._suite_result.test_case = '_'.join(self.vector)
             self.dut.send_expect(cmd_str, "==", 40)
             time.sleep(5)
 
             payload = self.__format_hex_to_list(test_vector["input"])
 
             inst = self.tester.tcpdump_sniff_packets(self.rx_interface,
-                                                     filters=[{'layer': 'ether',
-                                                     'config': {'dst': '52:00:00:00:00:01'}}])
+                    filters=[{'layer': 'ether',
+                        'config': {'dst': '52:00:00:00:00:01'}}])
 
             PACKET_COUNT = 65
             pkt = Packet()
@@ -772,7 +382,10 @@ class TestL2fwdCrypto(TestCase):
             pkt.send_pkt(self.tester, tx_port=self.tx_interface, count=PACKET_COUNT)
 
             pkt_rec = self.tester.load_tcpdump_sniff_packets(inst)
+
+            self.logger.info("Send pkgs: {}".format(PACKET_COUNT))
             self.logger.info("Receive pkgs: {}".format(len(pkt_rec)))
+            self.verify(len(pkt_rec), "Can not receive any package")
             for i in range(len(pkt_rec)):
                 packet_hex = pkt_rec[i]["Raw"].getfieldval("load")
                 if packet_hex == None:
@@ -814,12 +427,12 @@ class TestL2fwdCrypto(TestCase):
             # Close l2fwd-crypto process
             self.dut.kill_all()
 
-        if result:
-            self.logger.info("PASSED")
-        else:
-            self.logger.info("FAILED")
+            if result:
+                self._suite_result.test_case_passed()
+            else:
+                self._suite_result.test_case_failed("Test failed")
 
-        return result
+        self.verify(result, "Test Failed")
 
     def tear_down(self):
         self.dut.kill_all()
@@ -828,20 +441,30 @@ class TestL2fwdCrypto(TestCase):
         cc.clear_dpdk_config(self)
 
     def __test_vector_to_cmd(self, test_vector, core_mask="", port_mask=""):
-
-        eal_opt_str = cc.get_eal_opt_str(self, add_port=True)
+        cores = ','.join(self.core_list)
+        eal_opt_str = cc.get_eal_opt_str(self, {'l': cores}, add_port=True)
 
         EAL_SEP = " --"
         PORT_MASK = "" if port_mask == "" else " -p " + port_mask
         QUEUE_NUM = ""
 
         vdev = ""
-        if self.__check_field_in_vector(test_vector, "vdev"):
-            vdev = " --vdev " + test_vector["vdev"]
+        if test_vector["vdev"].find("scheduler") != -1:
+            vdev = test_vector["vdev"]
+            self.vector.append("Scheduler_" + test_vector["mode"])
+        elif self.__check_field_in_vector(test_vector, "vdev"):
+            vdev = "--vdev " + test_vector["vdev"] + "1" +\
+                    " --vdev " + test_vector["vdev"] + "2" +\
+                    " -w 0000:00:00.0"
+            self.vector.append(test_vector["vdev"].upper())
+        else:
+            vdev = '-w ' + ' -w '.join(cc.get_qat_devices(self, num=2))
+            self.vector.append("QAT")
 
         chain = ""
         if self.__check_field_in_vector(test_vector, "chain"):
             chain = " --chain " + test_vector["chain"]
+            self.vector.append(test_vector["chain"].lower())
 
         cdev_type = ""
         if self.__check_field_in_vector(test_vector, "cdev_type"):
@@ -858,64 +481,74 @@ class TestL2fwdCrypto(TestCase):
         aad = ""
         iv = ""
         digest_size = ""
+
         if test_vector["chain"].upper() == "AEAD":
             if self.__check_field_in_vector(test_vector, "cipher_algo"):
                 cipher_algo = " --aead_algo " + test_vector["cipher_algo"]
-
+                self.vector.append(test_vector["cipher_algo"])
             if self.__check_field_in_vector(test_vector, "cipher_op"):
                 cipher_op = " --aead_op " + test_vector["cipher_op"]
-
+                self.vector.append(test_vector["cipher_op"].lower())
             if self.__check_field_in_vector(test_vector, "cipher_key"):
                 cipher_key = " --aead_key " + self.__format_hex_to_param(test_vector["cipher_key"])
-
+                self.vector.append("aead_key_%d" % (len(test_vector["cipher_key"])//2))
             if self.__check_field_in_vector(test_vector, "iv"):
                 iv = " --aead_iv " + self.__format_hex_to_param(test_vector["iv"])
+                self.vector.append('iv_%d' % (len(test_vector["iv"])//2))
             if self.__check_field_in_vector(test_vector, "aad"):
                 aad = " --aad " + self.__format_hex_to_param(test_vector["aad"])
-
+                self.vector.append('aad_%d' % (len(test_vector["aad"])//2))
             if self.__check_field_in_vector(test_vector, "digest_size"):
                 digest_size = " --digest " + str(test_vector["digest_size"])
-
+                self.vector.append('digest_%d' % test_vector["digest_size"])
         else:
             if self.__check_field_in_vector(test_vector, "cipher_algo"):
                 cipher_algo = " --cipher_algo " + test_vector["cipher_algo"]
-
+                self.vector.append(test_vector["cipher_algo"])
             if self.__check_field_in_vector(test_vector, "cipher_op"):
                 cipher_op = " --cipher_op " + test_vector["cipher_op"]
+                self.vector.append(test_vector["cipher_op"].lower())
 
             if self.__check_field_in_vector(test_vector, "cipher_key"):
                 cipher_key = " --cipher_key " + self.__format_hex_to_param(test_vector["cipher_key"])
-
+                self.vector.append('cipher_key_%d' % (len(test_vector["cipher_key"])//2))
             if self.__check_field_in_vector(test_vector, "iv"):
                 iv = " --cipher_iv " + self.__format_hex_to_param(test_vector["iv"])
+                self.vector.append('cipher_iv_%d' % (len(test_vector["iv"])//2))
 
             if self.__check_field_in_vector(test_vector, "auth_algo"):
                 auth_algo = " --auth_algo " + test_vector["auth_algo"]
+                self.vector.append(test_vector["auth_algo"])
 
             if self.__check_field_in_vector(test_vector, "auth_op"):
                 auth_op = " --auth_op " + test_vector["auth_op"]
+                self.vector.append(test_vector["auth_op"].lower())
 
             if self.__check_field_in_vector(test_vector, "auth_key"):
                 auth_key = " --auth_key " + self.__format_hex_to_param(test_vector["auth_key"])
+                self.vector.append('auth_key_%d' % (len(test_vector["auth_key"])//2))
 
             if self.__check_field_in_vector(test_vector, "auth_key_random_size"):
                 auth_key_random_size = " --auth_key_random_size " + test_vector["auth_key_random_size"]
+                self.vector.append('auth_key_random_size_%d' % len(test_vector["auth_key_random_size"]))
 
             if self.__check_field_in_vector(test_vector, "aad"):
                 aad = " --auth_iv " + self.__format_hex_to_param(test_vector["aad"])
+                self.vector.append('auth_iv_%d' % (len(test_vector["aad"])//2))
 
             if self.__check_field_in_vector(test_vector, "aad_random_size"):
                 aad_random_size = " --aad_random_size " + test_vector["aad_random_size"]
+                self.vector.append('aad_random_size_%d' % len(test_vector["aad_random_size"]))
 
             if self.__check_field_in_vector(test_vector, "digest_size"):
                 digest_size = " --digest " + str(test_vector["digest_size"])
+                self.vector.append('digest_%d' % test_vector["digest_size"])
 
-        cmd_str = " ".join([self._app_path, eal_opt_str, vdev, vdev, EAL_SEP, PORT_MASK,
+        cmd_str = " ".join([self._app_path, eal_opt_str, vdev, EAL_SEP, PORT_MASK,
                             QUEUE_NUM, chain, cdev_type, cipher_algo,
                             cipher_op, cipher_key, iv, auth_algo, auth_op,
                             auth_key, auth_key_random_size, aad,
                             aad_random_size, digest_size, "--no-mac-updating"])
-
         return cmd_str
 
     def __check_field_in_vector(self, test_vector, field_name):
@@ -989,6 +622,7 @@ class TestL2fwdCrypto(TestCase):
     def __cryptography_cipher(self, vector):
         key = binascii.a2b_hex(vector["cipher_key"])
         iv = binascii.a2b_hex(vector["iv"])
+
         cipher_str = ""
         if vector["chain"].upper() != "AEAD":
             if vector["cipher_algo"] == "aes-cbc":
@@ -1006,7 +640,6 @@ class TestL2fwdCrypto(TestCase):
             elif vector["cipher_algo"] == "aes-xts":
                 cipher_algo = algorithms.AES(key)
                 cipher_mode = modes.XTS(iv)
-
             elif vector["cipher_algo"] == "des-cbc":
                 cipher = pyDes.des(key, pyDes.CBC, iv)
                 if vector["cipher_op"] == "DECRYPT":
@@ -1202,6 +835,7 @@ class TestL2fwdCrypto(TestCase):
             key = binascii.a2b_hex(vector["cipher_key"])
             iv = binascii.a2b_hex(vector["iv"])
             aesgcm = AESGCM(key)
+
             hash_str = aesgcm.encrypt(iv,
                                       binascii.a2b_hex(vector["input"]),
                                       binascii.a2b_hex(vector["aad"]))
@@ -1291,20 +925,18 @@ class TestL2fwdCrypto(TestCase):
                     },
                 "aes-gcm": {
                     "cipher_key": [16, 24, 32],
-                    "auth_key": [16, 24, 32],
                     "aad": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, 32, 64, 128, 155, 256, 1024, 65535],
-                    "iv": [12, 16],
+                    "iv": [12],
                     "digest_size": [8,12,16]
                     },
                 "aes-ccm": {
                     "cipher_key": [16, 24, 32],
-                    "auth_key": [16, 24, 32],
                     "aad": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, 32, 64, 128, 155, 256, 1024, 65535],
                     "iv": [7, 8, 9, 10, 11, 12, 13],
                     "digest_size": [4, 6, 8, 10, 12, 14, 16]
                 },
                 "aes-docsisbpi": {
-                    "cipher_key": [16],
+                    "cipher_key": [16, 32],
                     "iv": [16],
                     },
                 "des-docsisbpi": {
@@ -1515,7 +1147,7 @@ class TestL2fwdCrypto(TestCase):
 
     def __iter_auth_algo(self, vector, vector_list, core_mask="", port_mask=""):
         test_vector = vector.copy()
-        if test_vector["chain"] == "CIPHER_ONLY":
+        if test_vector["chain"] in ["CIPHER_ONLY", "AEAD"]:
             test_vector["auth_algo"] = ""
             self.__iter_auth_op(test_vector, vector_list, core_mask, port_mask)
         else:
@@ -1527,7 +1159,7 @@ class TestL2fwdCrypto(TestCase):
 
     def __iter_auth_op(self, vector, vector_list, core_mask="", port_mask=""):
         test_vector = vector.copy()
-        if test_vector["chain"] == "CIPHER_ONLY":
+        if test_vector["chain"] in ["CIPHER_ONLY", "AEAD"]:
             test_vector["auth_op"] = ""
             self.__iter_auth_key(test_vector, vector_list, core_mask, port_mask)
         else:
@@ -1541,7 +1173,7 @@ class TestL2fwdCrypto(TestCase):
 
     def __iter_auth_key(self, vector, vector_list, core_mask="", port_mask=""):
         test_vector = vector.copy()
-        if test_vector["chain"] == "CIPHER_ONLY":
+        if test_vector["chain"] in ["CIPHER_ONLY", "AEAD"]:
             test_vector["auth_key"] = ""
             self.__iter_aad(test_vector, vector_list, core_mask, port_mask)
         else:
@@ -1570,9 +1202,10 @@ class TestL2fwdCrypto(TestCase):
             for aad in aad_list:
                 test_vector = vector.copy()
                 if isinstance(aad, int):
-                    if self.__is_valid_size("aad",
-                            test_vector["auth_algo"],
-                            aad):
+                    if self.__is_valid_size("aad", test_vector["auth_algo"], aad) or\
+                            (test_vector["chain"] == "AEAD" and\
+                            self.__is_valid_size("aad", test_vector["cipher_algo"],
+                            aad)):
                         test_vector["aad"] = self.__gen_key(aad)
                         self.__digest_size(test_vector, vector_list,
                                 core_mask, port_mask)
@@ -1593,9 +1226,10 @@ class TestL2fwdCrypto(TestCase):
             for digest in digest_list:
                 test_vector = vector.copy()
                 if isinstance(digest, int):
-                    if self.__is_valid_size("digest_size",
-                            test_vector["auth_algo"],
-                            digest):
+                    if self.__is_valid_size("digest_size", test_vector["auth_algo"], digest)\
+                            or (test_vector["chain"] == "AEAD" and\
+                            self.__is_valid_size("digest_size", test_vector["cipher_algo"],
+                            digest)):
                         test_vector["digest_size"] = digest
                         self.__iter_input(test_vector, vector_list,
                                           core_mask, port_mask)
@@ -1686,7 +1320,7 @@ test_vectors = {
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
@@ -1706,7 +1340,7 @@ test_vectors = {
         "aad": [8],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
@@ -1821,9 +1455,9 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "output_hash": "*"
     },
 
-    "qat_c_UEA2_01": {
+    "qat_snow3g_00": {
         "vdev": "",
-        "chain": ["CIPHER_ONLY"],
+        "chain": ["CIPHER_ONLY", "HASH_ONLY"],
         "cdev_type": "HW",
         "cipher_algo": ["snow3g-uea2"],
         "cipher_op": ["ENCRYPT"],
@@ -1836,34 +1470,14 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": "",
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "qat_h_UIA2_01": {
-        "vdev": "",
-        "chain": ["HASH_ONLY"],
-        "cdev_type": "HW",
-        "cipher_algo": "",
-        "cipher_op": "",
-        "cipher_key": "",
-        "iv": "",
-        "auth_algo": ["snow3g-uia2"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
         "digest_size": [4],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
-    "qat_kasumi_c_F8_01": {
+    "qat_kasumi_00": {
         "vdev": "",
-        "chain": ["CIPHER_ONLY"],
+        "chain": ["CIPHER_ONLY", "HASH_ONLY"],
         "cdev_type": "HW",
         "cipher_algo": ["kasumi-f8"],
         "cipher_op": ["ENCRYPT"],
@@ -1873,26 +1487,6 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "auth_op": ["GENERATE"],
         "auth_key": [16],
         "auth_key_random_size": "",
-        "aad": [8],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": "",
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "qat_kasumi_h_F9_01": {
-        "vdev": "",
-        "chain": ["HASH_ONLY"],
-        "cdev_type": "HW",
-        "cipher_algo": "",
-        "cipher_op": "",
-        "cipher_key": "",
-        "iv": "",
-        "auth_algo": ["kasumi-f9"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
         "aad": "",
         "aad_random_size": "",
         "input": [256],
@@ -1901,9 +1495,9 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "output_hash": "*"
     },
 
-    "qat_c_EEA3_01": {
+    "qat_zuc_00": {
         "vdev": "",
-        "chain": ["CIPHER_ONLY"],
+        "chain": ["CIPHER_ONLY", "HASH_ONLY"],
         "cdev_type": "HW",
         "cipher_algo": ["zuc-eea3"],
         "cipher_op": ["ENCRYPT"],
@@ -1916,26 +1510,6 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": "",
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "qat_h_EIA3_01": {
-        "vdev": "",
-        "chain": ["HASH_ONLY"],
-        "cdev_type": "HW",
-        "cipher_algo": "",
-        "cipher_op": "",
-        "cipher_key": "",
-        "iv": "",
-        "auth_algo": ["zuc-eia3"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
         "digest_size": [4],
         "output_cipher": "*",
         "output_hash": "*"
@@ -2038,7 +1612,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [8],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
@@ -2092,20 +1666,20 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "cipher_op": ["ENCRYPT"],
         "cipher_key": [16, 24, 32],
         "iv": [12],
-        "auth_algo": ["aes-gcm", "aes-gmac"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
+        "auth_algo": ["aes-gcm"],
+        "auth_op": "",
+        "auth_key": "",
         "auth_key_random_size": "",
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
     "null_NULL_auto": {
-        "vdev": "crypto_null_pmd",
+        "vdev": "crypto_null",
         "chain": ["CIPHER_ONLY", "HASH_ONLY", "CIPHER_HASH"],
         "cdev_type": "SW",
         "cipher_algo": ["null"],
@@ -2126,7 +1700,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "aesni_gcm_aead_AES_GCM_01": {
-        "vdev": "crypto_aesni_gcm_pmd",
+        "vdev": "crypto_aesni_gcm",
         "chain": ["AEAD"],
         "cdev_type": "SW",
         "cipher_algo": ["aes-gcm"],
@@ -2140,13 +1714,13 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
     "aesni_gcm_aead_AES_CCM_01": {
-        "vdev": "crypto_aesni_gcm_pmd",
+        "vdev": "crypto_aesni_gcm",
         "chain": ["AEAD"],
         "cdev_type": "SW",
         "cipher_algo": ["aes-ccm"],
@@ -2160,14 +1734,14 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
-    "kasumi_c_F8_01": {
-        "vdev": "crypto_kasumi_pmd",
-        "chain": ["CIPHER_ONLY"],
+    "kasumi_kasumi_00": {
+        "vdev": "crypto_kasumi",
+        "chain": ["CIPHER_ONLY", "HASH_ONLY"],
         "cdev_type": "SW",
         "cipher_algo": ["kasumi-f8"],
         "cipher_op": ["ENCRYPT"],
@@ -2177,26 +1751,6 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "auth_op": ["GENERATE"],
         "auth_key": [16],
         "auth_key_random_size": "",
-        "aad": [8],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": "",
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "kasumi_h_F9_01": {
-        "vdev": "crypto_kasumi_pmd",
-        "chain": ["HASH_ONLY"],
-        "cdev_type": "SW",
-        "cipher_algo": "",
-        "cipher_op": "",
-        "cipher_key": "",
-        "iv": "",
-        "auth_algo": ["kasumi-f9"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
         "aad": "",
         "aad_random_size": "",
         "input": [256],
@@ -2205,9 +1759,9 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "output_hash": "*"
     },
 
-    "snow3g_c_UEA2_01": {
-        "vdev": "crypto_snow3g_pmd",
-        "chain": ["CIPHER_ONLY"],
+    "snow3g_snow3g_00": {
+        "vdev": "crypto_snow3g",
+        "chain": ["CIPHER_ONLY", "HASH_ONLY"],
         "cdev_type": "SW",
         "cipher_algo": ["snow3g-uea2"],
         "cipher_op": ["ENCRYPT"],
@@ -2220,34 +1774,14 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": "",
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "snow3g_h_UIA2_01": {
-        "vdev": "crypto_snow3g_pmd",
-        "chain": ["HASH_ONLY"],
-        "cdev_type": "SW",
-        "cipher_algo": "",
-        "cipher_op": "",
-        "cipher_key": "",
-        "iv": "",
-        "auth_algo": ["snow3g-uia2"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
         "digest_size": [4],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
-    "zuc_c_EEA3_01": {
-        "vdev": "crypto_zuc_pmd",
-        "chain": ["CIPHER_ONLY"],
+    "zuc_zuc_00": {
+        "vdev": "crypto_zuc",
+        "chain": ["CIPHER_ONLY", "HASH_ONLY"],
         "cdev_type": "SW",
         "cipher_algo": ["zuc-eea3"],
         "cipher_op": ["ENCRYPT"],
@@ -2260,33 +1794,13 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": "",
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "zuc_h_EIA3_01": {
-        "vdev": "crypto_zuc_pmd",
-        "chain": ["HASH_ONLY"],
-        "cdev_type": "SW",
-        "cipher_algo": "",
-        "cipher_op": "",
-        "cipher_key": "",
-        "iv": "",
-        "auth_algo": ["zuc-eia3"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
         "digest_size": [4],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
     "openssl_3DES_CBC_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
         "cdev_type": "SW",
         "cipher_algo": ["3des-cbc"],
@@ -2306,7 +1820,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_3DES_CTR_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
         "cdev_type": "SW",
         "cipher_algo": ["3des-ctr"],
@@ -2332,7 +1846,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_AES_CBC_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
         "cdev_type": "SW",
         "cipher_algo": ["aes-cbc"],
@@ -2352,7 +1866,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_AES_CTR_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
         "cdev_type": "SW",
         "cipher_algo": ["aes-ctr"],
@@ -2372,7 +1886,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_AES_GCM_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["AEAD"],
         "cdev_type": "SW",
         "cipher_algo": ["aes-gcm"],
@@ -2393,7 +1907,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_AES_CCM_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["AEAD"],
         "cdev_type": "SW",
         "cipher_algo": ["aes-ccm"],
@@ -2407,13 +1921,13 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "aad": [16],
         "aad_random_size": "",
         "input": [256],
-        "digest_size": [16],
+        "digest_size": [8, 16],
         "output_cipher": "*",
         "output_hash": "*"
     },
 
     "openssl_h_MD_SHA_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["HASH_ONLY"],
         "cdev_type": "SW",
         "cipher_algo": "",
@@ -2494,7 +2008,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_DES_DOCSISBPI_01": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["CIPHER_ONLY"],
         "cdev_type": "SW",
         "cipher_algo": "des-docsisbpi",
@@ -2554,7 +2068,7 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
     },
 
     "openssl_DES_CBC_00": {
-        "vdev": "crypto_openssl_pmd",
+        "vdev": "crypto_openssl",
         "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
         "cdev_type": "SW",
         "cipher_algo": ["des-cbc"],
@@ -2573,135 +2087,15 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "output_hash": "*"
     },
 
-    "scheduler_rr_AES_CBC_00": {
-        "vdev": "crypto_scheduler_rr",
-        "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
-        "cdev_type": "HW",
-        "cipher_algo": ["aes-cbc"],
-        "cipher_op": ["ENCRYPT"],
-        "cipher_key": [16],
-        "iv": [16],
-        "auth_algo": ["sha1-hmac", "sha2-256-hmac"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [64],
-        "auth_key_random_size": "",
-        "aad": [0],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": [20, 32],
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "scheduler_rr_AES_GCM_00": {
-        "vdev": "crypto_scheduler_rr",
-        "chain": ["AEAD"],
-        "cdev_type": "HW",
-        "cipher_algo": ["aes-gcm"],
-        "cipher_op": ["ENCRYPT"],
-        "cipher_key": [16, 24, 32],
-        "iv": [12],
-        "auth_algo": ["aes-gcm"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": [16],
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "scheduler_psb_AES_CBC_00": {
-        "vdev": "crypto_scheduler_psb",
-        "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
-        "cdev_type": "SW",
-        "cipher_algo": ["aes-cbc"],
-        "cipher_op": ["ENCRYPT", "DECRYPT"],
-        "cipher_key": [16],
-        "iv": [16],
-        "auth_algo": ["sha1-hmac", "sha2-256-hmac"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [64],
-        "auth_key_random_size": "",
-        "aad": [0],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": [20, 32],
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "scheduler_psb_AES_GCM_00": {
-        "vdev": "crypto_scheduler_psb",
-        "chain": ["AEAD"],
-        "cdev_type": "SW",
-        "cipher_algo": ["aes-gcm"],
-        "cipher_op": ["ENCRYPT"],
-        "cipher_key": [16, 24, 32],
-        "iv": [12],
-        "auth_algo": ["aes-gcm"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": [16],
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "scheduler_fo_AES_CBC_00": {
-        "vdev": "crypto_scheduler_fo",
-        "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
-        "cdev_type": "SW",
-        "cipher_algo": ["aes-cbc"],
-        "cipher_op": ["ENCRYPT", "DECRYPT"],
-        "cipher_key": [16],
-        "iv": [16],
-        "auth_algo": ["sha1-hmac", "sha2-256-hmac"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [64],
-        "auth_key_random_size": "",
-        "aad": [0],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": [20, 32],
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "scheduler_fo_AES_GCM_00": {
-        "vdev": "crypto_scheduler_fo",
-        "chain": ["AEAD"],
-        "cdev_type": "SW",
-        "cipher_algo": ["aes-gcm"],
-        "cipher_op": ["ENCRYPT"],
-        "cipher_key": [16, 24, 32],
-        "iv": [12],
-        "auth_algo": ["aes-gcm"],
-        "auth_op": ["GENERATE"],
-        "auth_key": [16],
-        "auth_key_random_size": "",
-        "aad": [16],
-        "aad_random_size": "",
-        "input": [256],
-        "digest_size": [16],
-        "output_cipher": "*",
-        "output_hash": "*"
-    },
-
-    "scheduler_mm_AES_CBC_00": {
-        "vdev": "crypto_scheduler_mm",
-        "chain": ["CIPHER_ONLY", "CIPHER_HASH"],
-        "cdev_type": "SW",
+    "scheduler_AES_CBC_00": {
+        "vdev": "crypto_scheduler",
+        "chain": ["CIPHER_HASH"],
+        "cdev_type": "ANY",
         "cipher_algo": ["aes-cbc"],
         "cipher_op": ["ENCRYPT", "DECRYPT"],
         "cipher_key": [16],
         "iv": [16],
-        "auth_algo": ["sha1-hmac", "sha2-256-hmac"],
+        "auth_algo": ["sha1-hmac"],
         "auth_op": ["GENERATE"],
         "auth_key": [64],
         "auth_key_random_size": "",
@@ -2713,10 +2107,10 @@ fc2ab337f7031a0f20636c82074a6bebcf91f06e04d45fa1dcc8454b6be54e53e3f9c99f0f830b16
         "output_hash": "*"
     },
 
-    "scheduler_mm_AES_GCM_00": {
-        "vdev": "crypto_scheduler_mm",
+    "scheduler_AES_GCM_00": {
+        "vdev": "crypto_scheduler",
         "chain": ["AEAD"],
-        "cdev_type": "SW",
+        "cdev_type": "ANY",
         "cipher_algo": ["aes-gcm"],
         "cipher_op": ["ENCRYPT"],
         "cipher_key": [16, 24, 32],
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dts] [PATCH V1 5/6] tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec test script
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
                   ` (3 preceding siblings ...)
  2020-06-04  0:54 ` [dts] [PATCH V1 4/6] tests/l2fwd_cryptodev_func: rework l2fwd_crypto " xinfengx
@ 2020-06-04  0:54 ` " xinfengx
  2020-06-04  0:54 ` [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit " xinfengx
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

rework cryptodev ipsec test script
remove the redundant code

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/TestSuite_ipsec_gw_cryptodev_func.py | 624 ++++-----------------
 1 file changed, 97 insertions(+), 527 deletions(-)

diff --git a/tests/TestSuite_ipsec_gw_cryptodev_func.py b/tests/TestSuite_ipsec_gw_cryptodev_func.py
index c6bf6a9..de123dc 100644
--- a/tests/TestSuite_ipsec_gw_cryptodev_func.py
+++ b/tests/TestSuite_ipsec_gw_cryptodev_func.py
@@ -29,36 +29,29 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import hmac
-import hashlib
 import binascii
 import time
 import utils
 from test_case import TestCase
 import packet
 
-from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
-from cryptography.hazmat.primitives.ciphers.aead import AESCCM, AESGCM
-from cryptography.hazmat.backends import default_backend
-
 import cryptodev_common as cc
 
 class TestIPsecGW(TestCase):
 
     def set_up_all(self):
-
-        self.core_config = "1S/2C/1T"
-        self.number_of_ports = 1
+        self.core_config = "1S/3C/1T"
+        self.number_of_ports = 2
         self.dut_ports = self.dut.get_ports(self.nic)
         self.verify(len(self.dut_ports) >= self.number_of_ports,
                     "Not enough ports for " + self.nic)
         self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        self.core_list = self.dut.get_core_list(self.core_config, socket=self.ports_socket)
 
         self.logger.info("core config = " + self.core_config)
         self.logger.info("number of ports = " + str(self.number_of_ports))
         self.logger.info("dut ports = " + str(self.dut_ports))
         self.logger.info("ports_socket = " + str(self.ports_socket))
-
         # Generally, testbed should has 4 ports NIC, like,
         # 03:00.0 03:00.1 03:00.2 03:00.3
         # This test case will
@@ -83,22 +76,18 @@ class TestIPsecGW(TestCase):
         self.verify("Error"not in out,"Compilation error")
         self.verify("No such"not in out,"Compilation error")
 
-        self.vf_driver = self.get_suite_cfg()['vf_driver']
-        cc.bind_qat_device(self, self.vf_driver)
+        cc.bind_qat_device(self)
 
         self._default_ipsec_gw_opts = {
-            "config": None,
+            "config": '"(0,0,%s),(1,0,%s)"' % tuple(self.core_list[-2:]),
             "P": "",
             "p": "0x3",
-            "f": "conf/ipsec_ep0.cfg",
+            "f": "/tmp/ipsec_ep0.cfg",
             "u": "0x1"
         }
 
-        self._pcap_idx = 0
-        self.pcap_filename = ''
-
         conf_file = r'conf/ipsec_ep0.cfg'
-        self.dut.session.copy_file_to(conf_file)
+        self.dut.session.copy_file_to(conf_file, '/tmp')
 
     def set_up(self):
         pass
@@ -110,604 +99,181 @@ class TestIPsecGW(TestCase):
         cc.clear_dpdk_config(self)
 
     def test_qat_aes_128_cbc_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_cbc_ipv4_tunnel")
-        self.pcap_filename = "test_qat_aes_128_cbc_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_256_cbc_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_256_cbc_ipv4_tunnel")
-        self.pcap_filename = "test_qat_aes_256_cbc_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_gcm_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_gcm_ipv4_tunnel")
-        self.pcap_filename = "test_qat_aes_gcm_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_ctr_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_ctr_ipv4_tunnel")
-        self.pcap_filename = "test_qat_aes_128_ctr_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_ctr_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_ctr_ipv6_tunnel")
-        self.pcap_filename = "test_qat_aes_128_ctr_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_ctr_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_ctr_ipv4_transport")
-        self.pcap_filename = "test_qat_aes_128_ctr_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_ctr_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_ctr_ipv6_transport")
-        self.pcap_filename = "test_qat_aes_128_ctr_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_null_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_null_ipv4_tunnel")
-        self.pcap_filename = "test_qat_null_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_cbc_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_cbc_ipv4_transport")
-        self.pcap_filename = "test_qat_aes_128_cbc_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_256_cbc_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_256_cbc_ipv4_transport")
-        self.pcap_filename = "test_qat_aes_256_cbc_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_gcm_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_gcm_ipv4_transport")
-        self.pcap_filename = "test_qat_aes_gcm_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_null_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_null_ipv4_transport")
-        self.pcap_filename = "test_qat_null_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
-
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_cbc_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_cbc_ipv6_tunnel")
-        self.pcap_filename = "test_qat_aes_128_cbc_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_256_cbc_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_256_cbc_ipv6_tunnel")
-        self.pcap_filename = "test_qat_aes_256_cbc_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_gcm_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_gcm_ipv6_tunnel")
-        self.pcap_filename = "test_qat_aes_gcm_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_null_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_null_ipv6_tunnel")
-        self.pcap_filename = "test_qat_null_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_128_cbc_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_128_cbc_ipv6_transport")
-        self.pcap_filename = "test_qat_aes_128_cbc_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_256_cbc_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_256_cbc_ipv6_transport")
-        self.pcap_filename = "test_qat_aes_256_cbc_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_aes_gcm_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_aes_gcm_ipv6_transport")
-        self.pcap_filename = "test_qat_aes_gcm_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_null_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_null_ipv6_transport")
-        self.pcap_filename = "test_qat_null_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
-
+        self._execute_ipsec_gw_test()
 
     def test_qat_3des_cbc_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_3des_cbc_ipv4_tunnel")
-        self.pcap_filename = "test_qat_3des_cbc_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_3des_cbc_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_3des_cbc_ipv6_tunnel")
-        self.pcap_filename = "test_qat_3des_cbc_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_3des_cbc_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_3des_cbc_ipv4_transport")
-        self.pcap_filename = "test_qat_3des_cbc_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_qat_3des_cbc_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test qat_3des_cbc_ipv6_transport")
-        self.pcap_filename = "test_qat_3des_cbc_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_cbc_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_cbc_ipv4_tunnel")
-        self.pcap_filename = "test_sw_aes_128_cbc_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_256_cbc_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_256_cbc_ipv4_tunnel")
-        self.pcap_filename = "test_sw_aes_256_cbc_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_gcm_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_gcm_ipv4_tunnel")
-        self.pcap_filename = "test_sw_aes_gcm_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_null_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_null_ipv4_tunnel")
-        self.pcap_filename = "test_sw_null_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_cbc_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_cbc_ipv4_transport")
-        self.pcap_filename = "test_sw_aes_128_cbc_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_256_cbc_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_256_cbc_ipv4_transport")
-        self.pcap_filename = "test_sw_aes_256_cbc_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_gcm_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_gcm_ipv4_transport")
-        self.pcap_filename = "test_sw_aes_gcm_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_null_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_null_ipv4_transport")
-        self.pcap_filename = "test_sw_null_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_cbc_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_cbc_ipv6_tunnel")
-        self.pcap_filename = "test_sw_aes_128_cbc_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_256_cbc_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_256_cbc_ipv6_tunnel")
-        self.pcap_filename = "test_sw_aes_256_cbc_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_gcm_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_gcm_ipv6_tunnel")
-        self.pcap_filename = "test_sw_aes_gcm_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_null_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_null_ipv6_tunnel")
-        self.pcap_filename = "test_sw_null_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_cbc_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_cbc_ipv6_transport")
-        self.pcap_filename = "test_sw_aes_128_cbc_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_256_cbc_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_256_cbc_ipv6_transport")
-        self.pcap_filename = "test_sw_aes_256_cbc_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_gcm_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_gcm_ipv6_transport")
-        self.pcap_filename = "test_sw_aes_gcm_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_null_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_null_ipv6_transport")
-        self.pcap_filename = "test_sw_null_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_ctr_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_ctr_ipv4_tunnel")
-        self.pcap_filename = "test_sw_aes_128_ctr_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_ctr_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_ctr_ipv6_tunnel")
-        self.pcap_filename = "test_sw_aes_128_ctr_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_ctr_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_ctr_ipv4_transport")
-        self.pcap_filename = "test_sw_aes_128_ctr_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_aes_128_ctr_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_aes_128_ctr_ipv6_transport")
-        self.pcap_filename = "test_sw_aes_128_ctr_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_3des_cbc_ipv4_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_3des_cbc_ipv4_tunnel")
-        self.pcap_filename = "test_sw_3des_cbc_ipv4_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_3des_cbc_ipv6_tunnel(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_3des_cbc_ipv6_tunnel")
-        self.pcap_filename = "test_sw_3des_cbc_ipv6_tunnel"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_3des_cbc_ipv4_transport(self):
-        if cc.is_test_skip(self):
-            return
-
-        self.logger.info("Test sw_3des_cbc_ipv4_transport")
-        self.pcap_filename = "test_sw_3des_cbc_ipv4_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
-
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        self._execute_ipsec_gw_test()
 
     def test_sw_3des_cbc_ipv6_transport(self):
-        if cc.is_test_skip(self):
-            return
+        self._execute_ipsec_gw_test()
+
+    def _get_crypto_device(self, num):
+        device = {}
+        if self.get_case_cfg()["devtype"] == "crypto_aesni_mb":
+            dev = "crypto_aesni_mb"
+        elif self.get_case_cfg()["devtype"] == "crypto_qat":
+            w = cc.get_qat_devices(self, cpm_num=1, num=num)
+            device["w"] = ' -w '.join(w)
+            device["vdev"] = None
+        elif self.get_case_cfg()["devtype"] == "crypto_openssl":
+            dev = "crypto_openssl"
+        elif self.get_case_cfg()["devtype"] == "crypto_aesni_gcm":
+            dev = "crypto_aesni_gcm"
+        elif self.get_case_cfg()["devtype"] == "crypto_kasumi":
+            dev = "crypto_kasumi"
+        elif self.get_case_cfg()["devtype"] == "crypto_snow3g":
+            dev = "crypto_snow3g"
+        elif self.get_case_cfg()["devtype"] == "crypto_zuc":
+            dev = "crypto_zuc"
+        elif self.get_case_cfg()["devtype"] == "crypto_null":
+            dev = "crypto_null"
+        else:
+            return {}
 
-        self.logger.info("Test sw_3des_cbc_ipv6_transport")
-        self.pcap_filename = "test_sw_3des_cbc_ipv6_transport"
-        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
-        self.logger.debug(ipsec_gw_opt_str)
+        if not device:
+            vdev_list = []
+            for i in range(num):
+                vdev = "{}{}".format(dev, i)
+                vdev_list.append(vdev)
+            device["w"] = "0000:00:00.0"
+            device["vdev"] = ' --vdev '.join(vdev_list)
 
-        result = self._execute_ipsec_gw_test(ipsec_gw_opt_str)
-        self.verify(result, "FAIL")
+        return device
 
     def _get_ipsec_gw_opt_str(self, override_ipsec_gw_opts={}):
         if "librte_ipsec" in list(self.get_suite_cfg().keys()) and self.get_suite_cfg()["librte_ipsec"]:
@@ -715,12 +281,18 @@ class TestIPsecGW(TestCase):
         return cc.get_opt_str(self, self._default_ipsec_gw_opts,
                               override_ipsec_gw_opts)
 
-    def _execute_ipsec_gw_test(self, ipsec_gw_opt_str):
+    def _execute_ipsec_gw_test(self):
+        if cc.is_test_skip(self):
+            return
+
         result = True
-        eal_opt_str = cc.get_eal_opt_str(self, add_port=True)
+        opts = {'l': ','.join(self.core_list)}
+        devices = self._get_crypto_device(self.number_of_ports)
+        opts.update(devices)
+        eal_opt_str = cc.get_eal_opt_str(self, opts, add_port=True)
+        ipsec_gw_opt_str = self._get_ipsec_gw_opt_str()
 
         cmd_str = cc.get_dpdk_app_cmd_str(self._app_path, eal_opt_str, ipsec_gw_opt_str)
-        self.logger.info("IPsec-gw cmd: " + cmd_str)
         self.dut.send_expect(cmd_str, "IPSEC:", 30)
         time.sleep(3)
         inst = self.tester.tcpdump_sniff_packets(self.rx_interface)
@@ -750,10 +322,9 @@ class TestIPsecGW(TestCase):
 
         pkt_rec = self.tester.load_tcpdump_sniff_packets(inst)
 
-        pcap_filename = "{0}.pcap".format(self.pcap_filename)
+        pcap_filename = "{0}.pcap".format(self.running_case)
         self.logger.info("Save pkts to {0}".format(packet.TMP_PATH + pcap_filename))
         pkt_rec.save_pcapfile(self.tester, pcap_filename)
-        self._pcap_idx = self._pcap_idx + 1
 
         if len(pkt_rec) == 0:
             self.logger.error("IPsec forwarding failed")
@@ -792,5 +363,4 @@ class TestIPsecGW(TestCase):
                 result = False
                 break
 
-        self.dut.kill_all()
-        return result
+        self.verify(result, "FAILED")
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit test script
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
                   ` (4 preceding siblings ...)
  2020-06-04  0:54 ` [dts] [PATCH V1 5/6] tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec " xinfengx
@ 2020-06-04  0:54 ` " xinfengx
  2020-06-12  1:46   ` Wan, Zhe
  2020-06-04  0:59 ` [dts] [PATCH V1 0/6] rework cryptodev test script and conf Zhao, XinfengX
  2020-06-19  3:32 ` Tu, Lijuan
  7 siblings, 1 reply; 10+ messages in thread
From: xinfengx @ 2020-06-04  0:54 UTC (permalink / raw)
  To: dts; +Cc: xinfengx

rework cryptodev unit test script
remove the redundant code

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/TestSuite_unit_tests_cryptodev_func.py | 56 ++++++++------------
 1 file changed, 21 insertions(+), 35 deletions(-)

diff --git a/tests/TestSuite_unit_tests_cryptodev_func.py b/tests/TestSuite_unit_tests_cryptodev_func.py
index a370fc4..e990192 100644
--- a/tests/TestSuite_unit_tests_cryptodev_func.py
+++ b/tests/TestSuite_unit_tests_cryptodev_func.py
@@ -54,77 +54,63 @@ class UnitTestsCryptodev(TestCase):
         cc.clear_dpdk_config(self)
 
     def test_cryptodev_qat_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_autotest")
 
     def test_cryptodev_qat_asym_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_asym_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_asym_autotest")
 
     def _test_cryptodev_qat_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_perftest")
 
     def _test_cryptodev_qat_continual_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_continual_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_continual_perftest")
 
     def _test_cryptodev_qat_snow3g_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_snow3g_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_snow3g_perftest")
 
     def test_cryptodev_aesni_mb_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_mb_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_mb_autotest")
 
     def _test_cryptodev_aesni_mb_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_mb_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_mb_perftest")
 
     def test_cryptodev_aesni_gcm_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_gcm_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_gcm_autotest")
 
     def _test_cryptodev_aesni_gcm_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_gcm_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_gcm_perftest")
 
     def test_cryptodev_sw_snow3g_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_snow3g_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_snow3g_autotest")
 
     def _test_cryptodev_sw_snow3g_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_snow3g_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_snow3g_perftest")
 
     def test_cryptodev_sw_kasumi_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_kasumi_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_kasumi_autotest")
 
     def test_cryptodev_sw_zuc_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_zuc_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_zuc_autotest")
 
     def test_cryptodev_null_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_null_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_null_autotest")
 
     def test_cryptodev_openssl_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_openssl_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_openssl_autotest")
 
     def _test_cryptodev_openssl_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_openssl_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_openssl_perftest")
 
     def test_cryptodev_scheduler_autotest(self):
+        self.__run_unit_test("cryptodev_scheduler_autotest")
+
+    def __run_unit_test(self, testsuite, timeout=600):
         eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_scheduler_autotest", eal_opt_str)
+        w = cc.get_qat_devices(self, num=1)
 
-    def __run_unit_test(self, testsuite, eal_opt_str, timeout=600):
         self.logger.info("STEP_TEST: " + testsuite)
         self.dut.send_expect("dmesg -C", "# ", 30)
-        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path, eal_opt_str)
+        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path, eal_opt_str + " --log-level=6 -w %s" % w[0])
         self.dut.send_expect(cmd_str, "RTE>>", 30)
 
         out = ""
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dts] [PATCH V1 0/6] rework cryptodev test script and conf
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
                   ` (5 preceding siblings ...)
  2020-06-04  0:54 ` [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit " xinfengx
@ 2020-06-04  0:59 ` Zhao, XinfengX
  2020-06-19  3:32 ` Tu, Lijuan
  7 siblings, 0 replies; 10+ messages in thread
From: Zhao, XinfengX @ 2020-06-04  0:59 UTC (permalink / raw)
  To: dts

Tested-by:  Zhao, Xinfeng<xinfengx.zhao@intel.com>

-----Original Message-----
From: Zhao, XinfengX 
Sent: Thursday, June 4, 2020 8:55 AM
To: dts@dpdk.org
Cc: Zhao, XinfengX <xinfengx.zhao@intel.com>
Subject: [dts][PATCH V1 0/6] rework cryptodev test script and conf

conf: simplify conf settings for cryptodev test
tests/cryptodev_common: improve cryptodev common methods
tests/crypto_perf_cryptodev_perf: rework crypto_perf test script
tests/l2fwd_cryptodev_func: rework l2fwd_crypto test script
tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec test script
tests/unit_tests_cryptodev_func: rework cryptodev unit test script

 conf/crypto_perf_cryptodev_perf.cfg           |  115 +-
 conf/cryptodev_sample.cfg                     |    6 +
 conf/ipsec_gw_cryptodev_func.cfg              |  156 +--
 conf/l2fwd_cryptodev_func.cfg                 |   35 -
 conf/unit_tests_cryptodev_func.cfg            |   11 -
 tests/TestSuite_crypto_perf_cryptodev_perf.py |  628 ++++------
 tests/TestSuite_ipsec_gw_cryptodev_func.py    |  624 ++--------
 tests/TestSuite_l2fwd_cryptodev_func.py       | 1036 ++++-------------
 tests/TestSuite_unit_tests_cryptodev_func.py  |   56 +-
 tests/cryptodev_common.py                     |  117 +-
 10 files changed, 785 insertions(+), 1999 deletions(-)  create mode 100644 conf/cryptodev_sample.cfg  delete mode 100644 conf/l2fwd_cryptodev_func.cfg  delete mode 100644 conf/unit_tests_cryptodev_func.cfg

--
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit test script
  2020-06-04  0:54 ` [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit " xinfengx
@ 2020-06-12  1:46   ` Wan, Zhe
  0 siblings, 0 replies; 10+ messages in thread
From: Wan, Zhe @ 2020-06-12  1:46 UTC (permalink / raw)
  To: Tu, Lijuan, dts; +Cc: Zhao, XinfengX

Acked-by: Wan, Zhe <zhe.wan@intel.com>

-----Original Message-----
From: dts <dts-bounces@dpdk.org> On Behalf Of xinfengx
Sent: 2020^[$BG/^[(B6^[$B7n^[(B4^[$BF|^[(B 8:55
To: dts@dpdk.org
Cc: Zhao, XinfengX <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit test script

rework cryptodev unit test script
remove the redundant code

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/TestSuite_unit_tests_cryptodev_func.py | 56 ++++++++------------
 1 file changed, 21 insertions(+), 35 deletions(-)

diff --git a/tests/TestSuite_unit_tests_cryptodev_func.py b/tests/TestSuite_unit_tests_cryptodev_func.py
index a370fc4..e990192 100644
--- a/tests/TestSuite_unit_tests_cryptodev_func.py
+++ b/tests/TestSuite_unit_tests_cryptodev_func.py
@@ -54,77 +54,63 @@ class UnitTestsCryptodev(TestCase):
         cc.clear_dpdk_config(self)
 
     def test_cryptodev_qat_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_autotest")
 
     def test_cryptodev_qat_asym_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_asym_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_asym_autotest")
 
     def _test_cryptodev_qat_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_perftest")
 
     def _test_cryptodev_qat_continual_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_continual_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_continual_perftest")
 
     def _test_cryptodev_qat_snow3g_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_qat_snow3g_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_qat_snow3g_perftest")
 
     def test_cryptodev_aesni_mb_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_mb_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_mb_autotest")
 
     def _test_cryptodev_aesni_mb_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_mb_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_mb_perftest")
 
     def test_cryptodev_aesni_gcm_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_gcm_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_gcm_autotest")
 
     def _test_cryptodev_aesni_gcm_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_aesni_gcm_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_aesni_gcm_perftest")
 
     def test_cryptodev_sw_snow3g_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_snow3g_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_snow3g_autotest")
 
     def _test_cryptodev_sw_snow3g_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_snow3g_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_snow3g_perftest")
 
     def test_cryptodev_sw_kasumi_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_kasumi_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_kasumi_autotest")
 
     def test_cryptodev_sw_zuc_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_sw_zuc_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_sw_zuc_autotest")
 
     def test_cryptodev_null_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_null_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_null_autotest")
 
     def test_cryptodev_openssl_autotest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_openssl_autotest", eal_opt_str)
+        self.__run_unit_test("cryptodev_openssl_autotest")
 
     def _test_cryptodev_openssl_perftest(self):
-        eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_openssl_perftest", eal_opt_str)
+        self.__run_unit_test("cryptodev_openssl_perftest")
 
     def test_cryptodev_scheduler_autotest(self):
+        self.__run_unit_test("cryptodev_scheduler_autotest")
+
+    def __run_unit_test(self, testsuite, timeout=600):
         eal_opt_str = cc.get_eal_opt_str(self)
-        self.__run_unit_test("cryptodev_scheduler_autotest", eal_opt_str)
+        w = cc.get_qat_devices(self, num=1)
 
-    def __run_unit_test(self, testsuite, eal_opt_str, timeout=600):
         self.logger.info("STEP_TEST: " + testsuite)
         self.dut.send_expect("dmesg -C", "# ", 30)
-        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path, eal_opt_str)
+        cmd_str = cc.get_dpdk_app_cmd_str(self._app_path, eal_opt_str + " --log-level=6 -w %s" % w[0])
         self.dut.send_expect(cmd_str, "RTE>>", 30)
 
         out = ""
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dts] [PATCH V1 0/6] rework cryptodev test script and conf
  2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
                   ` (6 preceding siblings ...)
  2020-06-04  0:59 ` [dts] [PATCH V1 0/6] rework cryptodev test script and conf Zhao, XinfengX
@ 2020-06-19  3:32 ` Tu, Lijuan
  7 siblings, 0 replies; 10+ messages in thread
From: Tu, Lijuan @ 2020-06-19  3:32 UTC (permalink / raw)
  To: Zhao, XinfengX, dts; +Cc: Zhao, XinfengX

Applied the series, thanks

-----Original Message-----
From: dts <dts-bounces@dpdk.org> On Behalf Of xinfengx
Sent: 2020^[$BG/^[(B6^[$B7n^[(B4^[$BF|^[(B 8:55
To: dts@dpdk.org
Cc: Zhao, XinfengX <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1 0/6] rework cryptodev test script and conf

conf: simplify conf settings for cryptodev test
tests/cryptodev_common: improve cryptodev common methods
tests/crypto_perf_cryptodev_perf: rework crypto_perf test script
tests/l2fwd_cryptodev_func: rework l2fwd_crypto test script
tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec test script
tests/unit_tests_cryptodev_func: rework cryptodev unit test script

 conf/crypto_perf_cryptodev_perf.cfg           |  115 +-
 conf/cryptodev_sample.cfg                     |    6 +
 conf/ipsec_gw_cryptodev_func.cfg              |  156 +--
 conf/l2fwd_cryptodev_func.cfg                 |   35 -
 conf/unit_tests_cryptodev_func.cfg            |   11 -
 tests/TestSuite_crypto_perf_cryptodev_perf.py |  628 ++++------
 tests/TestSuite_ipsec_gw_cryptodev_func.py    |  624 ++--------
 tests/TestSuite_l2fwd_cryptodev_func.py       | 1036 ++++-------------
 tests/TestSuite_unit_tests_cryptodev_func.py  |   56 +-
 tests/cryptodev_common.py                     |  117 +-
 10 files changed, 785 insertions(+), 1999 deletions(-)  create mode 100644 conf/cryptodev_sample.cfg  delete mode 100644 conf/l2fwd_cryptodev_func.cfg  delete mode 100644 conf/unit_tests_cryptodev_func.cfg

--
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04  0:54 [dts] [PATCH V1 0/6] rework cryptodev test script and conf xinfengx
2020-06-04  0:54 ` [dts] [PATCH V1 1/6] conf: simplify conf settings for cryptodev test xinfengx
2020-06-04  0:54 ` [dts] [PATCH V1 2/6] tests/cryptodev_common: improve cryptodev common methods xinfengx
2020-06-04  0:54 ` [dts] [PATCH V1 3/6] tests/crypto_perf_cryptodev_perf: rework crypto_perf test script xinfengx
2020-06-04  0:54 ` [dts] [PATCH V1 4/6] tests/l2fwd_cryptodev_func: rework l2fwd_crypto " xinfengx
2020-06-04  0:54 ` [dts] [PATCH V1 5/6] tests/ipsec_gw_cryptodev_func: rework cryptodev ipsec " xinfengx
2020-06-04  0:54 ` [dts] [PATCH V1 6/6] tests/unit_tests_cryptodev_func: rework cryptodev unit " xinfengx
2020-06-12  1:46   ` Wan, Zhe
2020-06-04  0:59 ` [dts] [PATCH V1 0/6] rework cryptodev test script and conf Zhao, XinfengX
2020-06-19  3:32 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox