blob: 8c23c505d84e29c4032f057270ec61b17b14f9ee [file] [log] [blame]
#!/usr/bin/python
"""Fake connection_check implementation."""
RESULTS = {}
def mock(interface, result):
RESULTS[interface] = result
def call(*args):
interface = args[args.index('-I') + 1]
result = RESULTS.get(interface, 'fail')
if result == 'restricted' and '-a' in args:
result = 'succeed'
return (0 if result == 'succeed' else 1), ''