Add test for presence of netperf to betterspeedtest and netperfrunner;

Remove networkhammer.sh (no longer used)
This commit is contained in:
Rich Brown 2025-07-08 06:52:59 -04:00
parent 7eec6fb65f
commit 1aabdaa585
4 changed files with 18 additions and 20 deletions

View file

@ -22,8 +22,7 @@ These scripts work for [OpenWrt](https://openwrt.org) and include:
that can be taped on the side of the router.
* [betterspeedtest.sh](#betterspeedtestsh) &
[netperfrunner.sh](#netperfrunnersh) &
[networkhammer.sh](#networkhammersh) - scripts that measure the
[netperfrunner.sh](#netperfrunnersh) - scripts that measure the
performance of your router or offer load to the network for testing.
* [idlelatency.sh](#idlelatencysh) - a script to measure the latency of
@ -344,12 +343,6 @@ This is not a bug, nor is it a problem with your internet connection.
That's because the acknowledge messages sent back to the sender consume
a significant fraction of the link's capacity (as much as 25%).
## [networkhammer.sh](https://github.com/richb-hanover/OpenWrtScripts/blob/master/networkhammer.sh)
The `networkhammer.sh` script continually invokes the netperfrunner script to
provide a heavy load.
It runs forever - Ctl-C will interrupt it.
## [idlelatency.sh](https://github.com/richb-hanover/OpenWrtScripts/blob/master/idlelatency.sh)
_This script is no longer maintained.

View file

@ -160,7 +160,7 @@ measure_direction() {
ERRFILE=$(mktemp /tmp/netperfErr.XXXXXX) || exit 1
DIRECTION=$1
# start off the ping process
# start off the ping process
start_pings
# Start netperf with the proper direction
@ -169,7 +169,7 @@ measure_direction() {
else
dir="TCP_STREAM"
fi
# Start $MAXSESSIONS datastreams between netperf client and the netperf server
# netperf writes the sole output value (in Mbps) to stdout when completed
for i in $( seq "$MAXSESSIONS" )
@ -231,6 +231,13 @@ MAXSESSIONS="5"
TESTPROTO="-4"
IDLETEST=false
# Check to see if netperf is installed and exit if not
if ! command -v netperf >/dev/null 2>&1; then
echo ""
echo "Error: netperf is not installed or not in PATH" >&2
exit 1
fi
# read the options
# extract options and their arguments into variables.
@ -287,6 +294,7 @@ if $IDLETEST
then
echo "$DATE Testing idle line while pinging $PINGHOST ($TESTDUR seconds)"
SPEEDFILE=$(mktemp /tmp/netperfUL.XXXXXX) || exit 1
ERRFILE=$(mktemp /tmp/netperfErr.XXXXXX) || exit 1
start_pings
sleep "$TESTDUR"
summarize_pings "$PINGFILE"

View file

@ -186,6 +186,13 @@ done
# Start main test
# Check to see if netperf is installed and exit if not
if ! command -v netperf >/dev/null 2>&1; then
echo ""
echo "Error: netperf is not installed or not in PATH" >&2
exit 1
fi
if [ $TESTPROTO -eq "-4" ]
then
PROTO="ipv4"

View file

@ -1,10 +0,0 @@
#!/bin/sh
# Continuously hammer the network with continuous netperfrunner tests
# Initially created to put load on Wi-Fi for CeroWrt
#
echo "Hammering the network to gw.home.lan. Hit Ctl-C to cancel"
while true;
do
./netperfrunner.sh -H gw.home.lan
done