Dmitry Sutyagin c8727d1431 Fix: UnicodeDecodeError, broken spec; add SPT
- Only convert outputs/errors to unicode if printing required,
  use 'replace' error handling to avoid errors. Write original
  byte str to output files to avoid double conversion.
- Fix spec broken with 1.26.6.
- Add simplified-performance-testing config & rq files, scripts.
  Can be used after deployment to get a few benchmark values.
  SPT_parser.sh can be used to parse results.

Change-Id: I2aacfdbd9574ff737a6b88a29d87ae56abd03e46
2017-02-23 16:02:58 -08:00

19 lines
469 B
Bash

#!/bin/bash
SPT_IPERF_PORT=${SPT_IPERF_PORT:-"65432"}
killall iperf
while ["$(iptables -L --line-numbers | grep -c 'spt-temporary-rule')" -ge 0 ]
do
rulenum=`iptables -L --line-numbers | grep 'spt-temporary-rule' | head -n 1 | awk '{print $1}'`
[ -n "$sulenum" ] && [ "$rulenum" -ge 0 ] && iptables -D INPUT $rulenum
done
if [ -n $SERVER_OUTPUT ]
then
echo $SERVER_OUTPUT
cat $SERVER_OUTPUT
rm -f $SERVER_OUTPUT
else
echo '$SERVER_OUTPUT not provided'
fi