602
def has_defaultroute(klass):
603
'''Return if there is a default route.
605
This is a reasonable indicator that online tests can be run.
607
if klass._has_defaultroute_cache is None:
608
klass._has_defaultroute_cache = False
609
route = subprocess.Popen(['/sbin/route', '-n'],
610
stdout=subprocess.PIPE)
611
for l in route.stdout:
612
if l.startswith('0.0.0.0 '):
613
klass._has_defaultroute_cache = True
616
return klass._has_defaultroute_cache
618
_has_defaultroute_cache = None