blob: 3c766b8adda1435e1338073daaeb4b0520a1bbe2 [file] [log] [blame]
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging, os, re, shutil, time
from autotest_lib.client.bin import utils
from autotest_lib.client.common_lib import error
from autotest_lib.server import autotest, test
class network_3GLoadFirmware(test.test):
version = 1
def flimflam(self, prog):
return '/usr/local/lib/flimflam/test/%s' % prog
def modem_isup(self):
result ='mm-status'))
s = result.stdout
return s.find('Modem /org/chromium/ModemManager/Gobi') != -1
def wait_modem(self):
timeout = 15
lambda: self.modem_isup(),
error.TestError('Timed out waiting for modem'),
def force_reload(self):'initctl stop udev')'mm-powercycle -a'))'reboot')
if not self.client.wait_down(timeout=30):
error.TestFail("Reboot didn't.")
if not self.client.wait_up(timeout=40):
error.TestFail("Target didn't come back up.")
def run_once(self, host=None):
self.client = host
result ='dmesg')
for line in result.stdout.split('\n'):
if line.find('gobi') != -1:
error.TestFail("Firmware didn't reload after boot.")