• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Lint as: python2, python3
2# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6
7from __future__ import absolute_import
8from __future__ import division
9from __future__ import print_function
10
11from autotest_lib.client.cros.cellular import scpi
12from autotest_lib.client.cros.cellular import cellular_logging
13
14import unittest
15import common
16
17from autotest_lib.client.cros.cellular import labconfig
18from autotest_lib.client.cros.cellular import base_station_pxt
19from autotest_lib.client.cros.cellular import prologix_scpi_driver
20
21log = cellular_logging.SetupCellularLogging('base_station_pxt_test')
22
23config = labconfig.Configuration(['--cell', 'mtv', '--technology', 'CDMA'])
24
25
26class test_pxt(unittest.TestCase):
27    """
28    Test the pxt class.
29    """
30
31    def test_BasicInit(self):
32        self._call_box_init()
33        self._call_box_close()
34
35    def _call_box_init(self):
36        x = config.cell['basestations'][1]
37        adapter = x['gpib_adapter']
38        scpi_device = scpi.Scpi(
39            prologix_scpi_driver.PrologixScpiDriver(
40                hostname=adapter['address'],
41                port=adapter['ip_port'],
42                gpib_address=adapter['gpib_address'],
43                read_timeout_seconds=5),
44                opc_on_stanza=True)
45        self.call_box = base_station_pxt.BaseStationPxt(
46            scpi_device, no_initialization=False)
47
48    def _call_box_close(self):
49        self.call_box.Close()
50
51    def test_GetRatUeDataStatus(self):
52        """Test this function on the PXT class"""
53        self._call_box_init()
54        self.call_box.SetTechnology('Technology:LTE')
55        print(self.call_box.GetRatUeDataStatus())
56        self._call_box_close()
57
58
59if __name__ == '__main__':
60    unittest.main()
61