tests: Send more ICMP packets to determime external connectivity
We use ping to determine if the container has external connectivity. We also use the management IP in Ansible to connect to the container which is in a different interface than the external one. The management interface has a static IP so it's available much earlier than the external one which obtains the IP via DHCP. As such, in some cases, the external interface may not be configured early enough and the ping fails. We can improve this situation by sending more ICMP packets less frequently to give the interface sometime to be configured properly. This patch effectively allows 30 seconds for interface to reach a working state to determine if there is external connectivity or not which should be more than enough. This fixes some random CI failures where one container has external connectivity and another one doesn't even though they are configured exactly the same. For example: 2017-05-04 19:30:44.264567 | changed: [container1] => { 2017-05-04 19:30:44.264610 | "changed": true, 2017-05-04 19:30:44.264627 | "cmd": "ping -c 3 8.8.8.8", ... 2017-05-04 19:30:44.264900 | "stdout": "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n\n--- 8.8.8.8 ping statistics ---\n3 packets transmitted, 0 received, 100% packet loss, time 1998ms", 2017-05-04 19:30:44.264911 | "stdout_lines": [ 2017-05-04 19:30:44.264929 | "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.", 2017-05-04 19:30:44.264937 | "", 2017-05-04 19:30:44.264952 | "--- 8.8.8.8 ping statistics ---", 2017-05-04 19:30:44.264974 | "3 packets transmitted, 0 received, 100% packet loss, time 1998ms" 2017-05-04 19:30:44.264981 | ] but 2017-05-04 19:30:34.299060 | changed: [container2] => { 2017-05-04 19:30:34.299112 | "changed": true, 2017-05-04 19:30:34.299128 | "cmd": "ping -c 3 8.8.8.8", ... 2017-05-04 19:30:34.299683 | "stdout": "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=3.67 ms\n64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=3.65 ms\n64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=3.66 ms\n\n--- 8.8.8.8 ping statistics ---\n3 packets transmitted, 3 received, 0% packet loss, time 2003ms\nrtt min/avg/max/mdev = 3.656/3.664/3.678/0.070 ms", 2017-05-04 19:30:34.299697 | "stdout_lines": [ 2017-05-04 19:30:34.299715 | "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.", 2017-05-04 19:30:34.299735 | "64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=3.67 ms", 2017-05-04 19:30:34.299755 | "64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=3.65 ms", 2017-05-04 19:30:34.299775 | "64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=3.66 ms", 2017-05-04 19:30:34.299783 | "", 2017-05-04 19:30:34.299798 | "--- 8.8.8.8 ping statistics ---", 2017-05-04 19:30:34.299820 | "3 packets transmitted, 3 received, 0% packet loss, time 2003ms", 2017-05-04 19:30:34.299839 | "rtt min/avg/max/mdev = 3.656/3.664/3.678/0.070 ms" 2017-05-04 19:30:34.299845 | ] Change-Id: I77eb168d6c3abc5e679c7dd60c52353dc44f8afb
This commit is contained in:
parent
4f4fca7507
commit
9f8e9e1a96
@ -83,7 +83,7 @@
|
||||
that:
|
||||
- "'foo=bar' in environment_content"
|
||||
- name: Test connectivity to external address
|
||||
shell: ping -c 3 8.8.8.8
|
||||
shell: ping -i 5 -c 6 8.8.8.8
|
||||
register: ping_external_address
|
||||
failed_when: false
|
||||
- name: Verify connectivity to external address
|
||||
|
Loading…
Reference in New Issue
Block a user