Merge "Docker container for Yardstick CI"
[yardstick.git] / yardstick / benchmark / scenarios / networking / ping_benchmark.bash
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2015 Ericsson AB and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 # Run a single ping command towards a destination and outputs the round trip
13 # time in milliseconds on stdout. The count (-c) option is deliberately not
14 # supported since it is supposed to be handled by the runner.
15
16 set -e
17
18 destination=$1
19 shift
20 options="$@"
21
22 ping -c 1 $options $destination | grep ttl | awk -F [=\ ] '{printf $10}'