bluetooth: skip chromebox on au_a2dp_playback_and_connect_test

This test selects INTERNAL_SPEAKER as the audio output node.
Skipping the test if the DUT doesn't support the internal speaker.

BUG=b:191722792
TEST=test_that bluetooth_AdapterAUHealth.\
                au_a2dp_playback_and_connect_test

Change-Id: I727cbc664627410d1bc5a7541f08a981de310ae0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3467256
Reviewed-by: Shuo-Peng Liao <deanliao@chromium.org>
Tested-by: Shuo-Peng Liao <deanliao@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: John Lai <johnlai@google.com>
Commit-Queue: John Lai <johnlai@google.com>
diff --git a/server/site_tests/bluetooth_AdapterAUHealth/bluetooth_AdapterAUHealth.py b/server/site_tests/bluetooth_AdapterAUHealth/bluetooth_AdapterAUHealth.py
index c08efea..05144a1 100644
--- a/server/site_tests/bluetooth_AdapterAUHealth/bluetooth_AdapterAUHealth.py
+++ b/server/site_tests/bluetooth_AdapterAUHealth/bluetooth_AdapterAUHealth.py
@@ -6,6 +6,7 @@
 """A Batch of Bluetooth AUdio Health tests"""
 
 import time
+import logging
 
 from autotest_lib.client.common_lib import error
 from autotest_lib.client.cros.bluetooth.bluetooth_audio_test_data import (
@@ -15,6 +16,8 @@
         BluetoothAdapterAudioTests)
 from autotest_lib.server.cros.bluetooth.bluetooth_adapter_quick_tests import (
         BluetoothAdapterQuickTests)
+from autotest_lib.client.cros.chameleon.audio_test_utils import (
+        has_internal_speaker)
 
 
 class bluetooth_AdapterAUHealth(BluetoothAdapterQuickTests,
@@ -99,6 +102,11 @@
                   flags=['Quick Health'])
     def au_a2dp_playback_and_connect_test(self):
         """Connect then disconnect an A2DP device while playing stream."""
+        if not has_internal_speaker(self.host):
+            logging.info('SKIPPING TEST A2DP playback and connect test')
+            raise error.TestNAError(
+                    'The DUT does not have an internal speaker')
+
         device = self.devices['BLUETOOTH_AUDIO'][0]
         test_profile = A2DP_MEDIUM
         test_sequence = lambda: self.playback_and_connect(device, test_profile)