2 # SPDX-License-Identifier: BSD-3-Clause
4 # usage: /bin/bash run_test.sh [-46]
5 # Run all defined linux_test[4,6].sh test-cases one by one
6 # user has to setup properly the following environment variables:
7 # SGW_PATH - path to the ipsec-secgw binary to test
8 # REMOTE_HOST - ip/hostname of the DUT
9 # REMOTE_IFACE - iface name for the test-port on DUT
10 # ETH_DEV - ethernet device to be used on SUT by DPDK ('-w <pci-id>')
11 # Also user can optonally setup:
12 # SGW_LCORE - lcore to run ipsec-secgw on (default value is 0)
13 # CRYPTO_DEV - crypto device to be used ('-w <pci-id>')
14 # if none specified appropriate vdevs will be created by the scrit
15 # MULTI_SEG_TEST - ipsec-secgw option to enable reassembly support and
16 # specify size of reassembly table (i.e. MULTI_SEG_TEST="--reassemble 128")
17 # refer to linux_test[4,6].sh for more information
20 # All supported modes to test.
22 # 'old' means that ipsec-secgw will run in legacy (non-librte_ipsec mode)
23 # 'tun/trs' refer to tunnel/transport mode respectively
29 echo -e "\t\t-4 Perform Linux IPv4 network tests"
30 echo -e "\t\t-6 Perform Linux IPv6 network tests"
31 echo -e "\t\t-p Perform packet validation tests"
32 echo -e "\t\t-h Display this help"
35 LINUX_TEST="tun_aescbc_sha1 \
37 tun_aescbc_sha1_esn_atom \
43 trs_aescbc_sha1_esn_atom \
54 tun_aesctr_sha1_esn_atom \
58 trs_aesctr_sha1_esn_atom \
60 tun_3descbc_sha1_old \
61 tun_3descbc_sha1_esn \
62 tun_3descbc_sha1_esn_atom \
64 trs_3descbc_sha1_old \
65 trs_3descbc_sha1_esn \
66 trs_3descbc_sha1_esn_atom"
68 PKT_TESTS="trs_ipv6opts \
69 tun_null_header_reconstruct"
77 while getopts ":46ph" opt
101 # no test suite has been selected
102 if [[ ${run4} -eq 0 && ${run6} -eq 0 && ${runpkt} -eq 0 ]]; then
107 # perform packet processing validation tests
109 if [ $runpkt -eq 1 ]; then
110 echo "Performing packet validation tests"
111 /bin/bash ${DIR}/pkttest.sh ${PKT_TESTS}
114 echo "pkttests finished with status ${st}"
115 if [[ ${st} -ne 0 ]]; then
116 echo "ERROR pkttests FAILED"
121 # perform network tests
122 if [[ ${run4} -eq 1 || ${run6} -eq 1 ]]; then
123 for i in ${LINUX_TEST}; do
125 echo "starting test ${i}"
128 if [[ ${run4} -ne 0 ]]; then
129 /bin/bash ${DIR}/linux_test4.sh ${i}
131 echo "test4 ${i} finished with status ${st4}"
135 if [[ ${run6} -ne 0 ]]; then
136 /bin/bash ${DIR}/linux_test6.sh ${i}
138 echo "test6 ${i} finished with status ${st6}"
142 if [[ $st -ne 0 ]]; then
143 echo "ERROR test ${i} FAILED"