bluetooth: Disable some suspend tests on Marvell

Marvell chipsets will power down on suspend and power up on resume so
all tests that check that state is retained or peer wakeup is possible
need to TESTNA or they will fail.

While Veyron chips will continue to power on during suspend (to allow
for remote wake), we'll mark them TestNA because a) this bug causes lots
of flakes and b) we have no way to take action on them since the problem
is on the FW.

BUG=b:168152910
TEST=Ran on hana (4.19 kernel)

Change-Id: I2eb287ebacf012c98af225afa64ffce3739424ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2545574
Tested-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Commit-Queue: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Shijin Abraham <shijinabraham@google.com>
Reviewed-by: Daniel Winkler <danielwinkler@google.com>
(cherry picked from commit 32318d215367a0f94a63bfa230c25230e3674eec)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2582565
diff --git a/server/cros/bluetooth/bluetooth_adapter_tests.py b/server/cros/bluetooth/bluetooth_adapter_tests.py
index bbd0b48..2a0ea8d 100644
--- a/server/cros/bluetooth/bluetooth_adapter_tests.py
+++ b/server/cros/bluetooth/bluetooth_adapter_tests.py
@@ -106,11 +106,6 @@
 # the ones that were not launched
 TABLET_MODELS = ['kakadu', 'kodama', 'krane', 'dru', 'druwl', 'dumo']
 
-# TODO(b/158336394) - Devices with Realtek chipsets won't behave well during
-# suspend/resume because they don't maintain FW. List all Realtek models here
-# and skip them in the relevant tests.
-REALTEK_MODELS = ['blooglet', 'barla', 'ezkinil', 'trembyle']
-
 # TODO(b/161005264) - Some tests rely on software rotation to pass, so we must
 # know which models don't use software rotation. Use a static list until we can
 # query the bluez API instead. Extended advertising is supported on platforms
@@ -122,6 +117,16 @@
                   'kindred', 'kled', 'puff', 'kohaku', 'nightfury', 'morphius',
                   'lazor', 'trogdor']
 
+# TODO(b/158336394) Realtek: Powers down during suspend due to high power usage
+#                            during S3.
+# TODO(b/168152910) Marvell: Powers down during suspend due to flakiness when
+#                            entering suspend.  This will also skip the tests
+#                            for Veyron (which don't power down right now) but
+#                            reconnect tests are still enabled for that platform
+#                            to check for suspend stability.
+SUSPEND_POWER_DOWN_CHIPSETS = ['Realtek-RTL8822C-USB', 'MVL-8897', 'MVL-8997']
+
+
 def method_name():
     """Get the method name of a class.
 
diff --git a/server/site_tests/bluetooth_AdapterAdvHealth/bluetooth_AdapterAdvHealth.py b/server/site_tests/bluetooth_AdapterAdvHealth/bluetooth_AdapterAdvHealth.py
index 573ced4..baca14c 100644
--- a/server/site_tests/bluetooth_AdapterAdvHealth/bluetooth_AdapterAdvHealth.py
+++ b/server/site_tests/bluetooth_AdapterAdvHealth/bluetooth_AdapterAdvHealth.py
@@ -4,8 +4,8 @@
 
 """A Batch of Bluetooth advertising tests"""
 
-from autotest_lib.server.cros.bluetooth.bluetooth_adapter_tests import \
-        REALTEK_MODELS
+from autotest_lib.server.cros.bluetooth.bluetooth_adapter_tests import (
+        SUSPEND_POWER_DOWN_CHIPSETS)
 from autotest_lib.server.cros.bluetooth import advertisements_data
 from autotest_lib.server.cros.bluetooth.bluetooth_adapter_quick_tests import \
      BluetoothAdapterQuickTests
@@ -30,7 +30,8 @@
 
     # TODO(b/150897528) - Scarlet Dru loses firmware around suspend
     @test_wrapper('Multiple LE advertising test',
-                  skip_models=REALTEK_MODELS + ['dru', 'druwl'])
+                  skip_models=['dru', 'druwl'],
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def adv_multiple_advertising_test(self):
         """Run all test cases for multiple advertisements."""
         self.run_le_advertising_test(
@@ -48,7 +49,8 @@
 
     # TODO(b/150897528) - Scarlet Dru loses firmware around suspend
     @test_wrapper('Suspend resume LE advertising test',
-                  skip_models=REALTEK_MODELS + ['dru', 'druwl'])
+                  skip_models=['dru', 'druwl'],
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def adv_suspend_resume_advertising_test(self):
         """Run all test cases for multiple advertisements."""
         self.run_le_advertising_test(
diff --git a/server/site_tests/bluetooth_AdapterSRHealth/bluetooth_AdapterSRHealth.py b/server/site_tests/bluetooth_AdapterSRHealth/bluetooth_AdapterSRHealth.py
index 1e4f3f2..f63d41d 100644
--- a/server/site_tests/bluetooth_AdapterSRHealth/bluetooth_AdapterSRHealth.py
+++ b/server/site_tests/bluetooth_AdapterSRHealth/bluetooth_AdapterSRHealth.py
@@ -36,7 +36,7 @@
 
 from autotest_lib.client.cros.bluetooth.bluetooth_audio_test_data import A2DP
 from autotest_lib.server.cros.bluetooth.bluetooth_adapter_tests import (
-        TABLET_MODELS)
+        TABLET_MODELS, SUSPEND_POWER_DOWN_CHIPSETS)
 from autotest_lib.server.cros.bluetooth.bluetooth_adapter_audio_tests import (
         BluetoothAdapterAudioTests)
 from autotest_lib.server.cros.bluetooth.bluetooth_adapter_quick_tests import (
@@ -219,7 +219,7 @@
 
     @test_wrapper('Reconnect A2DP',
                   devices={'BLUETOOTH_AUDIO': 1},
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_reconnect_a2dp(self):
         """ Reconnects an A2DP device after suspend/resume. """
         device_type = 'BLUETOOTH_AUDIO'
@@ -344,7 +344,7 @@
     @test_wrapper('Peer wakeup Classic HID',
                   devices={'MOUSE': 1},
                   skip_models=TABLET_MODELS + ['bob', 'dru'],
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_peer_wake_classic_hid(self):
         """ Use classic HID device to wake from suspend. """
         device = self.devices['MOUSE'][0]
@@ -357,7 +357,7 @@
     @test_wrapper('Peer wakeup LE HID',
                   devices={'BLE_MOUSE': 1},
                   skip_models=TABLET_MODELS + ['bob', 'dru'],
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_peer_wake_le_hid(self):
         """ Use LE HID device to wake from suspend. """
         device = self.devices['BLE_MOUSE'][0]
@@ -370,7 +370,7 @@
     @test_wrapper('Peer wakeup Classic HID',
                   devices={'MOUSE': 1},
                   skip_models=TABLET_MODELS + ['bob', 'dru'],
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_peer_wake_classic_hid_stress(self):
         """ Use classic HID device to wake from suspend. """
         device = self.devices['MOUSE'][0]
@@ -384,7 +384,7 @@
     @test_wrapper('Peer wakeup LE HID',
                   devices={'BLE_MOUSE': 1},
                   skip_models=TABLET_MODELS + ['bob', 'dru'],
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_peer_wake_le_hid_stress(self):
         """ Use LE HID device to wake from suspend. """
         device = self.devices['BLE_MOUSE'][0]
@@ -395,7 +395,7 @@
 
     @test_wrapper('Peer wakeup with A2DP should fail',
                   devices={'BLUETOOTH_AUDIO': 1},
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_peer_wake_a2dp_should_fail(self):
         """ Use A2DP device to wake from suspend and fail. """
         device_type = 'BLUETOOTH_AUDIO'
@@ -415,7 +415,7 @@
     @test_wrapper('Suspend while discovering',
                   devices={'BLE_MOUSE': 1},
                   skip_models=['dru'],
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_while_discovering(self):
         """ Suspend while discovering. """
         device = self.devices['BLE_MOUSE'][0]
@@ -446,7 +446,7 @@
     @test_wrapper('Suspend while advertising',
                   devices={'MOUSE': 1},
                   skip_models=['dru'],
-                  skip_chipsets=['Realtek-RTL8822C-USB'])
+                  skip_chipsets=SUSPEND_POWER_DOWN_CHIPSETS)
     def sr_while_advertising(self):
         """ Suspend while advertising. """
         device = self.devices['MOUSE'][0]