aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/test/example/simple_pipeline/pktio_env
blob: e1fbe87cc20f7cb69eb41fafc47883bcab6e4de7 (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
#!/bin/sh
#
# Copyright (C) 2020, Marvell
# All rights reserved.
#
# SPDX-License-Identifier:	BSD-3-Clause
#
# Script to setup interfaces used for running application on linux-generic.
#
# For linux-generic the default behavior is to create two pcap interfaces
# and one interface uses udp64.pcap to inject traffic. An output pcap file
# is generated via second interface.
#
# Network set-up
# IF0 <---> IF1

PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
echo "using PCAP_IN = ${PCAP_IN}"

IF0=pcap:in=${PCAP_IN}
IF1=pcap:out=pcapout.pcap

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

validate_result()
{
	if [ `stat -c %s pcapout.pcap` -ne `stat -c %s  ${PCAP_IN}` ]; then
		echo "File sizes disagree"
		exit 1
	fi

	rm -f pcapout.pcap
}

setup_interfaces()
{
	echo "pktio: setting up test interfaces $IF0, $IF1."
	return 0
}

cleanup_interfaces()
{
	echo "pktio: cleaning up test interfaces $IF0, $IF1."
	return 0
}