aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/test/example/ipsec_crypto/pktio_env
blob: 82d68f860e6d797aed7e473bf102a2615b1de45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
#
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2021 Marvell
#
# Script to setup interfaces used for running application on linux-generic.
#
# ipsec_api application uses two loop devices loop0 and loop1.
#

if [ "$0" == "$BASH_SOURCE" ]; then
	echo "Error: Platform specific env file has to be sourced."
	exit 1
fi

# Absolute path to the .env file.
LINUX_ENV_PATH=$PWD/../../platform/linux-generic/test

TESTENV="tests-linux-generic.env"

if [ -f $LINUX_ENV_PATH/$TESTENV ]; then
	source $LINUX_ENV_PATH/$TESTENV
else
	echo "BUG: unable to find $TESTENV!"
	echo "$TESTENV has to be in following directory: "
	echo "  $LINUX_ENV_PATH"
	exit 1
fi

# Skip IPsec example tests when there's no OpenSSL.
if [ -n "$WITH_OPENSSL_CRYPTO" ] && [ ${WITH_OPENSSL_CRYPTO} -eq 0 ]; then
	echo "Crypto not supported. Skipping."
	exit 77
fi

if [ -n "$ODPH_PROC_MODE" ] && [ ${ODPH_PROC_MODE} -ne 0 ]; then
	echo "Process mode not supported. Skipping."
	exit 77
fi

# Skip live and router mode tests.
if [ ${IPSEC_APP_MODE} -eq 1 ] || [ ${IPSEC_APP_MODE} -eq 2 ]; then
	echo "Live / Router mode test. Skipping."
	exit 77
fi

IF0=p7p1
IF1=p8p1

NEXT_HOP_MAC0=08:00:27:76:B5:E0
NEXT_HOP_MAC1=08:00:27:F5:8B:DB

LIF0=loop1
LIF1=loop2

IF_LIST=$LIF0,$LIF1
ROUTE_IF_INB=$LIF0
ROUTE_IF_OUTB=$LIF1
OUT_IF=$LIF1
IN_IF=$LIF0

validate_result()
{
	return 0
}

setup_interfaces()
{
	return 0
}

cleanup_interfaces()
{
	return 0
}