cros_labels: Remove ChameleonPeripheralsLabel and unit test
ChameleonPeripheralsLabel is not used anymore as Bluetooth test beds
have moved to different label and naming convention.
BUG=b:149637050
TEST=None
Change-Id: Ib2151460dc4387e2dc838dcdbd288d922806b1c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2418561
Tested-by: Shijin Abraham <shijinabraham@google.com>
Commit-Queue: Shijin Abraham <shijinabraham@google.com>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
diff --git a/server/hosts/cros_label.py b/server/hosts/cros_label.py
index 1015b25..de6f357 100644
--- a/server/hosts/cros_label.py
+++ b/server/hosts/cros_label.py
@@ -226,70 +226,6 @@
return task_name in (DEPLOY_TASK_NAME, '')
-class ChameleonPeripheralsLabel(base_label.StringPrefixLabel):
- """Return the Chameleon peripherals labels.
-
- The 'chameleon:bt_hid' label is applied if the bluetooth
- classic hid device, i.e, RN-42 emulation kit, is detected.
-
- Any peripherals plugged into the chameleon board would be
- detected and applied proper labels in this class.
- """
-
- _NAME = 'chameleon'
-
- def exists(self, host):
- return host._chameleon_host is not None
-
- def generate_labels(self, host):
- labels = []
- try:
- bt_hid_device = host.chameleon.get_bluetooth_hid_mouse()
- if bt_hid_device.CheckSerialConnection():
- labels.append('bt_hid')
- except:
- logging.error('Error with initializing bt_hid_mouse')
-
- try:
- ble_hid_device = host.chameleon.get_ble_mouse()
- if ble_hid_device.CheckSerialConnection():
- labels.append('bt_ble_hid')
- except:
- logging.error('Error with initializing ble_hid_mouse')
-
- try:
- bt_a2dp_sink = host.chameleon.get_bluetooth_a2dp_sink()
- if bt_a2dp_sink.CheckSerialConnection():
- labels.append('bt_a2dp_sink')
- except:
- logging.error('Error with initializing bt_a2dp_sink')
-
- try:
- bt_audio_device = host.chameleon.get_bluetooth_audio()
- if bt_audio_device.IsDetected():
- labels.append('bt_audio')
- except:
- logging.error('Error in detecting bt_audio')
-
- try:
- bt_base_device = host.chameleon.get_bluetooth_base()
- if bt_base_device.IsDetected():
- labels.append('bt_base')
- except:
- logging.error('Error in detecting bt_base')
-
- if labels != []:
- labels.append('bt_peer')
-
- logging.info('Chameleon Bluetooth labels are %s', labels)
- return labels
-
- def update_for_task(self, task_name):
- # This label is stored in the lab config, so only deploy tasks update it
- # or when no task name is mentioned.
- return task_name in (DEPLOY_TASK_NAME, '')
-
-
class AudioLoopbackDongleLabel(base_label.BaseLabel):
"""Return the label if an audio loopback dongle is plugged in."""
@@ -531,7 +467,6 @@
BluetoothPeerLabel(), #STATECONFIG
ChameleonConnectionLabel(), #LABCONFIG
ChameleonLabel(), #STATECONFIG
- ChameleonPeripheralsLabel(), #LABCONFIG
common_label.OSLabel(),
DeviceSkuLabel(), #LABCONFIG
HWIDLabel(),
diff --git a/server/hosts/cros_label_unittest.py b/server/hosts/cros_label_unittest.py
index 930d36d..d5c5b2a 100755
--- a/server/hosts/cros_label_unittest.py
+++ b/server/hosts/cros_label_unittest.py
@@ -18,7 +18,6 @@
from autotest_lib.server.hosts.cros_label import AudioLoopbackDongleLabel
from autotest_lib.server.hosts.cros_label import ChameleonConnectionLabel
from autotest_lib.server.hosts.cros_label import ChameleonLabel
-from autotest_lib.server.hosts.cros_label import ChameleonPeripheralsLabel
from autotest_lib.server.hosts.cros_label import ServoTypeLabel
from autotest_lib.server.hosts.cros_label import DutStorageLabel
from autotest_lib.server.hosts import host_info
@@ -295,13 +294,6 @@
self.assertFalse(ChameleonLabel().update_for_task('deploy'))
-class ChameleonPeripheralsLabelTests(unittest.TestCase):
- def test_update_for_task(self):
- self.assertTrue(ChameleonPeripheralsLabel().update_for_task(''))
- self.assertFalse(ChameleonPeripheralsLabel().update_for_task('repair'))
- self.assertTrue(ChameleonPeripheralsLabel().update_for_task('deploy'))
-
-
class ServoTypeLabelTests(unittest.TestCase):
"""Unit tests for ServoTypeLabel"""
def test_update_for_task(self):