Add BT Discovery Mobly based Test to CATBox
Test: Tested Locally
Bug: 289129602
Change-Id: If360701c91b6b142d51ba828178ed757f5326257
diff --git a/tests/automotive/mobly_tests/pairing/Android.bp b/tests/automotive/mobly_tests/pairing/Android.bp
index d305c98..eaaefe7 100644
--- a/tests/automotive/mobly_tests/pairing/Android.bp
+++ b/tests/automotive/mobly_tests/pairing/Android.bp
@@ -33,6 +33,7 @@
// Package the snippet with the mobly test
":AutomotivePhoneSnippet",
":mobly-bundled-snippets",
+ "bt_discovery_config.yaml",
],
version: {
py3: {
diff --git a/tests/automotive/mobly_tests/pairing/bt_discovery_config.yaml b/tests/automotive/mobly_tests/pairing/bt_discovery_config.yaml
new file mode 100644
index 0000000..fdfcab6
--- /dev/null
+++ b/tests/automotive/mobly_tests/pairing/bt_discovery_config.yaml
@@ -0,0 +1,8 @@
+TestBeds:
+ - Name: TwoDeviceTestBed
+ Controllers:
+ AndroidDevice:
+ - serial: serial_number
+ label: hu
+ - serial: serial_number
+ label: phone
\ No newline at end of file
diff --git a/tests/automotive/mobly_tests/pairing/bt_discovery_test.py b/tests/automotive/mobly_tests/pairing/bt_discovery_test.py
index fa158e7..b9700c7 100644
--- a/tests/automotive/mobly_tests/pairing/bt_discovery_test.py
+++ b/tests/automotive/mobly_tests/pairing/bt_discovery_test.py
@@ -61,5 +61,9 @@
if __name__ == '__main__':
- # Take test args
+ # Pass test arguments after '--' to the test runner.
+ # Needed for Mobly Test Runner
+ if '--' in sys.argv:
+ index = sys.argv.index('--')
+ sys.argv = sys.argv[:1] + sys.argv[index + 1:]
test_runner.main()