1# Copyright (c) 2013 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 6import scpi 7import cellular_logging 8import unittest 9 10import common 11from autotest_lib.client.cros.cellular import labconfig 12import base_station_pxt 13import prologix_scpi_driver 14 15log = cellular_logging.SetupCellularLogging('base_station_pxt_test') 16 17config = labconfig.Configuration(['--cell', 'mtv', '--technology', 'CDMA']) 18 19 20class test_pxt(unittest.TestCase): 21 """ 22 Test the pxt class. 23 """ 24 25 def test_BasicInit(self): 26 self._call_box_init() 27 self._call_box_close() 28 29 def _call_box_init(self): 30 x = config.cell['basestations'][1] 31 adapter = x['gpib_adapter'] 32 scpi_device = scpi.Scpi( 33 prologix_scpi_driver.PrologixScpiDriver( 34 hostname=adapter['address'], 35 port=adapter['ip_port'], 36 gpib_address=adapter['gpib_address'], 37 read_timeout_seconds=5), 38 opc_on_stanza=True) 39 self.call_box = base_station_pxt.BaseStationPxt( 40 scpi_device, no_initialization=False) 41 42 def _call_box_close(self): 43 self.call_box.Close() 44 45 def test_GetRatUeDataStatus(self): 46 """Test this function on the PXT class""" 47 self._call_box_init() 48 self.call_box.SetTechnology('Technology:LTE') 49 print self.call_box.GetRatUeDataStatus() 50 self._call_box_close() 51 52 53if __name__ == '__main__': 54 unittest.main() 55