New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 742043 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

network_3GSmokeTest sometimes fails with an exception "illegal IP address string passed to inet_aton"

Project Member Reported by benchan@chromium.org, Jul 13 2017

Issue description

network_3GSmokeTest sometimes fails with an exception "illegal IP address string passed to inet_aton":

UnhandledTestFail: Unhandled error: illegal IP address string passed to inet_aton                                                                                                                                   
Traceback (most recent call last):                                                                                                                                                                                  
  File "/usr/local/autotest/common_lib/test.py", line 818, in _call_test_function                                                                                                                                   
    return func(*args, **dargs)                                                                                                                                                                                     
  File "/usr/local/autotest/common_lib/test.py", line 471, in execute                                                                                                                                               
    dargs)                                                                                                                                                                                                          
  File "/usr/local/autotest/common_lib/test.py", line 348, in _call_run_once_with_retry                                                                                                                             
    postprocess_profiled_run, args, dargs)                                                                                                                                                                          
  File "/usr/local/autotest/common_lib/test.py", line 381, in _call_run_once                                                                                                                                        
    self.run_once(*args, **dargs)                                                                                                                                                                                   
  File "/usr/local/autotest/tests/network_3GSmokeTest/network_3GSmokeTest.py", line 141, in run_once                                                                                                                
    self.run_once_internal()                                                                                                                                                                                        
  File "/usr/local/autotest/tests/network_3GSmokeTest/network_3GSmokeTest.py", line 108, in run_once_internal                                                                                                       
    interface)                                                                                                                                                                                                      
  File "/usr/local/autotest/cros/network.py", line 210, in CheckInterfaceForDestination                                                                                                                             
    interface = routes.getRouteFor(address).interface                                                                                                                                                               
  File "/usr/local//usr/lib/flimflam/test/routing.py", line 135, in getRouteFor                                                                                                                                     
    ip = convertIpToInt(ip_as_int_or_string)                                                                                                                                                                        
  File "/usr/local//usr/lib/flimflam/test/routing.py", line 42, in convertIpToInt                                                                                                                                   
    return struct.unpack('I', socket.inet_aton(i))[0]                                                                                                                                                               
error: illegal IP address string passed to inet_aton

The issue is that network_3GSmokeTest uses network.CheckInterfaceForDestination() from third_party/autotest/files/client/cros/network.py to check if routes for a specified host go through a given interface. Under the hood, network.CheckInterfaceForDestination() uses NetworkRoutes.getRouteFor()   from shill/test-scripts/routing.py. However, as NetworkRoutes doesn't currently handle IPv6 routes / addresses, NetworkRoutes.getRouteFor() raises an exception when it receives an IPv6 address.
 
Cc: ejcaruso@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/53e79ddbc4f409ba73104c83d3e9c9ec25772172

commit 53e79ddbc4f409ba73104c83d3e9c9ec25772172
Author: Ben Chan <benchan@chromium.org>
Date: Fri Jul 14 02:46:14 2017

Workaround IPv6 issue in network.CheckInterfaceForDestination

A few tests (e.g. network_3GSmokeTest, network_WiMaxSmoke) use
network.CheckInterfaceForDestination() to check if routes for a
specified host go through a given interface. Under the hood,
network.CheckInterfaceForDestination() uses NetworkRoutes.getRouteFor()
provided by shill/test-scripts/routing.py. However, as NetworkRoutes
doesn't currently handle IPv6 routes / addresses,
NetworkRoutes.getRouteFor() raises an exception when it receives an IPv6
address.

As IPv6 support isn't stricitly necessarily at this point, this CL
temporarily works around the issue by filtering out IPv6 addresses
reported by socket.getaddrinfo() in
network.CheckInterfaceForDestination().

BUG= chromium:742043 
TEST=Run network_3GSmokeTest on a DUT with a cellular modem.

Change-Id: I41fc6a7944a70e6e390d947469e57dad121804c6
Reviewed-on: https://chromium-review.googlesource.com/569491
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/53e79ddbc4f409ba73104c83d3e9c9ec25772172/client/cros/network.py

Status: Fixed (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/bfd5284709ecdda966cbf2b6dc775da0066eec23

commit bfd5284709ecdda966cbf2b6dc775da0066eec23
Author: Ben Chan <benchan@chromium.org>
Date: Sat Jul 29 05:07:58 2017

Handle missing route in network.CheckInterfaceForDestination.

network.CheckInterfaceForDestination checks if any route to a host goes
through a particular interface. As multiple IP addresses may be resolved
for the host, it's ok if some but not all addresses don't have a route.
This CL modifies network.CheckInterfaceForDestination to fail only if
there is no route to reach the host or if some route goes through an
interface other than the specified one.

BUG= chromium:742043 
TEST=Run network_3GSmokeTest on a DUT with cellular modem.

Change-Id: I3884ec139110c8f6559480dd8605f741606bc5cc
Reviewed-on: https://chromium-review.googlesource.com/592404
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/bfd5284709ecdda966cbf2b6dc775da0066eec23/client/cros/network.py

Comment 5 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment