Skip to content

Commit 2c78abe

Browse files
committed
Further script clean-ups.
1 parent 4c37a68 commit 2c78abe

File tree

9 files changed

+375
-70
lines changed

9 files changed

+375
-70
lines changed

src/flow-test

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/flowtest-dccp

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,60 @@
1-
#!/bin/bash -e
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/
228

3-
TARGET="$1"
4-
if [ "$TARGET" == "" ] ; then
5-
TARGET="localhost:9000"
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"
646
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
754

8-
./netperfmeter $TARGET -vector=f.vec -scalar=f.sca \
55+
# ====== Run NetPerfMeter ===================================================
56+
./netperfmeter "${SERVER}:${PORT}" \
57+
-vector=dccp.vec -scalar=dccp.sca \
958
-dccp const80:const10000:const80:const10000 \
1059
-dccp const80:const10000:const80:const10000 \
1160
-dccp const80:const10000:const80:const10000 \
@@ -16,4 +65,4 @@ fi
1665
-dccp const80:const10000:const80:const10000 \
1766
-dccp const80:const10000:const80:const10000 \
1867
-dccp const80:const10000:const80:const10000 \
19-
-runtime=10
68+
-runtime="${RUNTIME}"

src/flowtest-helgrind

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,62 @@
1-
#!/bin/bash
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/
228

3-
make netperfmeter
29+
# Bash options:
30+
set -eu
431

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 ===================================================
556
# -control-over-tcp
657
while true ; do
7-
valgrind --tool=helgrind ./netperfmeter 192.168.0.27:9000 -tcp const20:const1400 -runtime=10
8-
sleep 1
58+
valgrind --tool=helgrind ./netperfmeter "${SERVER}:${PORT}" \
59+
-tcp const20:const1400 \
60+
-runtime="${RUNTIME}"
61+
sleep 10
962
done

src/flowtest-misc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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"
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+
44+
make
45+
rm -f vgcore.* core.* core
46+
47+
# ====== Run NetPerfMeter ===================================================
48+
./netperfmeter "${SERVER}:${PORT}" \
49+
-control-over-tcp \
50+
-scalar=x.sca.bz2 -vector=x.vec.bz2 \
51+
-tcp const30:const68000:const30:const68000:maxmsgsize=1300 \
52+
-runtime=5
53+
54+
./netperfmeter "${SERVER}:${PORT}" \
55+
-control-over-tcp \
56+
-scalar=y.sca.bz2 -vector=y.vec.bz2 \
57+
-udp const30:const68000:const30:const68000:maxmsgsize=1300 \
58+
-tcp const30:const68000:const30:const68000:maxmsgsize=1300 \
59+
-sctp const30:const68000:const30:const68000:maxmsgsize=1300 \
60+
-dccp const30:const68000:const30:const68000:maxmsgsize=1300 \
61+
-runtime=5
62+
63+
./netperfmeter "${SERVER}:${PORT}" \
64+
-control-over-tcp \
65+
-scalar=y.sca.bz2 -vector=y.vec.bz2 \
66+
-sctp const30:const6800:const30:const6800:maxmsgsize=1300 const30:const6800:const30:const6800:maxmsgsize=1300 const30:const6800:const30:const6800:maxmsgsize=1300 \
67+
-runtime=5

src/flowtest-multi

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,60 @@
1-
#!/bin/bash -e
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/
228

3-
TARGET="$1"
4-
if [ "$TARGET" == "" ] ; then
5-
TARGET="localhost:9000"
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"
646
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
754

8-
./netperfmeter $TARGET -vector=results.vec -scalar=results.sca \
55+
# ====== Run NetPerfMeter ===================================================
56+
./netperfmeter "${SERVER}:${PORT}" \
57+
-vector=multi.vec -scalar=multi.sca \
958
-tcp const10:const1000:const10:const1000 \
1059
-udp const10:const1000:const10:const1000 \
1160
-dccp const10:const1000:const10:const1000 \
@@ -15,4 +64,4 @@ fi
1564
const2:const1000:const2:const1000 \
1665
const2:const1000:const2:const1000 \
1766
const2:const1000:const2:const1000 \
18-
-runtime=60
67+
-runtime="${RUNTIME}"

src/flowtest-sctp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
#!/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/
228

29+
# Bash options:
330
set -eu
431

532
# ====== Handle arguments ===================================================
@@ -22,11 +49,10 @@ if [[ ! "${RUNTIME}" =~ ^[0-9]+$ ]] ; then
2249
exit 1
2350
fi
2451

25-
26-
# ====== Run test ===========================================================
2752
make
2853
rm -f vgcore.* core.* core
2954

55+
# ====== Run NetPerfMeter ===================================================
3056
./netperfmeter "${SERVER}:${PORT}" \
3157
-vector=sctp.vec -scalar=sctp.sca \
3258
-sctp \

0 commit comments

Comments
 (0)