Skip to content

Commit 24488d3

Browse files
committed
Added test script.
1 parent 6a3d69d commit 24488d3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

src/flowtest-tcp

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
# ==========================================================================
3+
# _ _ _ ____ __ __ __ _
4+
# | \ | | ___| |_| _ \ ___ _ __ / _| \/ | ___| |_ ___ _ __
5+
# | \| |/ _ \ __| |_) / _ \ '__| |_| |\/| |/ _ \ __/ _ \ '__|
6+
# | |\ | __/ |_| __/ __/ | | _| | | | __/ || __/ |
7+
# |_| \_|\___|\__|_| \___|_| |_| |_| |_|\___|\__\___|_|
8+
#
9+
# NetPerfMeter -- Network Performance Meter
10+
# Copyright (C) 2009-2025 by Thomas Dreibholz
11+
# ==========================================================================
12+
#
13+
# This program is free software: you can redistribute it and/or modify
14+
# it under the terms of the GNU General Public License as published by
15+
# the Free Software Foundation, either version 3 of the License, or
16+
# (at your option) any later version.
17+
#
18+
# This program is distributed in the hope that it will be useful,
19+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
# GNU General Public License for more details.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+
#
26+
27+
# Homepage: https://www.nntb.no/~dreibh/netperfmeter/
28+
29+
# Bash options:
30+
set -eu
31+
32+
# ====== Handle arguments ===================================================
33+
if [ $# -lt 1 ] ; then
34+
echo >&2 "Usage: $0 server:port [runtime]"
35+
exit 1
36+
fi
37+
SERVER="$(echo "$1" | sed -s 's/:.*$//g')"
38+
PORT="$(echo "$1" | sed -s 's/^.*://g')"
39+
if [[ ! "${PORT}" =~ ^[0-9]+$ ]] ; then
40+
echo >&2 "ERROR: Invalid port ${PORT}!"
41+
exit 1
42+
fi
43+
RUNTIME=10
44+
if [ $# -ge 2 ] ; then
45+
RUNTIME="$2"
46+
fi
47+
if [[ ! "${RUNTIME}" =~ ^[0-9]+$ ]] ; then
48+
echo >&2 "ERROR: Invalid runtime ${RUNTIME}!"
49+
exit 1
50+
fi
51+
52+
make
53+
rm -f vgcore.* core.* core
54+
55+
# ====== Run NetPerfMeter ===================================================
56+
./netperfmeter "${SERVER}:${PORT}" \
57+
-config=tcp.config -vector=tcp.vec -scalar=tcp.sca \
58+
-tcp const80:const1000:const80:const1000
59+
-runtime="${RUNTIME}"

0 commit comments

Comments
 (0)