• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Example Mobly Test
2
3This direcotry contains example Mobly tests.
4
5The tests here works with Mobly in AOSP as well as from GitHub (https://github.com/google/mobly).
6
7## Instructions
8The Mobly tests generally assume android devices are already running on the host.
9Prior to running the example tests please start two android virtual devices and verify they are connected to adb.
10
11### To run using AOSP Mobly:
12Ensure you are using Cuttlefish virtual device when launching with atest. AOSP Mobly support was developed with Cuttlefish only.
13Running with Goldfish emulator isn't fully supported and may encounter errors such as apk install failures.
14
15Simply invoke atest on the test module defined in Android.bp:
16*  `atest ble-gatt-test`
17
18### To run with standalone AOSP Mobly runner:
19
20Use Mobly's local test runner script with the test module and Mobly YAML config file:
21*  `tools/test/mobly_extensions/scripts/local_mobly_runner.py -m ble-gatt-test -c tools/netsim/testing/mobly/sample_config.yml`
22
23Refer to the `local_mobly_runner.py` script or Mobly documentation for additional info about the runner.
24
25### To run with Mobly on GitHub:
26
271. Clone the open source Mobly on GitHub (https://github.com/google/mobly)
282. Either place the example tests under your Mobly checkout or otherwise handle importing / installing Mobly manually.
293. Ensure mobly bundled snippets (https://github.com/google/mobly-bundled-snippets) is installed on the devices.
304. Execute Mobly test with python and use the Mobly YAML config file. Example command:
31    * `python3 ./tests/betosim/ble_gatt_test.py -c ./tests/betosim/sample_config.yml`
32
33