Skip to content

Commit

Permalink
Merged in dev/vladimir/mpc-3028-network-quality-for-robots (pull requ…
Browse files Browse the repository at this point in the history
…est elastic#261)

[MPC-3028] improvements to network quality control script

* a script to simulate UDP network losses

* if/while code style

* feedback from Can

* mention default value for loss level

* remove default identity

* limit udp ports

* improvements suggested by Serge

* merge conflict resolved
  • Loading branch information
Vladimir Osipov committed Oct 8, 2021
1 parent 84fabba commit 3c9a821
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions aws/gen-students-tf/simulate-losses.sh
Expand Up @@ -11,22 +11,26 @@ SSH_IDENTITY=""
function usage() {
cat << EOF
Usage: $0 [-t <target>] [-c <cmd>] [-l <loss>] [-I <identity>]
Usage: $0 [-H <target>] [-c <cmd>] [-l <loss>] [-I <identity>]
arguments
---
-t: target, username@hostname
-H: target, username@hostname
-c: command to execute
-l: specify loss from 0.00 to 0.50, defaults to 0.10
-I: path to your identity file if needed
commands
---
* list — list all the applied rules
* add — add a specific loss rule
* remove — remove a specific loss rule
* add — add a rule with a specified loss
* remove — remove a rule with a specified loss
* reset — scan for all the related rules and remove them
example
---
./simulate-losses.sh -I ~/.ssh/Engageli-Stockholm.pem -H ubuntu@13.51.158.18 -c add -l 0.12
EOF
}

Expand All @@ -35,9 +39,9 @@ if [ $# -eq 0 ] ; then
exit 1
fi

while getopts "I:c:l:t:" opt; do
while getopts "H:I:c:l:" opt; do
case $opt in
t)
H)
TARGET=$OPTARG
;;
c)
Expand Down

0 comments on commit 3c9a821

Please sign in to comment.