-
Notifications
You must be signed in to change notification settings - Fork 33
ICMPPing
This test module implements a simple ping test and it provides a basic interface to the ping application much like the Icmp6Ping module. The test module translates provided options and their values into the corresponding ping shell command. It can be used to easily test IPv4 connectivity between two machines.
This test module accepts these options:
addr |
expects an IPv4 address or a hostname that can be translated to one. This is the target address of the ping command. This option is mandatory. |
iface |
specifies the interface from which the Icmp requests will be sent. Represents the parameter -I of the ping command. |
count |
expects an integer value of how mane Icmp requests should be sent. Represents the parameter -c of the ping command. |
interval |
specifies the interval between individual requests. Represents the parameter -i of the ping command. |
size |
specifies the number of data bytes to be sent. Represents the parameter -s of the ping command. |
limit_rate |
specifies the percentage of requests that need to receive a response in order for the test to be successful. Default value is 80%. |
To use this test modify the option values, of the following command, to suit your test environment and add it to your command sequence.
<run module="IcmpPing" host="testmachine1">
<options>
<option name="addr" value="{ip(testmachine2,testifc2)}"/>
<option name="count" value="40"/>
<option name="interval" value="0"/>
</options>
</run>
Given the options described in the previous section the test module will execute the constructed ping command on a specified slave machine. The result of the test is determined by the amount of responses received. The limit of how much is considered a success is specified by the option limit_rate, if the rate is higher that the limit the test was successful, otherwise it will fail.
By displaying the debug logs you will get the command and its output as well as the information about achieved transmit rate.
An example output of this command, with debug logs enabled, will look like this:
2013-09-18 14:41:54 (127.0.0.1) INFO: Executing command: [type(test), module(IcmpPing), machine(1), timeout(30)]
2013-09-18 14:41:54 (127.0.0.1) DEBUG: Setting timeout to "30"
2013-09-18 14:41:53 (192.168.122.12) DEBUG: Running command with pid "1383"
2013-09-18 14:41:53 (192.168.122.12) DEBUG: Executing: "ping 192.168.100.215 -c 40 -i 0.2"
2013-09-18 14:42:01 (192.168.122.12) DEBUG:
Stdout:
----------------------------
PING 192.168.100.215 (192.168.100.215) 56(84) bytes of data.
64 bytes from 192.168.100.215: icmp_seq=1 ttl=64 time=0.835 ms
64 bytes from 192.168.100.215: icmp_seq=2 ttl=64 time=0.506 ms
64 bytes from 192.168.100.215: icmp_seq=3 ttl=64 time=0.562 ms
64 bytes from 192.168.100.215: icmp_seq=4 ttl=64 time=0.871 ms
64 bytes from 192.168.100.215: icmp_seq=5 ttl=64 time=0.497 ms
64 bytes from 192.168.100.215: icmp_seq=6 ttl=64 time=0.599 ms
64 bytes from 192.168.100.215: icmp_seq=7 ttl=64 time=0.982 ms
64 bytes from 192.168.100.215: icmp_seq=8 ttl=64 time=0.545 ms
64 bytes from 192.168.100.215: icmp_seq=9 ttl=64 time=0.600 ms
64 bytes from 192.168.100.215: icmp_seq=10 ttl=64 time=0.859 ms
64 bytes from 192.168.100.215: icmp_seq=11 ttl=64 time=0.559 ms
64 bytes from 192.168.100.215: icmp_seq=12 ttl=64 time=0.425 ms
64 bytes from 192.168.100.215: icmp_seq=13 ttl=64 time=0.436 ms
64 bytes from 192.168.100.215: icmp_seq=14 ttl=64 time=0.591 ms
64 bytes from 192.168.100.215: icmp_seq=15 ttl=64 time=0.582 ms
64 bytes from 192.168.100.215: icmp_seq=16 ttl=64 time=0.511 ms
64 bytes from 192.168.100.215: icmp_seq=17 ttl=64 time=0.365 ms
64 bytes from 192.168.100.215: icmp_seq=18 ttl=64 time=0.486 ms
64 bytes from 192.168.100.215: icmp_seq=19 ttl=64 time=0.443 ms
64 bytes from 192.168.100.215: icmp_seq=20 ttl=64 time=0.511 ms
64 bytes from 192.168.100.215: icmp_seq=21 ttl=64 time=0.562 ms
64 bytes from 192.168.100.215: icmp_seq=22 ttl=64 time=0.482 ms
64 bytes from 192.168.100.215: icmp_seq=23 ttl=64 time=0.528 ms
64 bytes from 192.168.100.215: icmp_seq=24 ttl=64 time=0.607 ms
64 bytes from 192.168.100.215: icmp_seq=25 ttl=64 time=0.389 ms
64 bytes from 192.168.100.215: icmp_seq=26 ttl=64 time=0.310 ms
64 bytes from 192.168.100.215: icmp_seq=27 ttl=64 time=0.395 ms
64 bytes from 192.168.100.215: icmp_seq=28 ttl=64 time=0.429 ms
64 bytes from 192.168.100.215: icmp_seq=29 ttl=64 time=0.328 ms
64 bytes from 192.168.100.215: icmp_seq=30 ttl=64 time=0.425 ms
64 bytes from 192.168.100.215: icmp_seq=31 ttl=64 time=0.530 ms
64 bytes from 192.168.100.215: icmp_seq=32 ttl=64 time=0.504 ms
64 bytes from 192.168.100.215: icmp_seq=33 ttl=64 time=0.580 ms
64 bytes from 192.168.100.215: icmp_seq=34 ttl=64 time=0.575 ms
64 bytes from 192.168.100.215: icmp_seq=35 ttl=64 time=0.468 ms
64 bytes from 192.168.100.215: icmp_seq=36 ttl=64 time=0.515 ms
64 bytes from 192.168.100.215: icmp_seq=37 ttl=64 time=0.308 ms
64 bytes from 192.168.100.215: icmp_seq=38 ttl=64 time=0.509 ms
64 bytes from 192.168.100.215: icmp_seq=39 ttl=64 time=0.424 ms
64 bytes from 192.168.100.215: icmp_seq=40 ttl=64 time=0.524 ms
--- 192.168.100.215 ping statistics ---
40 packets transmitted, 40 received, 0% packet loss, time 7811ms
rtt min/avg/max/mdev = 0.308/0.528/0.982/0.147 ms
----------------------------
2013-09-18 14:42:01 (192.168.122.12) DEBUG: Transmitted "40", received "40", rate "100%", limit_rate "95%"
2013-09-18 14:42:01 (192.168.122.12) DEBUG: rtt min "0.308", avg "0.528", max "0.982", mdev "0.147"
2013-09-18 14:42:02 (127.0.0.1) INFO: Result: PASS
2013-09-18 14:42:02 (127.0.0.1) INFO: Result data:
2013-09-18 14:42:02 (127.0.0.1) INFO: limit_rate: 95
2013-09-18 14:42:02 (127.0.0.1) INFO: rtt_min: 0.308
2013-09-18 14:42:02 (127.0.0.1) INFO: rate: 100
2013-09-18 14:42:02 (127.0.0.1) INFO: rtt_max: 0.982