19 lines
423 B
Bash
Executable File
19 lines
423 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# A simple test of rate limiting.
|
|
|
|
true "${testSubject:?not set - call this from 'make check'}"
|
|
|
|
# Transfer 102 bytes at 100 bytes/sec. It should take at least 1 second.
|
|
#
|
|
startTime=$(date +%S)
|
|
dd if=/dev/zero bs=102 count=1 2>/dev/null | "${testSubject}" -L 100 2>/dev/null | cat >/dev/null
|
|
endTime=$(date +%S)
|
|
|
|
if test "${startTime}" = "${endTime}"; then
|
|
echo "transfer took zero seconds"
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|