Home | History | Annotate | Download | only in network_3GNoGobi
      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 
      5 import os
      6 from autotest_lib.client.bin import test
      7 from autotest_lib.client.common_lib import error
      8 
      9 
     10 GOBI_FILES = ['/usr/lib/libQCWWAN2k.so']
     11 GOBI_DIRS = ['/opt/Qualcomm']
     12 
     13 
     14 class 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