Merge "Wi-Fi HAL sl4n test script - initial framework" into mm-wireless-dev
am: d215d03ac8
* commit 'd215d03ac805dc829057705fa08f688d7797ddfb':
Wi-Fi HAL sl4n test script - initial framework
diff --git a/acts/README.md b/acts/README.md
new file mode 100644
index 0000000..4ff768b
--- /dev/null
+++ b/acts/README.md
@@ -0,0 +1,143 @@
+# Android Comms Test Suite
+ACTS is a python-based test framework that is designed to be lightweight,
+pluggable, and easy to use. It initializes equipment and services associated
+to a test run, provides those resources to test classes, executes test cases,
+and generates test reports.
+
+ACTS follows the Google Open-source
+[Python Style Guide](https://google.github.io/styleguide/pyguide.html), and
+it is recommended for all new test cases.
+
+## ACTS Execution Flow Overview
+Below is a high level view of the ACTS flow:
+1. Read configuration files
+2. Create controllers
+3. Sequentially execute test classes
+```
+FooTest.setup_class()
+FooTest.setup_test()
+FooTest.test_A()
+FooTest.teardown_test()
+FooTest.setup_test()
+FooTest.test_B()
+FooTest.teardown_test()
+....
+FooTest.teardown_class()
+BarTest.setup_class()
+....
+```
+4. Destroy controllers
+
+## Preparing an Android Device
+### Allow USB Debugging
+USB debugging must be enabled before a device can take commands from adb.
+To enable USB debugging, first enable developer mode.
+1. Go to Settings->About phone
+2. Tap Build number repeatedly until "You're a developer now" is displayed.
+
+In developer mode:
+1. Plug the device into a computer (host)
+2. Run `$adb devices`
+- A pop-up asking to allow the host to access the android device may be
+displayed. Check the "Always" box and click "Yes".
+
+## ACTS Setup
+1. ACTS requires three python dependencies:
+- Python3.4
+- The setuptools package
+- The pyserial package
+2. From the ACTS directory, run setup
+- `$ sudo python3 setup.py develop`
+
+After installation, `act.py` and `flashutil.py` will be in usr/bin and can be
+called as command line utilities. Components in ACTS are importable under the
+package "acts." in Python3.4, for example:
+```
+$ python3
+>>> from acts.controllers import android_device
+>>> device_list = android_device.get_all_instances()
+```
+
+## Verifying Setup
+To verify the host and device are ready, from the frameworks folder run:
+- `$ act.py -c sample_config.json -tb SampleTestBed -tc SampleTest`
+
+If the above command executed successfully, the ouput should look something
+similar to following:
+```
+[SampleTestBed] 07-22 15:23:50.323 INFO ==========> SampleTest <==========
+[SampleTestBed] 07-22 15:23:50.327 INFO [Test Case] test_make_toast
+[SampleTestBed] 07-22 15:23:50.334 INFO [Test Case] test_make_toast PASS
+[SampleTestBed] 07-22 15:23:50.338 INFO Summary for test class SampleTest:
+Requested 1, Executed 1, Passed 1, Failed 0, Skipped 0
+[SampleTestBed] 07-22 15:23:50.338 INFO Summary for test run
+SampleTestBed@07-22-2015_1-23-44-096: Requested 1, Executed 1, Passed 1,
+Failed 0, Skipped 0
+```
+By default, all logs are saved in `/tmp/logs`
+
+## Breaking Down the Example
+Below are the components of the command run for the SampleTest:
+- `acts.py`: is the script that runs the test
+- -c sample_config: is the flag and name of the configuration file to be used
+in the test
+- -tb StampleTestBed: is the flag and name of the test bed to be used
+- -tc SampleTest: is the name of the test case
+
+### Configuration Files
+To run tests, required information must be provided via a json-formatted
+text file. The required information includes a list of “testbed” configs.
+Each specifies the hardware, services, the path to the logs directory, and
+a list of paths where the python test case files are located. Below are the
+contents of a sample configuration file:
+```
+{ "_description": "This is an example skeleton test configuration file.",
+ "testbed":
+ [
+ {
+ "_description": "Sample testbed with no devices",
+ "name": "SampleTestBed"
+ }
+ ],
+ "logpath": "/tmp/logs",
+ "testpaths": ["../tests/sample"],
+ "custom_param1": {"favorite_food": "Icecream!"}
+}
+```
+
+### Test Class
+Test classes are instantiated with a dictionary of “controllers”. The
+controllers dictionary contains all resources provided to the test class
+and are created based on the provided configuration file.
+
+Test classes must also contain an iterable member self.tests that lists the
+test case names within the class. More on this is discussed after the following
+code snippet.
+```
+from acts.base_test import BaseTestClass
+
+class SampleTest(BaseTestClass):
+
+ def __init__(self, controllers):
+ BaseTestClass.__init__(self, controllers)
+ self.tests = (
+ "test_make_toast",
+ )
+
+ """Tests"""
+ def test_make_toast(self):
+ for ad in self.android_devices:
+ ad.droid.makeToast("Hello World.")
+ return True
+```
+By default all test cases listed in a Test Class\'s self.tests will be run.
+Using the syntax below will override the default behavior by executing only
+specific tests within a test class.
+
+The following will run a single test, test_make_toast:
+`$ act.py -c sample_config.txt -tb SampleTestBed -tc SampleTest:test_make_toast`
+
+Multiple tests may be specified with a comma-delimited list. The following
+will execute test_make_toast and test_make_bagel:
+- `$ act.py -c sample_config.txt -tb SampleTestBed -tc
+SampleTest:test_make_toast,test_make_bagel`
diff --git a/acts/framework/acts/base_test.py b/acts/framework/acts/base_test.py
index 81effee..c76e2a8 100644
--- a/acts/framework/acts/base_test.py
+++ b/acts/framework/acts/base_test.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/bin/monsoon.py b/acts/framework/acts/bin/monsoon.py
index 6896648..2c57b18 100755
--- a/acts/framework/acts/bin/monsoon.py
+++ b/acts/framework/acts/bin/monsoon.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/access_point.py b/acts/framework/acts/controllers/access_point.py
index 0837794..24473d3 100755
--- a/acts/framework/acts/controllers/access_point.py
+++ b/acts/framework/acts/controllers/access_point.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google, Inc.
+# Copyright 2016 - Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/adb.py b/acts/framework/acts/controllers/adb.py
index 1bdccc2..e009def 100644
--- a/acts/framework/acts/controllers/adb.py
+++ b/acts/framework/acts/controllers/adb.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/android.py b/acts/framework/acts/controllers/android.py
index bd67d1f..9fe7b7c 100644
--- a/acts/framework/acts/controllers/android.py
+++ b/acts/framework/acts/controllers/android.py
@@ -1,4 +1,5 @@
-# python3.4
+#/usr/bin/env python3.4
+#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/acts/framework/acts/controllers/android_device.py b/acts/framework/acts/controllers/android_device.py
index 2a29777..62d8d73 100644
--- a/acts/framework/acts/controllers/android_device.py
+++ b/acts/framework/acts/controllers/android_device.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/attenuator.py b/acts/framework/acts/controllers/attenuator.py
index 7eede0b..dbf3207 100644
--- a/acts/framework/acts/controllers/attenuator.py
+++ b/acts/framework/acts/controllers/attenuator.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py b/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py
index fdb54e6..b2eeecc 100644
--- a/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py
+++ b/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
-# Copyright 2014- The Android Open Source Project
+# Copyright 2016- The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py b/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py
index 5a68f63..440a03d 100644
--- a/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py
+++ b/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
-# Copyright 2014- The Android Open Source Project
+# Copyright 2016- The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py b/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py
index 25bd347..4627147 100644
--- a/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py
+++ b/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
-# Copyright 2014- The Android Open Source Project
+# Copyright 2016- The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/event_dispatcher.py b/acts/framework/acts/controllers/event_dispatcher.py
index 2d56050..8ec5314 100644
--- a/acts/framework/acts/controllers/event_dispatcher.py
+++ b/acts/framework/acts/controllers/event_dispatcher.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014- The Android Open Source Project
+# Copyright 2016- The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/fastboot.py b/acts/framework/acts/controllers/fastboot.py
index a54301e..096dfae 100644
--- a/acts/framework/acts/controllers/fastboot.py
+++ b/acts/framework/acts/controllers/fastboot.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/iperf_server.py b/acts/framework/acts/controllers/iperf_server.py
index 97afd88..3cd087a 100644
--- a/acts/framework/acts/controllers/iperf_server.py
+++ b/acts/framework/acts/controllers/iperf_server.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/monsoon.py b/acts/framework/acts/controllers/monsoon.py
index e496f2f..190cb9c 100644
--- a/acts/framework/acts/controllers/monsoon.py
+++ b/acts/framework/acts/controllers/monsoon.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/controllers/native.py b/acts/framework/acts/controllers/native.py
index 429a861..c2375bd 100644
--- a/acts/framework/acts/controllers/native.py
+++ b/acts/framework/acts/controllers/native.py
@@ -1,4 +1,5 @@
-# python3.4
+#/usr/bin/env python3.4
+#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/acts/framework/acts/controllers/native_android_device.py b/acts/framework/acts/controllers/native_android_device.py
index 5c19387..27fc01c 100644
--- a/acts/framework/acts/controllers/native_android_device.py
+++ b/acts/framework/acts/controllers/native_android_device.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/jsonrpc.py b/acts/framework/acts/jsonrpc.py
index 5c0ddc9..6bb364a 100644
--- a/acts/framework/acts/jsonrpc.py
+++ b/acts/framework/acts/jsonrpc.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python3.4
-# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-
-# Copyright 2014- Google, Inc.
+#!/usr/bin/env python3.4
+#
+# Copyright 2016- Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -116,4 +115,4 @@
def __getattr__(self, name):
def rpc_call(*args):
return self.call('uci', name, *args)
- return rpc_call
\ No newline at end of file
+ return rpc_call
diff --git a/acts/framework/acts/keys.py b/acts/framework/acts/keys.py
index 3eecb26..40b06a0 100644
--- a/acts/framework/acts/keys.py
+++ b/acts/framework/acts/keys.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/logger.py b/acts/framework/acts/logger.py
index 00d828f..05e3769 100755
--- a/acts/framework/acts/logger.py
+++ b/acts/framework/acts/logger.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/records.py b/acts/framework/acts/records.py
index d6da33d..62b8828 100644
--- a/acts/framework/acts/records.py
+++ b/acts/framework/acts/records.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/signals.py b/acts/framework/acts/signals.py
index a937296..9da893a 100644
--- a/acts/framework/acts/signals.py
+++ b/acts/framework/acts/signals.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_runner.py b/acts/framework/acts/test_runner.py
index 2218268..1ac5010 100644
--- a/acts/framework/acts/test_runner.py
+++ b/acts/framework/acts/test_runner.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/bt/BleEnum.py b/acts/framework/acts/test_utils/bt/BleEnum.py
index 67e017f..8337e01 100644
--- a/acts/framework/acts/test_utils/bt/BleEnum.py
+++ b/acts/framework/acts/test_utils/bt/BleEnum.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py b/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py
index e337181..da2e26d 100644
--- a/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py
+++ b/acts/framework/acts/test_utils/bt/BluetoothBaseTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/bt/BtEnum.py b/acts/framework/acts/test_utils/bt/BtEnum.py
index 18de47b..8e00f44 100644
--- a/acts/framework/acts/test_utils/bt/BtEnum.py
+++ b/acts/framework/acts/test_utils/bt/BtEnum.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/framework/acts/test_utils/bt/bt_test_utils.py b/acts/framework/acts/test_utils/bt/bt_test_utils.py
index 792af12..7615ad5 100644
--- a/acts/framework/acts/test_utils/bt/bt_test_utils.py
+++ b/acts/framework/acts/test_utils/bt/bt_test_utils.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -576,7 +577,6 @@
def set_device_name(droid, name):
droid.bluetoothSetLocalName(name)
- # temporary (todo:tturney fix)
time.sleep(2)
droid_name = droid.bluetoothGetLocalName()
if droid_name != name:
@@ -655,8 +655,6 @@
for d in droids:
take_btsnoop_log(d, testcase, testname)
-# TODO (tturney): Fix this.
-
def take_btsnoop_log(droid, testcase, test_name):
"""Grabs the btsnoop_hci log on a device and stores it in the log directory
@@ -676,7 +674,7 @@
device_model = droid.getBuildModel()
device_model = device_model.replace(" ", "")
out_name = ','.join((test_name, device_model, serial))
- cmd = ''.join(("adb -s ", serial, " pull /sdcard/btsnoop_hci.log > ",
+ cmd = ''.join(("adb -s ", serial, " pull /sdcard/btsnoop_hci.log ",
testcase.log_path + "/" + out_name,
".btsnoop_hci.log"))
testcase.log.info("Test failed, grabbing the bt_snoop logs on {} {}."
diff --git a/acts/framework/acts/test_utils/bt/native_bt_test_utils.py b/acts/framework/acts/test_utils/bt/native_bt_test_utils.py
index e2e2272..f4623c6 100644
--- a/acts/framework/acts/test_utils/bt/native_bt_test_utils.py
+++ b/acts/framework/acts/test_utils/bt/native_bt_test_utils.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/framework/acts/test_utils/tel/TelephonyBaseTest.py b/acts/framework/acts/test_utils/tel/TelephonyBaseTest.py
index b79290b..b04947e 100644
--- a/acts/framework/acts/test_utils/tel/TelephonyBaseTest.py
+++ b/acts/framework/acts/test_utils/tel/TelephonyBaseTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_atten_utils.py b/acts/framework/acts/test_utils/tel/tel_atten_utils.py
index 2f4264e..d8cdebe 100644
--- a/acts/framework/acts/test_utils/tel/tel_atten_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_atten_utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_data_utils.py b/acts/framework/acts/test_utils/tel/tel_data_utils.py
index 711279d..87e4e5c 100644
--- a/acts/framework/acts/test_utils/tel/tel_data_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_data_utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_defines.py b/acts/framework/acts/test_utils/tel/tel_defines.py
index 7d23ec4..608a1c1 100644
--- a/acts/framework/acts/test_utils/tel/tel_defines.py
+++ b/acts/framework/acts/test_utils/tel/tel_defines.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_lookup_tables.py b/acts/framework/acts/test_utils/tel/tel_lookup_tables.py
index 291b6ae2..5db9a96 100644
--- a/acts/framework/acts/test_utils/tel/tel_lookup_tables.py
+++ b/acts/framework/acts/test_utils/tel/tel_lookup_tables.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_test_utils.py b/acts/framework/acts/test_utils/tel/tel_test_utils.py
index d63656b..b505749 100644
--- a/acts/framework/acts/test_utils/tel/tel_test_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_test_utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_video_utils.py b/acts/framework/acts/test_utils/tel/tel_video_utils.py
index 4a84584..609b10c 100644
--- a/acts/framework/acts/test_utils/tel/tel_video_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_video_utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/tel/tel_voice_utils.py b/acts/framework/acts/test_utils/tel/tel_voice_utils.py
index 3b8006f..04f5644 100644
--- a/acts/framework/acts/test_utils/tel/tel_voice_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_voice_utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/test_utils/wifi/wifi_test_utils.py b/acts/framework/acts/test_utils/wifi/wifi_test_utils.py
index 99135b0..b838fce 100755
--- a/acts/framework/acts/test_utils/wifi/wifi_test_utils.py
+++ b/acts/framework/acts/test_utils/wifi/wifi_test_utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 Google, Inc.
+# Copyright 2016 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/acts/utils.py b/acts/framework/acts/utils.py
index 3c5f389..42194a3 100755
--- a/acts/framework/acts/utils.py
+++ b/acts/framework/acts/utils.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/setup.py b/acts/framework/setup.py
index 4c2ee24..a2cd3cf 100755
--- a/acts/framework/setup.py
+++ b/acts/framework/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
from setuptools import setup
from setuptools import find_packages
diff --git a/acts/framework/tests/ActsRecordsTest.py b/acts/framework/tests/ActsRecordsTest.py
index 3a07865..710c5b1 100644
--- a/acts/framework/tests/ActsRecordsTest.py
+++ b/acts/framework/tests/ActsRecordsTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/tests/AttenuatorSanityTest.py b/acts/framework/tests/AttenuatorSanityTest.py
index 9492d89..8ce90d7 100644
--- a/acts/framework/tests/AttenuatorSanityTest.py
+++ b/acts/framework/tests/AttenuatorSanityTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright (C) 2015 The Android Open Source Project
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/framework/tests/BaseTestClassTests/ActsBaseClassTest.py b/acts/framework/tests/BaseTestClassTests/ActsBaseClassTest.py
index 49f37db..5d14c3d 100644
--- a/acts/framework/tests/BaseTestClassTests/ActsBaseClassTest.py
+++ b/acts/framework/tests/BaseTestClassTests/ActsBaseClassTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/framework/tests/Sl4aSanityTest.py b/acts/framework/tests/Sl4aSanityTest.py
index 400a5b9..9214639 100644
--- a/acts/framework/tests/Sl4aSanityTest.py
+++ b/acts/framework/tests/Sl4aSanityTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright (C) 2015 The Android Open Source Project
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/README b/acts/tests/README
deleted file mode 100644
index c7f2a4e..0000000
--- a/acts/tests/README
+++ /dev/null
@@ -1 +0,0 @@
-This folder contains tests written for the ACTS framework.
diff --git a/acts/tests/google/ble/api/BleAdvertiseApiTest.py b/acts/tests/google/ble/api/BleAdvertiseApiTest.py
index ca4789d..9ee6288 100644
--- a/acts/tests/google/ble/api/BleAdvertiseApiTest.py
+++ b/acts/tests/google/ble/api/BleAdvertiseApiTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -29,8 +30,6 @@
from acts.test_utils.bt.BleEnum import AdvertiseSettingsAdvertiseTxPower
from acts.test_utils.bt.BleEnum import JavaInteger
-# TODO: Refactor to work like BleScanApiTest.
-
class BleAdvertiseVerificationError(Exception):
@@ -1075,7 +1074,6 @@
return False
return test_result
- # TODO: in code refactor, remove all verify helper functions.
def verify_adv_settings_adv_mode(self, droid, exp_adv_mode):
try:
droid.bleSetAdvertiseSettingsAdvertiseMode(exp_adv_mode)
diff --git a/acts/tests/google/ble/api/BleScanApiTest.py b/acts/tests/google/ble/api/BleScanApiTest.py
index afbc7e3..9bfb52f 100644
--- a/acts/tests/google/ble/api/BleScanApiTest.py
+++ b/acts/tests/google/ble/api/BleScanApiTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -1275,7 +1276,6 @@
scan_callback = droid.bleGenLeScanCallback()
return self.verify_classic_ble_scan_with_service_uuids(
droid, scan_callback, service_uuid_list)
- # TODO: remove this when refactoring code
def verify_classic_ble_scan_with_service_uuids(
self, droid, scan_callback, service_uuid_list):
diff --git a/acts/tests/google/ble/api/GattApiTest.py b/acts/tests/google/ble/api/GattApiTest.py
index 4f39602..e5df3b1 100644
--- a/acts/tests/google/ble/api/GattApiTest.py
+++ b/acts/tests/google/ble/api/GattApiTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/beacon_tests/BeaconSwarmTest.py b/acts/tests/google/ble/beacon_tests/BeaconSwarmTest.py
index 73460c3..2da6e96 100644
--- a/acts/tests/google/ble/beacon_tests/BeaconSwarmTest.py
+++ b/acts/tests/google/ble/beacon_tests/BeaconSwarmTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/bug_testing/BugsTest.py b/acts/tests/google/ble/bug_testing/BugsTest.py
deleted file mode 100644
index 48193e7..0000000
--- a/acts/tests/google/ble/bug_testing/BugsTest.py
+++ /dev/null
@@ -1,634 +0,0 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-"""
-This test script that acts as a sandbox for testing various bugs. Testcases here
-may eventually be made into actual testscases later.
-"""
-
-import concurrent
-import pprint
-import time
-
-from queue import Empty
-from acts.base_test import BaseTestClass
-from acts.test_utils.bt.BleEnum import *
-from acts.test_utils.bt.bt_test_utils import *
-
-
-class BugsTest(BaseTestClass):
- tests = None
- default_timeout = 10
-
- def __init__(self, controllers):
- BaseTestClass.__init__(self, controllers)
- self.tests = (
- "test_scan_advertise_50",
- "test_swarm_scan",
- "test_three_advertisers_and_three_scanners",
- "test_dual_scans",
- "test_multiple_advertisers_on_batch_scan_result",
- "test_advertisement_service_uuid",
- "test_btu_hci_advertisement_crash",
- "test_deep_sleep_advertising",
- "test_random_mac_address_filtering",
- "test_advertisement",
- "test_28_advertisers",
- )
-
- def setup_class(self):
- self.droid1, self.ed1 = self.android_devices[1].get_droid()
- self.ed1.start()
- return setup_multiple_devices_for_bt_test(self.droids, self.eds)
-
- def on_fail(self, test_name, begin_time):
- take_btsnoop_logs(self.droids, self, test_name)
- reset_bluetooth(self.droids, self.eds)
-
- # Handler Functions Begin
- def blescan_verify_onfailure_event_handler(self, event):
- self.log.debug("Verifying onFailure event")
- self.log.debug(pprint.pformat(event))
- return event
-
- def bleadvertise_verify_onsuccess_handler(self, event):
- self.log.debug(pprint.pformat(event))
- return True
-
- def ble_scan_get_mac_address_handler(self, event):
- self.log.info(pprint.pformat(event))
- return event['data']['Result']['deviceInfo']['address']
-
- def blescan_verify_onscanresult_event_handler(self, event,
- expected_callbacktype=None,
- system_time_nanos=None):
- test_result = True
- self.log.debug("Verifying onScanResult event")
- self.log.debug(pprint.pformat(event))
- callbacktype = event['data']['CallbackType']
- if callbacktype != expected_callbacktype:
- self.log.debug(" ".join(["Expected callback type:",str(expected_callbacktype),
- ", Found callback type: " + str(callbacktype)]))
- test_result = False
- return test_result
-
- def blescan_verify_onscanresult_event_handler2(self, event,
- system_time_nanos=None):
- test_result = True
- self.log.debug("Verifying onScanResult event")
- self.log.debug(pprint.pformat(event))
- return event['data']['Result']['deviceInfo']['address']
-
- ble_device_addresses = []
-
- def blescan_verify_onbatchscanresult_event_handler(self, event):
- """
- An event handler that validates the onBatchScanResult
- :param event: dict that represents the callback onBatchScanResult
- :return: test_result: bool
- """
- # Todo: Implement proper validation steps.
- test_result = True
- self.log.debug("Verifying onBatchScanResult event")
- self.log.debug(pprint.pformat(event))
- print(pprint.pformat(event))
- for event in event['data']['Results']:
- address = event['deviceInfo']['address']
- if address not in self.ble_device_addresses:
- self.ble_device_addresses.append(address)
- return test_result
- # Handler Functions End
-
- def test_scan_advertise_50(self):
- self.log.debug("Step 1: Setting up environment")
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- self.log.debug(
- "Step 3: Create default scan filter, scan settings, and scan callback")
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- n = 0
- while n < 50:
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data,
- advertise_settings)
- if not test_result:
- self.log.debug("Advertising failed.")
- return test_result
- self.log.debug("Step 4: Start Bluetooth Le Scan on callback ID: " + str(
- scan_callback))
- test_result = scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- self.log.debug(
- "Step 5: Verify the Bluetooth Le Scan did not cause an onScanFailed event.")
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), self.default_timeout)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug("Test failed with TimeoutError: " + str(error))
- scan_droid.bleStopBleScan(scan_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- advertise_droid.bluetoothToggleState(False)
- advertise_droid.bluetoothToggleState(True)
- time.sleep(12)
- n += 1
- return test_result
-
- def test_swarm_scan(self):
- self.log.debug("Step 1: Setting up environment")
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- self.log.debug(
- "Step 3: Create default scan filter, scan settings, and scan callback")
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- n = 0
- while n < 10000:
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- test_result = scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- self.log.debug(
- "Step 5: Verify the Bluetooth Le Scan did not cause an onScanFailed event.")
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), self.default_timeout)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug("Test failed with TimeoutError: " + str(error))
- scan_droid.bleStopBleScan(scan_callback)
- n += 1
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- return test_result
-
- def test_dual_scans(self):
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- scan_droid2, scan_event_dispatcher2 = self.droid1, self.ed1
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- filter_list2, scan_settings2, scan_callback2 = generate_ble_scan_objects(
- scan_droid2)
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- expected_event_name2 = "BleScan" + str(scan_callback2) + "onScanResults"
- n = 0
- while n < 1000000:
- test_result = scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- test_result = scan_droid2.bluetoothStartBleScan(filter_list2,scan_settings2,scan_callback2)
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), self.default_timeout)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug("Test failed with TimeoutError: " + str(error))
- worker2 = scan_event_dispatcher2.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name2, ([1]), self.default_timeout)
- try:
- self.log.debug(worker2.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug("Test failed with TimeoutError: " + str(error))
- scan_droid.bleStopBleScan(scan_callback)
- scan_droid2.bluetoothStopBleScan(scan_callback2)
- n += 1
- return test_result
-
- def test_three_advertisers_and_three_scanners(self):
- self.log.debug("Step 1: Setting up environment")
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- self.log.debug(
- "Step 3: Create default scan filter, scan settings, and scan callback")
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- filter_list1, scan_settings1, scan_callback1 = generate_ble_scan_objects(
- scan_droid)
- filter_list2, scan_settings2, scan_callback2 = generate_ble_scan_objects(
- scan_droid)
-
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- advertise_callback1, advertise_data1, advertise_settings1 = (
- generate_ble_advertise_objects(advertise_droid))
- advertise_callback2, advertise_data2, advertise_settings2 = (
- generate_ble_advertise_objects(advertise_droid))
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback1, advertise_data1,
- advertise_settings1)
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback2, advertise_data2,
- advertise_settings2)
-
- test_result = scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- test_result = scan_droid.bleStartBleScan(filter_list1,scan_settings1,scan_callback1)
- test_result = scan_droid.bleStartBleScan(filter_list2,scan_settings2,scan_callback2)
- time.sleep(30)
- self.log.debug(
- "Step 5: Verify the Bluetooth Le Scan did not cause an onScanFailed event.")
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), self.default_timeout)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug("Test failed with TimeoutError: " + str(error))
- scan_droid.bleStopBleScan(scan_callback)
- scan_droid.bleStopBleScan(scan_callback1)
- scan_droid.bleStopBleScan(scan_callback2)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback1)
- advertise_droid.bleStopBleAdvertising(advertise_callback2)
-
- return test_result
-
- def test_multiple_advertisers_on_batch_scan_result(self):
- """
- Test that exercises onBatchScanResults against one device advertising its
- max advertisements.
- This is different from the BeaconSwarmTest:test_swarm_no_attenuation in
- that it uses a second android device's advertisements instead of standalone
- ble beacons.
-
- Steps:
- 1. Setup the scanning android device
- 2. Setup max (4) advertisements on secondary device.
- 3. Verify that one hundred onBatchScanResult callback was triggered.
- :return: test_result: bool
- """
- test_result = True
- max_advertisers = 4
- ad_callbacks = []
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- for x in range(max_advertisers):
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- expected_advertise_event_name = "".join(["BleAdvertise",str(advertise_callback),"onSuccess"])
- worker = advertise_event_dispatcher.handle_event(
- self.bleadvertise_verify_onsuccess_handler, expected_advertise_event_name, ([]),
- self.default_timeout)
- ad_callbacks.append(advertise_callback)
- #self.attenuators[0].set_atten(0, 0)
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- scan_droid.bleSetScanSettingsReportDelayMillis(1000)
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "".join(["BleScan",str(scan_callback),"onBatchScanResult"])
- scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- n = 0
- while n < 100:
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onbatchscanresult_event_handler,
- expected_event_name, ([]), self.default_timeout)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug(" ".join(["Test failed with Empty error:",str(error)]))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug(" ".join(["Test failed with TimeoutError:",str(error)]))
- n+=1
- scan_droid.bleStopBleScan(scan_callback)
- for x in ad_callbacks:
- advertise_droid.bleStopBleAdvertising(x)
- print (self.ble_device_addresses) #temporary
- print (str(len(self.ble_device_addresses))) #temporary
- return test_result
-
- def test_advertisement_service_uuid(self):
- test_result = True
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- advertise_droid.bleSetAdvertiseDataSetServiceUuids(["00000000-0000-1000-8000-00805f9b34fb"])
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
-
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
-
- test_result = scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- time.sleep(30)
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), self.default_timeout)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug("Test failed with TimeoutError: " + str(error))
- scan_droid.bleStopBleScan(scan_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
-
- return test_result
-
-
- #{'is_connectable': True, 'mode': 0, 'tx_power_level': 2}
- def test_btu_hci_advertisement_crash(self):
- test_result = True
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- x = 0
- while x < 50:
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_POWER.value)
- advertise_droid.bleSetAdvertiseSettingsIsConnectable(True)
- advertise_droid.bleSetAdvertiseSettingsTxPowerLevel(2)
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
-
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- x+=1
-
- return test_result
-
- def test_deep_sleep_advertising(self):
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- max_advertisements = 4
- advertisement_callback_list = []
- advertisement_mac_addr_list = []
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- while len(advertisement_mac_addr_list) < max_advertisements:
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- advertisement_callback_list.append(advertise_callback)
- advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- worker = scan_event_dispatcher.handle_event(
- self.ble_scan_get_mac_address_handler,
- expected_event_name, (), self.default_timeout)
- try:
- mac_address = worker.result(self.default_timeout)
- print(mac_address)
- if mac_address not in advertisement_mac_addr_list:
- advertisement_mac_addr_list.append(mac_address)
- except Exception:
- self.log.info("failed to find advertisement")
- scan_droid.bleStopBleScan(scan_callback)
- print("putting advertise droid to sleep")
- try:
- print (pprint.pformat(self.ed1.pop_all(expected_event_name)))
- except Exception:
- print ("lol fail")
- advertise_droid.setDeepSleep(960000) #16 minutes
- advertise_droid.wakeUpNow()
- scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- advertisement_mac_addr_list2 = []
- while len(advertisement_mac_addr_list2) < max_advertisements:
- worker = scan_event_dispatcher.handle_event(
- self.ble_scan_get_mac_address_handler,
- expected_event_name, (), self.default_timeout)
- try:
- mac_address = worker.result(self.default_timeout)
- print(mac_address)
- if mac_address not in advertisement_mac_addr_list2:
- advertisement_mac_addr_list2.append(mac_address)
- except Exception:
- self.log.info("failed to find advertisement")
- scan_droid.bleStopBleScan(scan_callback)
- diff_list = list(set(advertisement_mac_addr_list) - set(advertisement_mac_addr_list2))
- print(pprint.pformat(advertisement_mac_addr_list))
- print(pprint.pformat(advertisement_mac_addr_list2))
- for callback in advertisement_callback_list:
- advertise_droid.bleStopBleAdvertising(callback)
- print("new callback")
- print(pprint.pformat(diff_list))
- print("done")
- if len(diff_list) != max_advertisements:
- return False
- else:
- return True
-
- def test_random_mac_address_filtering(self):
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertisement_callback_list = []
- advertisement_mac_addr_list = []
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- advertisement_callback_list.append(advertise_callback)
- advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- worker = scan_event_dispatcher.handle_event(
- self.ble_scan_get_mac_address_handler,
- expected_event_name, (), self.default_timeout)
- mac_address = None
- try:
- mac_address = worker.result(self.default_timeout)
- print(mac_address)
- if mac_address not in advertisement_mac_addr_list:
- advertisement_mac_addr_list.append(mac_address)
- except Exception:
- self.log.info("failed to find advertisement")
- try:
- scan_event_dispatcher.stop()
- scan_event_dispatcher.start()
- except Exception:
- print("do nothing")
- scan_droid.bleStopBleScan(scan_callback)
- print("This mac address is being set for a filter: " + mac_address)
- filter_list2 = scan_droid.bleGenFilterList()
- scan_droid.bleSetScanFilterDeviceAddress(mac_address)
- scan_droid.bleBuildScanFilter(filter_list)
- scan_settings2 = scan_droid.bleBuildScanSetting()
- scan_callback2 = scan_droid.bleGenScanCallback()
-
- scan_droid.bleStartBleScan(filter_list2,scan_settings2,scan_callback2)
- expected_event_name = "BleScan" + str(scan_callback2) + "onScanResults"
- worker = scan_event_dispatcher.handle_event(
- self.ble_scan_get_mac_address_handler,
- expected_event_name, (), self.default_timeout)
- try:
- mac_address = worker.result(self.default_timeout)
- print(mac_address)
- if mac_address not in advertisement_mac_addr_list:
- advertisement_mac_addr_list.append(mac_address)
- except Exception:
- self.log.info("failed to find advertisement")
- return False
- scan_droid.bleStopBleScan(scan_callback2)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- return True
-
-
-
- def test_advertisement(self):
- test_result = True
- max_advertisers = 4
- ad_callbacks = []
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- #if False:
- # from acts.etc.development.ide.pycharm.android_intellisense import AndroidIntellisense
- # assert isinstance(advertise_droid, AndroidIntellisense)
- advertiser_local_name = advertise_droid.bluetoothGetLocalName()
- advertise_droid.bleSetAdvertiseDataIncludeDeviceName(False)
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- print("Sleeping")
- #time.sleep(30)
- expected_advertise_event_name = "".join(["BleAdvertise",str(advertise_callback),"onSuccess"])
- worker = advertise_event_dispatcher.handle_event(
- self.bleadvertise_verify_onsuccess_handler, expected_advertise_event_name, ([]),
- self.default_timeout)
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- filter_list = scan_droid.bleGenFilterList()
- scan_droid.bleSetScanFilterDeviceName(advertiser_local_name)
- scan_droid.bleBuildScanFilter(filter_list)
- scan_settings = scan_droid.bleBuildScanSetting()
- scan_callback = scan_droid.bleGenScanCallback()
- expected_event_name = "".join(["BleScan",str(scan_callback),"onScanResult"])
- scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), self.default_timeout)
- try:
- self.log.info(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug(" ".join(["Test failed with Empty error:",str(error)]))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug(" ".join(["Test failed with TimeoutError:",str(error)]))
- scan_droid.bleStopBleScan(scan_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- print("Advertiser " + advertise_droid.bluetoothGetLocalName())
- print("Scanner" + scan_droid.bluetoothGetLocalName())
- return test_result
-
- def test_28_advertisers(self):
- self.log.debug("Step 1: Setting up environment")
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- max_advertisements = 28
- advertise_callback_list = []
- d_counter = 0
- sprout_counter = 0
- while d_counter < len(self.droids):
- advertise_droid, advertise_event_dispatcher = self.droids[d_counter], self.eds[d_counter]
- d_counter+=1
- sprout_names = ["Sprout","Micromax AQ4501","4560MMX"]
- print("Checking device model")
- if advertise_droid.getBuildModel() not in sprout_names:
- continue
- n = 0
- sprout_counter+=1
- while n < max_advertisements:
- advertise_droid.bleSetAdvertiseDataIncludeDeviceName(True)
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- test_result = advertise_droid.bleStartBleAdvertising(advertise_callback, advertise_data, advertise_settings)
- expected_advertise_event_name = "".join(["BleAdvertise",str(advertise_callback),"onSuccess"])
- worker = advertise_event_dispatcher.handle_event(
- self.bleadvertise_verify_onsuccess_handler, expected_advertise_event_name, ([]),
- self.default_timeout)
- try:
- worker.result()
- except Exception as e:
- self.log.info("Advertising failed due to " + str(e))
- reset_bluetooth(self.droids, self.eds)
- return False
- print (str(n) + "th advertisement successful")
- n+=1
- mac_address_list = []
- done = False
- advertisements_to_find = sprout_counter * max_advertisements
- min_advertisements_to_pass = int(advertisements_to_find * 0.9)
- print("START SNIFFER")
- time.sleep(30)
- end_time = time.time() + 120
- while not done and time.time() < end_time:
- print("try again " + str(mac_address_list))
- print(str(len(mac_address_list)))
- filter_list = scan_droid.bleGenFilterList()
- scan_droid.bleSetScanFilterDeviceName("Micromax AQ4501")
- scan_droid.bleBuildScanFilter(filter_list)
- scan_droid.bleSetScanFilterDeviceName("4560MMX")
- scan_droid.bleBuildScanFilter(filter_list)
- scan_settings = scan_droid.bleBuildScanSetting()
- scan_callback = scan_droid.bleGenScanCallback()
- scan_droid.bleStartBleScan(filter_list,scan_settings,scan_callback)
- expected_event_name = "BleScan" + str(scan_callback) + "onScanResults"
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler2,
- expected_event_name, ([]), self.default_timeout)
- try:
- mac_address = worker.result(self.default_timeout)
- print(mac_address)
- if mac_address not in mac_address_list:
- mac_address_list.append(mac_address)
- print (str(len(mac_address_list)) + " advertisements found")
- if len(mac_address_list) >= advertisements_to_find:
- done = True
- except Empty as error:
- test_result = False
- self.log.debug("Test failed with Empty error: " + str(error))
- except concurrent.futures._base.TimeoutError as error:
- self.log.debug("Test failed with TimeoutError: " + str(error))
- scan_droid.bleStopBleScan(scan_callback)
- return test_result
diff --git a/acts/tests/google/ble/concurrency/ConcurrentBleAdvertisingTest.py b/acts/tests/google/ble/concurrency/ConcurrentBleAdvertisingTest.py
index daff1d7..ae030d7 100644
--- a/acts/tests/google/ble/concurrency/ConcurrentBleAdvertisingTest.py
+++ b/acts/tests/google/ble/concurrency/ConcurrentBleAdvertisingTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py b/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py
index afba9b3..4f62356 100644
--- a/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py
+++ b/acts/tests/google/ble/concurrency/ConcurrentBleScanningTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/distance_tests/BleDistanceTest.py b/acts/tests/google/ble/distance_tests/BleDistanceTest.py
deleted file mode 100644
index b24b0a8..0000000
--- a/acts/tests/google/ble/distance_tests/BleDistanceTest.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-"""
-This test script exercises distance based testcases.
-
-This test script was designed with this setup in mind:
-Shield box one: Android Device
-Shield box two: Android Device
-An attenuator sitting in between the two shield boxes.
-"""
-
-import pprint
-
-from queue import Empty
-
-from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest
-from acts.test_utils.bt.bt_test_utils import generate_ble_advertise_objects
-from acts.test_utils.bt.bt_test_utils import generate_ble_scan_objects
-
-
-class BleDistanceTest(BluetoothBaseTest):
- tests = None
- default_timeout = 10
-
- def __init__(self, controllers):
- BluetoothBaseTest.__init__(self, controllers)
- self.droid1, self.ed1 = self.droids[1], self.eds[1]
- self.tests = (
- "test_scan_default_advertisement_high_attenuation",
- )
-
- def cleanup_class(self):
- self.attenuators[0].set_atten(0, 90)
-
- def blescan_verify_onscanresult_event_handler(self, event):
- """
- An event handler that validates the onScanResult event.
- :param event: dict that represents the callback onScanResult
- :return: test_result: bool
- """
- # Todo: Implement proper validation steps.
- test_result = True
- self.log.debug("Verifying onScanResult event")
- self.log.debug(pprint.pformat(event))
- return test_result
-
- @BluetoothBaseTest.bt_test_wrap
- def test_scan_default_advertisement_high_attenuation(self):
- """
- Test that tests a large distance between the advertiser android and the
- scanner android.
- Steps:
- 1. Set attenuation to 90 (the highest value for the attenuator).
- 2. Setup the scanning android device
- 3. Setup the advertiser android devices.
- 3. Verify that no onScanResult callbacks were recorded.
- :return: test_result: bool
- """
- test_result = True
- self.attenuators[0].set_atten(0, 90)
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "".join(
- ["BleScan", str(scan_callback), "onScanResults"])
- advertise_droid.bleSetAdvertiseDataIncludeDeviceName(True)
- advertise_droid.bleSetAdvertiseDataIncludeTxPowerLevel(True)
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- advertise_droid.bleStartBleAdvertising(
- advertise_callback, advertise_data, advertise_settings)
- if test_result is False:
- self.log.debug("Advertising failed.")
- return test_result
- scan_droid.bleStartBleScan(filter_list, scan_settings, scan_callback)
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([]), self.default_timeout)
- try:
- event_info = scan_event_dispatcher.pop_event(expected_event_name,
- 10)
- self.log.debug("Unexpectedly found an advertiser: {}".format(
- pprint.pformat(event_info)))
- test_result = False
- except Empty as error:
- self.log.debug("No events were found as expected.")
- scan_droid.bleStopBleScan(scan_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- return test_result
diff --git a/acts/tests/google/ble/examples/BleExamplesTest.py b/acts/tests/google/ble/examples/BleExamplesTest.py
index edf5ee3..83801d7 100644
--- a/acts/tests/google/ble/examples/BleExamplesTest.py
+++ b/acts/tests/google/ble/examples/BleExamplesTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/filtering/FilteringTest.py b/acts/tests/google/ble/filtering/FilteringTest.py
index 97614d6..e019107 100644
--- a/acts/tests/google/ble/filtering/FilteringTest.py
+++ b/acts/tests/google/ble/filtering/FilteringTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -179,10 +180,8 @@
"test_filters_suite",
"test_filters_suite_opportunistic_scan",
"test_non_connectable_advertise_data",
- # "test_multi_manufacturer_specific_data",
)
- # Handler Functions Begin
def blescan_verify_onfailure_event_handler(self, event):
self.log.debug("Verifying {} event".format(adv_fail))
self.log.debug(pprint.pformat(event))
@@ -221,11 +220,6 @@
self.log.error(
"Expected to find tx power level in event but found none.")
test_result = False
- # TODO: (tturney) Need to investigate, possible bug here
- # elif 'txPowerLevel' in event['data']['Result'].keys():
- # self.log.error("Tx power level found when it wasn't meant "
- # "to be included.")
- # test_result = False
if not event['data']['Result']['rssi']:
self.log.error("Expected rssi in the advertisement, found none.")
test_result = False
@@ -278,8 +272,6 @@
test_result = False
return test_result
- # Handler Functions End
-
def _magic(self, params):
(filters, settings_in_effect) = params
test_result = True
@@ -623,20 +615,6 @@
return True
@BluetoothBaseTest.bt_test_wrap
- def test_multi_manufacturer_specific_data(self):
-
- settings = [
- {'mode': AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value}]
- multi = self._get_combinations(
- self.multi_manufacturer_specific_data_suite)
- params = list(it.product(multi, settings))
- failed = self.run_generated_testcases(
- self._magic, params, tag="multi_manu_data")
- if failed:
- return True
- return False
-
- @BluetoothBaseTest.bt_test_wrap
def test_non_connectable_advertise_data(self):
"""Test non connectable advertisement data.
diff --git a/acts/tests/google/ble/filtering/UniqueFilteringTest.py b/acts/tests/google/ble/filtering/UniqueFilteringTest.py
index 6f09d97..a522e34 100644
--- a/acts/tests/google/ble/filtering/UniqueFilteringTest.py
+++ b/acts/tests/google/ble/filtering/UniqueFilteringTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -391,8 +392,6 @@
TAGS: LE, Advertising, Filtering, Scanning
Priority: 2
"""
- # TODO: (tturney) waiting on input from team on how we handle this
- # situation.
test_result = True
self.adv_droid.bleSetAdvertiseSettingsAdvertiseMode(
AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
diff --git a/acts/tests/google/ble/gatt/GattConnectTest.py b/acts/tests/google/ble/gatt/GattConnectTest.py
index 81a49ac..23a4c09 100644
--- a/acts/tests/google/ble/gatt/GattConnectTest.py
+++ b/acts/tests/google/ble/gatt/GattConnectTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -675,7 +676,6 @@
self.default_timeout)))
return True
- #TODO (tturney): Refactor to make this easier to run.
@BluetoothBaseTest.bt_test_wrap
def test_write_characteristic(self):
"""Test GATT connection writing characteristics.
@@ -816,9 +816,36 @@
)
return True
- # TODO: (tturney) fix this, documentation
@BluetoothBaseTest.bt_test_wrap
def test_write_characteristic_stress(self):
+ """Test GATT connection writing characteristics in quick succession.
+
+ Test establishing a gatt connection between a GATT server and GATT
+ client and exercise writing a characteristic. Do this quickly 100 times.
+
+ Steps:
+ 1. Start a generic advertisement.
+ 2. Start a generic scanner.
+ 3. Find the advertisement and extract the mac address.
+ 4. Stop the first scanner.
+ 5. Create a GATT connection between the scanner and advertiser.
+ 6. Discover services.
+ 7. Set discovered characteristic notification to True.
+ 8. Write data to the characteristic 100 times as fast as possible.
+ 9. Send a response from the peripheral to the central.
+ 10. Disconnect the GATT connection.
+
+ Expected Result:
+ The characteristic data should be written successfully each iteration
+
+ Returns:
+ Pass if True
+ Fail if False
+
+ TAGS: LE, Advertising, Filtering, Scanning, GATT, Stress,
+ Characteristics, Descriptors
+ Priority: 1
+ """
gatt_server_callback, gatt_server = self._setup_multiple_services()
if not gatt_server_callback or not gatt_server:
return False
@@ -894,35 +921,67 @@
self.default_timeout)))
return True
- # TODO: (tturney) Work in progress...
- @BluetoothBaseTest.bt_test_wrap
- def test_cross_key_pairing(self):
- # gatt_server_callback, gatt_server = self._setup_multiple_services()
+ def test_gatt_connect_mitm_attack(self):
+ """Test GATT connection with permission write encrypted mitm.
+
+ Test establishing a gatt connection between a GATT server and GATT
+ client while the GATT server's characteristic includes the property
+ write value and the permission write encrypted mitm value. This will
+ prompt LE pairing and then the devices will create a bond.
+
+ Steps:
+ 1. Create a GATT server and server callback on the peripheral device.
+ 2. Create a unique service and characteristic uuid on the peripheral.
+ 3. Create a characteristic on the peripheral with these properties:
+ BluetoothGattCharacteristic.PROPERTY_WRITE.value,
+ BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM.value
+ 4. Create a GATT service on the peripheral.
+ 5. Add the characteristic to the GATT service.
+ 6. Create a GATT connection between your central and peripheral device.
+ 7. From the central device, discover the peripheral's services.
+ 8. Iterate the services found until you find the unique characteristic
+ created in step 3.
+ 9. Once found, write a random but valid value to the characteristic.
+ 10. Start pairing helpers on both devices immediately after attempting
+ to write to the characteristic.
+ 11. Within 10 seconds of writing the characteristic, there should be
+ a prompt to bond the device from the peripheral. The helpers will
+ handle the UI interaction automatically. (see
+ BluetoothConnectionFacade.java bluetoothStartPairingHelper).
+ 12. Verify that the two devices are bonded.
+
+ Expected Result:
+ Verify that a connection was established and the devices are bonded.
+
+ Returns:
+ Pass if True
+ Fail if False
+
+ TAGS: LE, Advertising, Filtering, Scanning, GATT, Characteristic, MITM
+ Priority: 1
+ """
gatt_server_callback = (
self.per_droid.gattServerCreateGattServerCallback())
gatt_server = self.per_droid.gattServerOpenGattServer(
gatt_server_callback)
- characteristic_input = [
- {
- 'uuid': "aa7edd5a-4d1d-4f0e-883a-d145616a1630",
- 'property': BluetoothGattCharacteristic.PROPERTY_WRITE.value |
- BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE.value,
- 'permission': BluetoothGattCharacteristic.PROPERTY_WRITE.value
- },
- ]
- characteristic_list = setup_gatt_characteristics(
- self.per_droid, characteristic_input)
+ service_uuid = "3846D7A0-69C8-11E4-BA00-0002A5D5C51B"
+ test_uuid = "aa7edd5a-4d1d-4f0e-883a-d145616a1630"
+ bonded = False
+ characteristic = self.per_droid.gattServerCreateBluetoothGattCharacteristic(
+ test_uuid,
+ BluetoothGattCharacteristic.PROPERTY_WRITE.value,
+ BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM.value
+ )
gatt_service = self.per_droid.gattServerCreateService(
- "3846d7a0-69c8-11e4-ba00-0002a5d5c51b",
- BluetoothGattService.SERVICE_TYPE_PRIMARY.value)
- self.per_droid.gatt_serviceAddCharacteristicToService(
- gatt_service, characteristic_list[0])
- self.per_droid.gattServerAddService(gatt_server, gatt_service)
- self.per_droid.gattServerAddService(gatt_server, gatt_service)
+ service_uuid,
+ BluetoothGattService.SERVICE_TYPE_PRIMARY.value
+ )
+ self.per_droid.gattServerAddCharacteristicToService(
+ gatt_service, characteristic)
self.per_droid.gattServerAddService(gatt_server, gatt_service)
result = self._find_service_added_event(
gatt_server_callback,
- "3846d7a0-69c8-11e4-ba00-0002a5d5c51b")
+ service_uuid)
if not result:
return False
bluetooth_gatt, gatt_callback, adv_callback = (
@@ -937,32 +996,29 @@
else:
self.log.info("Failed to discover services.")
return False
+ test_value = "1,2,3,4,5,6,7"
services_count = self.cen_droid.gattClientGetDiscoveredServicesCount(
discovered_services_index)
- print("services count {}".format(services_count))
- connected_device_list = self.per_droid.gattServerGetConnectedDevices(
- gatt_server)
- if len(connected_device_list) == 0:
- self.log.info("No devices connected from peripheral.")
- return False
- bt_device_id = 0
- status = 1
- offset = 1
- test_value = "1,2,3,4,5,6,7"
- test_value_return = "1,2,3"
for i in range(services_count):
characteristic_uuids = (
self.cen_droid.gattClientGetDiscoveredCharacteristicUuids(
discovered_services_index, i))
- print(characteristic_uuids)
- for characteristic in characteristic_uuids:
- self.cen_droid.gattClientCharacteristicSetValue(
- bluetooth_gatt, discovered_services_index, i,
- characteristic, test_value)
- print (self.cen_droid.gattClientWriteCharacteristic(
- bluetooth_gatt, discovered_services_index, i,
- characteristic))
- self.cen_droid.gattClientReadCharacteristic(
- bluetooth_gatt, discovered_services_index, i,
- characteristic)
+ for characteristic_uuid in characteristic_uuids:
+ if characteristic_uuid == test_uuid:
+ self.cen_droid.bluetoothStartPairingHelper()
+ self.per_droid.bluetoothStartPairingHelper()
+ self.cen_droid.gattClientCharacteristicSetValue(
+ bluetooth_gatt, discovered_services_index, i,
+ characteristic_uuid, test_value)
+ self.cen_droid.gattClientWriteCharacteristic(
+ bluetooth_gatt, discovered_services_index, i,
+ characteristic_uuid)
+ start_time = time.time() + self.default_timeout
+ target_name = self.per_droid.bluetoothGetLocalName()
+ while time.time() < start_time and bonded == False:
+ bonded_devices = self.cen_droid.bluetoothGetBondedDevices()
+ for device in bonded_devices:
+ if 'name' in device.keys() and device['name'] == target_name:
+ bonded = True
+ break
return True
diff --git a/acts/tests/google/ble/scan/BatchingTest.py b/acts/tests/google/ble/scan/BatchingTest.py
deleted file mode 100644
index 8784e6b..0000000
--- a/acts/tests/google/ble/scan/BatchingTest.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-"""
-This test script exercises batch scanning scenarios.
-"""
-
-import pprint
-from queue import Empty
-import time
-from contextlib import suppress
-
-from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest
-from acts.test_utils.bt.bt_test_utils import generate_ble_advertise_objects
-from acts.test_utils.bt.bt_test_utils import scan_result
-
-# TODO: (tturney) finish separating out testcases in various suits out to here.
-
-
-class BatchingTest(BluetoothBaseTest):
- tests = None
- default_timeout = 10
-
- def __init__(self, controllers):
- BluetoothBaseTest.__init__(self, controllers)
- self.droid1, self.ed1 = self.droids[1], self.eds[1]
- self.tests = (
- "test_automatic_clearing_of_batch_data",
- )
-
- #TODO: (tturney) finish testcase.
- @BluetoothBaseTest.bt_test_wrap
- def test_automatic_clearing_of_batch_data(self):
- """Test automatic clearing of batch data.
-
- Test establishing a gatt connection between a GATT server and GATT
- client.
-
- Steps:
- 1.
-
- Expected Result:
-
- Returns:
- Pass if True
- Fail if False
-
- TAGS: LE, Advertising, Scanning, Batch Scanning
- Priority: 3
- """
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- ad_callback, ad_data, ad_settings = generate_ble_advertise_objects(
- advertise_droid)
- advertise_droid.bleStartBleAdvertising(
- ad_data, ad_settings, ad_callback)
-
- scan_filter_list = scan_droid.bleGenFilterList()
- scan_droid.bleBuildScanFilter(scan_filter_list)
- scan_droid.bleSetScanSettingsReportDelayMillis(1000)
- scan_settings = scan_droid.bleBuildScanSetting()
- scan_callback = scan_droid.bleGenScanCallback()
- system_time_nanos = scan_droid.getSystemElapsedRealtimeNanos()
- scan_droid.bleStartBleScan(
- scan_filter_list, scan_settings, scan_callback)
- expected_event = scan_result.format(scan_callback)
- scan_droid.pop_event(expected_event, self.default_timeout)
- return True
diff --git a/acts/tests/google/ble/scan/BleBackgroundScanTest.py b/acts/tests/google/ble/scan/BleBackgroundScanTest.py
index 05d3ea8..225f709 100644
--- a/acts/tests/google/ble/scan/BleBackgroundScanTest.py
+++ b/acts/tests/google/ble/scan/BleBackgroundScanTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2015 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/scan/BleOnLostOnFoundTest.py b/acts/tests/google/ble/scan/BleOnLostOnFoundTest.py
index fcaf01d..16eb587 100644
--- a/acts/tests/google/ble/scan/BleOnLostOnFoundTest.py
+++ b/acts/tests/google/ble/scan/BleOnLostOnFoundTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2015 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/scan/BleOpportunisticScanTest.py b/acts/tests/google/ble/scan/BleOpportunisticScanTest.py
index a99c21d..d786be4 100644
--- a/acts/tests/google/ble/scan/BleOpportunisticScanTest.py
+++ b/acts/tests/google/ble/scan/BleOpportunisticScanTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2015 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/scan/DeathToBluetoothTest.py b/acts/tests/google/ble/scan/DeathToBluetoothTest.py
index 27f19e4..d26031e 100644
--- a/acts/tests/google/ble/scan/DeathToBluetoothTest.py
+++ b/acts/tests/google/ble/scan/DeathToBluetoothTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2015 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -42,8 +43,6 @@
)
def teardown_test(self):
-# cleanup_scanners_and_advertisers(self.scn_droid, self.scn_ed, self.active_adv_callback_list,
-# self.adv_droid, self.adv_ed, self.active_adv_callback_list)
self.active_adv_callback_list = []
self.active_scan_callback_list = []
diff --git a/acts/tests/google/ble/system_tests/BleLongevityTest.py b/acts/tests/google/ble/system_tests/BleLongevityTest.py
deleted file mode 100644
index d811b6c..0000000
--- a/acts/tests/google/ble/system_tests/BleLongevityTest.py
+++ /dev/null
@@ -1,233 +0,0 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-import concurrent
-import pprint
-import time
-
-from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest
-from acts.controllers.event_dispatcher import IllegalStateError
-from queue import Empty
-from acts.test_utils.bt.BleEnum import AdvertiseSettingsAdvertiseMode
-from acts.test_utils.bt.bt_test_utils import generate_ble_advertise_objects
-from acts.test_utils.bt.bt_test_utils import generate_ble_scan_objects
-
-
-class BleLongevityTest(BluetoothBaseTest):
- tests = None
- default_timeout = 10
-
- def __init__(self, controllers):
- BluetoothBaseTest.__init__(self, controllers)
- self.droid1, self.ed1 = self.droids[1], self.eds[1]
- self.tests = (
- "test_b17040164",
- # "test_long_advertising_same_callback",
- )
-
- def blescan_verify_onscanresult_event_handler(self, event,
- expected_callbacktype=None,
- system_time_nanos=None):
- test_result = True
- self.log.debug("Verifying onScanResult event")
- self.log.debug(pprint.pformat(event))
- callbacktype = event['data']['CallbackType']
- if callbacktype != expected_callbacktype:
- self.log.debug(
- " ".join(["Expected callback type:", str(expected_callbacktype),
- ", Found callback type:", str(callbacktype)]))
- test_result = False
- return test_result
-
- def bleadvertise_verify_onsuccess_event_handler(self, event):
- test_result = True
- self.log.debug("Verifying onSuccess event")
- self.log.debug(pprint.pformat(event))
- return test_result
-
- @BluetoothBaseTest.bt_test_wrap
- def test_long_advertising_same_callback(self):
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "".join(
- ["BleScan", str(scan_callback), "onScanResults"])
- advertise_callback, advertise_data, advertise_settings = (
- generate_ble_advertise_objects(advertise_droid))
- looperCount = 100000
- expected_advertise_event = "".join(
- ["BleAdvertise", str(advertise_callback), "onSuccess"])
- while looperCount != 0:
- start = time.time()
- self.droid.eventClearBuffer()
- self.droid1.eventClearBuffer()
- test_result = advertise_droid.bleStartBleAdvertising(
- advertise_callback, advertise_data, advertise_settings)
-
- if not test_result:
- self.log.debug("Advertising failed.")
- return test_result
- self.log.debug(
- " ".join(["Start Bluetooth Le Scan on callback ID:",
- str(scan_callback)]))
-
- worker = advertise_event_dispatcher.handle_event(
- self.bleadvertise_verify_onsuccess_event_handler,
- expected_advertise_event, (), 20)
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with Empty error:", str(error)]))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with TimeoutError:", str(error)]))
-
- scan_droid.bleStartBleScan(
- filter_list, scan_settings, scan_callback)
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]), 20)
-
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with Empty error:", str(error)]))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with TimeoutError:", str(error)]))
- scan_droid.bleStopBleScan(scan_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- try:
- self.ed1.pop_all(expected_advertise_event)
- except IllegalStateError as error:
- self.log.debug(
- " ".join(["Device in an illigal state:", str(error)]))
- looperCount -= 1
- self.log.debug(
- " ".join(["Total time taken for this loop:", str(time.time() - start)]))
- time.sleep(2)
- start += 2
- self.log.debug(
- "Step 5: Verify the Bluetooth Le Scan did not cause an onScanFailed event.")
-
- return test_result
-
- @BluetoothBaseTest.bt_test_wrap
- def test_long_advertising_different_callback(self):
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "".join(
- ["BleScan", str(scan_callback), "onScanResults"])
- looperCount = 100000
-
- while looperCount != 0:
- start = time.time()
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- test_result = advertise_droid.bleStartBleAdvertising(
- advertise_callback, advertise_data, advertise_settings)
- expected_advertise_event = "".join(
- ["BleAdvertise", str(advertise_callback), "onSuccess"])
-
- if not test_result:
- self.log.debug("Advertising failed.")
- return test_result
-
- worker = advertise_event_dispatcher.handle_event(
- self.bleadvertise_verify_onsuccess_event_handler,
- expected_advertise_event, ())
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with Empty error:", str(error)]))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with TimeoutError: ", str(error)]))
- scan_droid.bleStartBleScan(
- filter_list, scan_settings, scan_callback)
- worker = scan_event_dispatcher.handle_event(
- self.blescan_verify_onscanresult_event_handler,
- expected_event_name, ([1]))
-
- try:
- self.log.debug(worker.result(self.default_timeout))
- except Empty as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with Empty error:", str(error)]))
- except concurrent.futures._base.TimeoutError as error:
- test_result = False
- self.log.debug(
- " ".join(["Test failed with TimeoutError: ", str(error)])).bluetoothStopBleScan(scan_callback)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- looperCount -= 1
- self.log.debug(
- " ".join(["Total time taken for this loop:", str(time.time() - start)]))
- time.sleep(2)
- start += 2
- self.log.debug(
- "Step 5: Verify the Bluetooth Le Scan did not cause an onScanFailed event.")
- return test_result
-
- @BluetoothBaseTest.bt_test_wrap
- def test_b17040164(self):
- test_result = True
- scan_droid, scan_event_dispatcher = self.droid, self.ed
- advertise_droid, advertise_event_dispatcher = self.droid1, self.ed1
- advertise_droid.bleSetAdvertiseSettingsAdvertiseMode(
- AdvertiseSettingsAdvertiseMode.ADVERTISE_MODE_LOW_LATENCY.value)
- filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
- scan_droid)
- expected_event_name = "".join(
- ["BleScan", str(scan_callback), "onScanResults"])
- advertise_callback, advertise_data, advertise_settings = generate_ble_advertise_objects(
- advertise_droid)
- looperCount = 1000
- expected_advertise_event = "".join(
- ["BleAdvertise", str(advertise_callback), "onSuccess"])
- while looperCount != 0:
- advertise_droid.eventClearBuffer()
- self.ed1.start()
- advertise_droid.bluetoothToggleState(True)
- time.sleep(10)
- advertise_droid.eventClearBuffer()
- test_result = advertise_droid.bleStartBleAdvertising(
- advertise_callback, advertise_data, advertise_settings)
- time.sleep(5)
- scan_droid.bleStopBleScan(scan_callback)
- time.sleep(5)
- advertise_droid.bleStopBleAdvertising(advertise_callback)
- looperCount -= 1
- self.ed1.stop()
- advertise_droid.bluetoothToggleState(False)
- time.sleep(5)
- self.log.debug(" ".join(["Done with iteration", str(looperCount)]))
- return test_result
diff --git a/acts/tests/google/ble/system_tests/BleOnLostOnFoundStressTest.py b/acts/tests/google/ble/system_tests/BleOnLostOnFoundStressTest.py
index 987b8bb..57ef9d1 100644
--- a/acts/tests/google/ble/system_tests/BleOnLostOnFoundStressTest.py
+++ b/acts/tests/google/ble/system_tests/BleOnLostOnFoundStressTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2015 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/ble/system_tests/BleStressTest.py b/acts/tests/google/ble/system_tests/BleStressTest.py
index f0fdcaf..ce35733 100644
--- a/acts/tests/google/ble/system_tests/BleStressTest.py
+++ b/acts/tests/google/ble/system_tests/BleStressTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/BtBasicFunctionalityTest.py b/acts/tests/google/bt/BtBasicFunctionalityTest.py
index 609d2b1..2d731e4 100644
--- a/acts/tests/google/bt/BtBasicFunctionalityTest.py
+++ b/acts/tests/google/bt/BtBasicFunctionalityTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -47,10 +48,6 @@
"test_scan_mode_none",
"test_scan_mode_connectable",
"test_scan_mode_connectable_discoverable",
- #"test_if_support_hid_profile",
- #"test_if_support_hsp_profile",
- #"test_if_support_a2dp_profile",
- #"test_if_support_avrcp_profile",
)
def setup_class(self):
diff --git a/acts/tests/google/bt/SppTest.py b/acts/tests/google/bt/SppTest.py
index c55247f..5c9d683 100644
--- a/acts/tests/google/bt/SppTest.py
+++ b/acts/tests/google/bt/SppTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/config/sample_basic.json b/acts/tests/google/bt/config/sample_basic.json
new file mode 100644
index 0000000..d7d0f38
--- /dev/null
+++ b/acts/tests/google/bt/config/sample_basic.json
@@ -0,0 +1,12 @@
+{ "_description": "Sample config file for a Bluetooth testbed.",
+ "testbed":
+ [
+ {
+ "_description": "2 Android devices. This testbed can run tests that require two devices such as BLE, GATT, and SPP tests.",
+ "name": "bluetooth testbed",
+ "AndroidDevice": ["<serial_1>", "<serial_2>"]
+ }
+ ],
+ "logpath": "/tmp/logs",
+ "testpaths": ["../tests/sample"]
+}
diff --git a/acts/tests/google/bt/config/sample_mass_beacon_deployment.json b/acts/tests/google/bt/config/sample_mass_beacon_deployment.json
new file mode 100755
index 0000000..aa39c2f
--- /dev/null
+++ b/acts/tests/google/bt/config/sample_mass_beacon_deployment.json
@@ -0,0 +1,14 @@
+{ "_description": "Sample config file for simulating mass beacon deployments.",
+ "testbed":
+ [
+ {
+ "_description": "A testbed with N number of Android devices. This testbed is for specifically BeaconSwarmTest.py. The first Android device represents the device under test. The next N devices will be represented in beacon_devices that will act as BLE beacons. The beacon_count config line will contain the max number of advertisements the device concurrently supports.",
+ "name": "mass beacon deployment testbed",
+ "AndroidDevice": ["<dut_serial>", "<serial_1>", "<serial_2>", "<serial_n>"]
+ }
+ ],
+ "logpath": "/tmp/logs",
+ "beacon_devices":["<serial_1>", "<serial_2", "<serial_n>"],
+ "beacon_count":10,
+ "testpaths": ["../tests/samples"]
+}
diff --git a/acts/tests/google/bt/gatt/GattOverBrEdrTest.py b/acts/tests/google/bt/gatt/GattOverBrEdrTest.py
index d05eed0..833a12f 100644
--- a/acts/tests/google/bt/gatt/GattOverBrEdrTest.py
+++ b/acts/tests/google/bt/gatt/GattOverBrEdrTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/native/BtNativeTest.py b/acts/tests/google/bt/native/BtNativeTest.py
index 8095442..d91eb1e 100644
--- a/acts/tests/google/bt/native/BtNativeTest.py
+++ b/acts/tests/google/bt/native/BtNativeTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/setup/BtPreFlightTest.py b/acts/tests/google/bt/setup/BtPreFlightTest.py
index cba93fc..8a2a4ca 100644
--- a/acts/tests/google/bt/setup/BtPreFlightTest.py
+++ b/acts/tests/google/bt/setup/BtPreFlightTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/system_tests/BtStressTest.py b/acts/tests/google/bt/system_tests/BtStressTest.py
index 847ea57..a298159 100644
--- a/acts/tests/google/bt/system_tests/BtStressTest.py
+++ b/acts/tests/google/bt/system_tests/BtStressTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/system_tests/SppStressTest.py b/acts/tests/google/bt/system_tests/SppStressTest.py
index 1e46608..a5561fe 100644
--- a/acts/tests/google/bt/system_tests/SppStressTest.py
+++ b/acts/tests/google/bt/system_tests/SppStressTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/test_tools/BtReconnectTest.py b/acts/tests/google/bt/test_tools/BtReconnectTest.py
index 3875862..ceda3b9 100644
--- a/acts/tests/google/bt/test_tools/BtReconnectTest.py
+++ b/acts/tests/google/bt/test_tools/BtReconnectTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/test_tools/EnergyTest.py b/acts/tests/google/bt/test_tools/EnergyTest.py
index 101b3ed..2015352 100644
--- a/acts/tests/google/bt/test_tools/EnergyTest.py
+++ b/acts/tests/google/bt/test_tools/EnergyTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/bt/test_tools/ToolsTest.py b/acts/tests/google/bt/test_tools/ToolsTest.py
index 4cff88e..3af087c 100644
--- a/acts/tests/google/bt/test_tools/ToolsTest.py
+++ b/acts/tests/google/bt/test_tools/ToolsTest.py
@@ -1,5 +1,6 @@
-# python3.4
-# Copyright (C) 2014 The Android Open Source Project
+#/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/tel/live/TelLiveDataTest.py b/acts/tests/google/tel/live/TelLiveDataTest.py
index 7e842e3..030948b 100644
--- a/acts/tests/google/tel/live/TelLiveDataTest.py
+++ b/acts/tests/google/tel/live/TelLiveDataTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLivePreflightTest.py b/acts/tests/google/tel/live/TelLivePreflightTest.py
index 8c4144e..513730f 100644
--- a/acts/tests/google/tel/live/TelLivePreflightTest.py
+++ b/acts/tests/google/tel/live/TelLivePreflightTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveSmokeTest.py b/acts/tests/google/tel/live/TelLiveSmokeTest.py
index 11cb321..9523932 100644
--- a/acts/tests/google/tel/live/TelLiveSmokeTest.py
+++ b/acts/tests/google/tel/live/TelLiveSmokeTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveSmsTest.py b/acts/tests/google/tel/live/TelLiveSmsTest.py
index 147428f..87286c8 100644
--- a/acts/tests/google/tel/live/TelLiveSmsTest.py
+++ b/acts/tests/google/tel/live/TelLiveSmsTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveStressCallTest.py b/acts/tests/google/tel/live/TelLiveStressCallTest.py
index f977ef9..02198df 100644
--- a/acts/tests/google/tel/live/TelLiveStressCallTest.py
+++ b/acts/tests/google/tel/live/TelLiveStressCallTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveVideoDataTest.py b/acts/tests/google/tel/live/TelLiveVideoDataTest.py
index dd5d185..a01e674 100644
--- a/acts/tests/google/tel/live/TelLiveVideoDataTest.py
+++ b/acts/tests/google/tel/live/TelLiveVideoDataTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveVideoTest.py b/acts/tests/google/tel/live/TelLiveVideoTest.py
index bf1448f..753e0b6 100644
--- a/acts/tests/google/tel/live/TelLiveVideoTest.py
+++ b/acts/tests/google/tel/live/TelLiveVideoTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveVoiceConfTest.py b/acts/tests/google/tel/live/TelLiveVoiceConfTest.py
index 8c22a4f..68c68e5 100644
--- a/acts/tests/google/tel/live/TelLiveVoiceConfTest.py
+++ b/acts/tests/google/tel/live/TelLiveVoiceConfTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelLiveVoiceTest.py b/acts/tests/google/tel/live/TelLiveVoiceTest.py
index 4691de4..3036988 100644
--- a/acts/tests/google/tel/live/TelLiveVoiceTest.py
+++ b/acts/tests/google/tel/live/TelLiveVoiceTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelPowerTest.py b/acts/tests/google/tel/live/TelPowerTest.py
index 4ebe4dd..b54a29f 100644
--- a/acts/tests/google/tel/live/TelPowerTest.py
+++ b/acts/tests/google/tel/live/TelPowerTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelWifiDataTest.py b/acts/tests/google/tel/live/TelWifiDataTest.py
index e4289a0..819b875 100644
--- a/acts/tests/google/tel/live/TelWifiDataTest.py
+++ b/acts/tests/google/tel/live/TelWifiDataTest.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python3.4
-# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-
-# Copyright 2014 - The Android Open Source Project
+#!/usr/bin/env python3.4
+#
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/tel/live/TelWifiVoiceTest.py b/acts/tests/google/tel/live/TelWifiVoiceTest.py
index 8fbd802..34e7390 100755
--- a/acts/tests/google/tel/live/TelWifiVoiceTest.py
+++ b/acts/tests/google/tel/live/TelWifiVoiceTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - Google
+# Copyright 2016 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiAutoJoinTest.py b/acts/tests/google/wifi/WifiAutoJoinTest.py
index 8fd939a..3fde2a7 100755
--- a/acts/tests/google/wifi/WifiAutoJoinTest.py
+++ b/acts/tests/google/wifi/WifiAutoJoinTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiEnterpriseRoamingTest.py b/acts/tests/google/wifi/WifiEnterpriseRoamingTest.py
index 5ce693e..810430a 100644
--- a/acts/tests/google/wifi/WifiEnterpriseRoamingTest.py
+++ b/acts/tests/google/wifi/WifiEnterpriseRoamingTest.py
@@ -1,5 +1,5 @@
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiEnterpriseTest.py b/acts/tests/google/wifi/WifiEnterpriseTest.py
index 281d71c..45d8137 100755
--- a/acts/tests/google/wifi/WifiEnterpriseTest.py
+++ b/acts/tests/google/wifi/WifiEnterpriseTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiManagerTest.py b/acts/tests/google/wifi/WifiManagerTest.py
index 0ac12e9..ace0d65 100755
--- a/acts/tests/google/wifi/WifiManagerTest.py
+++ b/acts/tests/google/wifi/WifiManagerTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiPowerTest.py b/acts/tests/google/wifi/WifiPowerTest.py
index d4d2f66..fd68d02 100644
--- a/acts/tests/google/wifi/WifiPowerTest.py
+++ b/acts/tests/google/wifi/WifiPowerTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2014 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiRttManagerTest.py b/acts/tests/google/wifi/WifiRttManagerTest.py
index bfa7854..9d8cae4 100644
--- a/acts/tests/google/wifi/WifiRttManagerTest.py
+++ b/acts/tests/google/wifi/WifiRttManagerTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright (C) 2015 The Android Open Source Project
+# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
diff --git a/acts/tests/google/wifi/WifiScannerBssidTest.py b/acts/tests/google/wifi/WifiScannerBssidTest.py
index cf76517..93337b3 100755
--- a/acts/tests/google/wifi/WifiScannerBssidTest.py
+++ b/acts/tests/google/wifi/WifiScannerBssidTest.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python3.4
-# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-
-# Copyright 2014 - The Android Open Source Project
+#!/usr/bin/env python3.4
+#
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiScannerChangeTest.py b/acts/tests/google/wifi/WifiScannerChangeTest.py
index 68176e8..6db17e4 100755
--- a/acts/tests/google/wifi/WifiScannerChangeTest.py
+++ b/acts/tests/google/wifi/WifiScannerChangeTest.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python3.4
-# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-
-# Copyright 2014 - The Android Open Source Project
+#!/usr/bin/env python3.4
+#
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiScannerMultiScanTest.py b/acts/tests/google/wifi/WifiScannerMultiScanTest.py
index db80dd2..2432c9a 100755
--- a/acts/tests/google/wifi/WifiScannerMultiScanTest.py
+++ b/acts/tests/google/wifi/WifiScannerMultiScanTest.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python3.4
-# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-
-# Copyright 2015 - The Android Open Source Project
+#!/usr/bin/env python3.4
+#
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/google/wifi/WifiScannerScanTest.py b/acts/tests/google/wifi/WifiScannerScanTest.py
index 5cd464e..15ff50c 100755
--- a/acts/tests/google/wifi/WifiScannerScanTest.py
+++ b/acts/tests/google/wifi/WifiScannerScanTest.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python3.4
-# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-
-# Copyright 2014 - The Android Open Source Project
+#!/usr/bin/env python3.4
+#
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/acts/tests/sample/SampleTest.py b/acts/tests/sample/SampleTest.py
index 966aaac..f3fc501 100755
--- a/acts/tests/sample/SampleTest.py
+++ b/acts/tests/sample/SampleTest.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python3.4
+#!/usr/bin/env python3.4
#
-# Copyright 2015 - The Android Open Source Project
+# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.