faucetsdn / daq

DEPRECATED -- DAQ (Device Automated Qualification) framework in no longer in use, supported, or maintained. It is here for archival purposes only.
Apache License 2.0
40 stars 32 forks source link

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

Open evensonbryan opened 2 years ago

evensonbryan commented 2 years ago

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: https://github.com/faucetsdn/daq/blob/88330f75a9dab63e9700aa57f8c4155fa45cec46/daq/runner.py#L749

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.