Skip to content

Add option to extend ping duration for ipaddr module tests #958

Description

@evensonbryan

My device is changing its IP address as directed during the ipaddr module tests. However, my device is failing the connection.ipaddr.disconnect_ip_change and connection.ipaddr.ip_change tests. There is some settling time on my device and the new IP address takes effect about 4 to 5 seconds after receiving the new IP address from the DHCP server. However, the ipaddr module is pinging my device immediately after the DHCP ACK and before the new IP address takes effect.

On the release_stable branch I changed this line:

output = src.cmd('ping -c2', ping_opt, dst_ip, '> /dev/null 2>&1 || echo ', failure)

to this:
output = src.cmd('ping -c10', ping_opt, dst_ip, '> /dev/null 2>&1 || echo ', failure)

After this change, all my ipaddr module tests passed.

I see on the master branch the ping_test() function in runner.py was modified to accept a 'count' variable which sets how many pings to send. However, that variable is never set anywhere and the ping count is still always set to 2. I propose adding an ipaddr module configuration option that sets the ping count in ping_test(). If it is not set, the system will continue to default to a ping count of 2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions