TT#81700 run_tests.sh: -k option to capture pcap per scenario

* bench.sh -K and -k options for capture

Change-Id: Id2d0213e2c53f43b927ca9912a71471563466ac7
changes/35/42135/1
Victor Seva 6 years ago
parent a5b78d45b7
commit 7af0ea1e88

@ -2,21 +2,27 @@
SKIP_CONFIG=false
PROFILE="${PROFILE:-}"
GROUP="${GROUP:-scenarios}"
CAPTURE=false
SINGLE_CAPTURE=false
usage() {
echo "Usage: bench.sh [-p PROFILE] [-C] [num_runs]"
echo "Options:"
echo -e "\\t-p CE|PRO default is autodetect"
echo -e "\\t-C skips configuration of the environment"
echo -e "\\t-k capture messages with tcpdump, per scenario"
echo -e "\\t-K capture messages with tcpdump. One big file for all scenarios"
echo -e "\\t-x set GROUP scenario. Default: scenarios"
echo -e "\\t-h this help"
echo -e "num_runs default is 20"
}
while getopts 'hCp:x:' opt; do
while getopts 'hCkKp:x:' opt; do
case $opt in
h) usage; exit 0;;
C) SKIP_CONFIG=true;;
k) SINGLE_CAPTURE=true;;
K) CAPTURE=true;;
p) PROFILE=${OPTARG};;
x) GROUP=${OPTARG};;
*) echo "Unknown option $opt"; usage; exit 1;;
@ -44,6 +50,12 @@ fi
NUM=${1:-20}
RUN_OPS=(-C -c -r -p"${PROFILE}" -x"${GROUP}")
if "${CAPTURE}" ; then
RUN_OPS+=(-K)
elif "${SINGLE_CAPTURE}" ; then
RUN_OPS+=(-k)
fi
# clean previous
rm -rf log_* result_*

@ -22,6 +22,7 @@ TIMEOUT=${TIMEOUT:-300}
SHOW_SCENARIOS=false
SKIP_CONFIG=false
CAPTURE=false
SINGLE_CAPTURE=false
FIX_RETRANS=false
MEMDBG=false
CDR=false
@ -226,7 +227,8 @@ usage() {
echo -e "\\t-p CE|PRO default is autodetect"
echo -e "\\t-l print available SCENARIOS in GROUP"
echo -e "\\t-C skips configuration of the environment"
echo -e "\\t-K capture messages with tcpdump"
echo -e "\\t-k capture messages with tcpdump, per scenario"
echo -e "\\t-K capture messages with tcpdump. One big file for all scenarios"
echo -e "\\t-x set GROUP scenario. Default: scenarios"
echo -e "\\t-t set timeout in secs for pid_watcher.py [PRO]. Default: 300"
echo -e "\\t-r fix retransmission issues"
@ -238,12 +240,13 @@ usage() {
echo "BIN_DIR:${BIN_DIR}"
}
while getopts 'hlCcp:Kx:t:rm' opt; do
while getopts 'hlCcp:kKx:t:rm' opt; do
case $opt in
h) usage; exit 0;;
l) SHOW_SCENARIOS=true;;
C) SKIP_CONFIG=true;;
p) PROFILE=${OPTARG};;
k) SINGLE_CAPTURE=true;;
K) CAPTURE=true;;
x) GROUP=${OPTARG};;
t) TIMEOUT=${OPTARG};;
@ -362,6 +365,8 @@ fi
if "${CAPTURE}" ; then
capture
elif "${SINGLE_CAPTURE}" ; then
OPTS+=(-K)
fi
for t in "${SCEN[@]}"; do

Loading…
Cancel
Save