xref: /dpdk/examples/ipsec-secgw/test/run_test.sh (revision da68794d)
1#! /bin/bash
2
3# usage: /bin/bash run_test.sh [-46]
4# Run all defined linux_test[4,6].sh test-cases one by one
5# user has to setup properly the following environment variables:
6#  SGW_PATH - path to the ipsec-secgw binary to test
7#  REMOTE_HOST - ip/hostname of the DUT
8#  REMOTE_IFACE - iface name for the test-port on DUT
9#  ETH_DEV - ethernet device to be used on SUT by DPDK ('-w <pci-id>')
10# Also user can optonally setup:
11#  SGW_LCORE - lcore to run ipsec-secgw on (default value is 0)
12#  CRYPTO_DEV - crypto device to be used ('-w <pci-id>')
13#  if none specified appropriate vdevs will be created by the scrit
14# refer to linux_test1.sh for more information
15
16# All supported modes to test.
17# naming convention:
18# 'old' means that ipsec-secgw will run in legacy (non-librte_ipsec mode)
19# 'tun/trs' refer to tunnel/transport mode respectively
20LINUX_TEST="tun_aescbc_sha1 \
21tun_aescbc_sha1_esn \
22tun_aescbc_sha1_esn_atom \
23tun_aesgcm \
24tun_aesgcm_esn \
25tun_aesgcm_esn_atom \
26trs_aescbc_sha1 \
27trs_aescbc_sha1_esn \
28trs_aescbc_sha1_esn_atom \
29trs_aesgcm \
30trs_aesgcm_esn \
31trs_aesgcm_esn_atom \
32tun_aescbc_sha1_old \
33tun_aesgcm_old \
34trs_aescbc_sha1_old \
35trs_aesgcm_old \
36tun_aesctr_sha1 \
37tun_aesctr_sha1_old \
38tun_aesctr_sha1_esn \
39tun_aesctr_sha1_esn_atom \
40trs_aesctr_sha1 \
41trs_aesctr_sha1_old \
42trs_aesctr_sha1_esn \
43trs_aesctr_sha1_esn_atom \
44tun_3descbc_sha1 \
45tun_3descbc_sha1_old \
46tun_3descbc_sha1_esn \
47tun_3descbc_sha1_esn_atom \
48trs_3descbc_sha1 \
49trs_3descbc_sha1_old \
50trs_3descbc_sha1_esn \
51trs_3descbc_sha1_esn_atom"
52
53DIR=`dirname $0`
54
55# get input options
56st=0
57run4=0
58run6=0
59while [[ ${st} -eq 0 ]]; do
60	getopts ":46" opt
61	st=$?
62	if [[ "${opt}" == "4" ]]; then
63		run4=1
64	elif [[ "${opt}" == "6" ]]; then
65		run6=1
66	fi
67done
68
69if [[ ${run4} -eq 0 && {run6} -eq 0 ]]; then
70	exit 127
71fi
72
73for i in ${LINUX_TEST}; do
74
75	echo "starting test ${i}"
76
77	st4=0
78	if [[ ${run4} -ne 0 ]]; then
79		/bin/bash ${DIR}/linux_test4.sh ${i}
80		st4=$?
81		echo "test4 ${i} finished with status ${st4}"
82	fi
83
84	st6=0
85	if [[ ${run6} -ne 0 ]]; then
86		/bin/bash ${DIR}/linux_test6.sh ${i}
87		st6=$?
88		echo "test6 ${i} finished with status ${st6}"
89	fi
90
91	let "st = st4 + st6"
92	if [[ $st -ne 0 ]]; then
93		echo "ERROR test ${i} FAILED"
94		exit $st
95	fi
96done
97