1# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import os 6from autotest_lib.client.bin import test 7from autotest_lib.client.common_lib import error 8 9 10GOBI_FILES = ['/usr/lib/libQCWWAN2k.so'] 11GOBI_DIRS = ['/opt/Qualcomm'] 12 13 14class network_3GNoGobi(test.test): 15 version = 1 16 17 18 def GobiDirs(self): 19 # Return a list of non-empty gobi directories. 20 return [d for d in GOBI_DIRS if os.path.exists(d) and os.listdir(d)] 21 22 23 def GobiFiles(self): 24 # Return a list of all Gobi files 25 return [f for f in GOBI_FILES if os.path.exists(f)] 26 27 28 def run_once(self): 29 # Look in the file system to make sure there are no gobi 30 # related files. 31 files = self.GobiFiles() 32 if files: 33 raise error.TestError('Found files: %s' % 34 ', '.join(files)) 35 36 dirs = self.GobiDirs() 37 if dirs: 38 raise error.TestError('Found non-empty directories: %s' % 39 ', '.join(dirs)) 40