diff options
author | 2022-05-26 14:15:02 -0700 | |
---|---|---|
committer | 2022-06-03 15:44:22 -0700 | |
commit | 430d97ffbb9a8e5d4b7769de32316bed3f63e002 (patch) | |
tree | 7f073adcb15ce2f91f929407763efe827e74143a | |
parent | d79f0d2e3a96d7dbd7fc407049811413e2c72edc (diff) |
Cert: Fix test infra to meet latest environment requirement
* Restrict protobuf Python package to below 4.0 so that AOSP aprotoc
generated code still works
* Static link NDK libraries so that it works in mainline compilation
environment
Bug: 232258524
Test: gd/cert/run
Tag: #bug-fix
Change-Id: I6d4a14ce90d4d1db06d78cf6ab8de4bc08275c58
-rw-r--r-- | system/Android.mk | 1 | ||||
-rw-r--r-- | system/blueberry/tests/gd/cert/gd_device.py | 8 | ||||
-rw-r--r-- | system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py | 12 | ||||
-rw-r--r-- | system/gd/Android.bp | 6 | ||||
-rw-r--r-- | system/setup.py | 2 |
5 files changed, 16 insertions, 13 deletions
diff --git a/system/Android.mk b/system/Android.mk index a6a4c1a76f..1596e4981e 100644 --- a/system/Android.mk +++ b/system/Android.mk @@ -46,7 +46,6 @@ LOCAL_target_executables := \ $(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade LOCAL_target_libraries := \ - $(TARGET_OUT_SHARED_LIBRARIES)/android.system.suspend.control-V1-ndk.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \ diff --git a/system/blueberry/tests/gd/cert/gd_device.py b/system/blueberry/tests/gd/cert/gd_device.py index 60d606e9ed..149867b9ea 100644 --- a/system/blueberry/tests/gd/cert/gd_device.py +++ b/system/blueberry/tests/gd/cert/gd_device.py @@ -480,8 +480,7 @@ class GdAndroidDevice(GdDeviceBase): # Try freeing ports and ignore results asserts.assert_true( make_ports_available((self.grpc_port, self.grpc_root_server_port, self.signal_port)), - "[%s] Failed to make backing process ports available" % self.label - ) + "[%s] Failed to make backing process ports available" % self.label) self.cleanup_port_forwarding() self.sync_device_time() logging.info("Ports cleaned up and clock is set for device %s %s" % (self.label, self.serial_number)) @@ -495,8 +494,6 @@ class GdAndroidDevice(GdDeviceBase): # Push test binaries self.push_or_die(os.path.join(get_gd_root(), "target", "bluetooth_stack_with_facade"), "system/bin") - self.push_or_die( - os.path.join(get_gd_root(), "target", "android.system.suspend.control-V1-ndk.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libbluetooth_gd.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++_unsecure.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++.so"), "system/lib64") @@ -533,7 +530,8 @@ class GdAndroidDevice(GdDeviceBase): self.ensure_no_output(self.adb.shell("settings put global ble_scan_always_enabled 0")) self.adb.shell("cmd bluetooth_manager disable") device_bt_state = int(self.adb.shell("settings get global bluetooth_on")) - asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number)) + asserts.assert_equal(device_bt_state, 0, + "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number)) logging.info("Bluetooth disabled on device %s %s" % (self.label, self.serial_number)) # Start logcat logging diff --git a/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py b/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py index 899df006a6..24844ff1b8 100644 --- a/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py +++ b/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py @@ -61,9 +61,10 @@ class GdSl4aBaseTestClass(BaseTestClass): # Enable full btsnoop log self.dut.adb.root() self.dut.adb.shell("setprop persist.bluetooth.btsnooplogmode full") - getprop_result = self.dut.adb.shell("getprop persist.bluetooth.btsnooplogmode") == "full" - if not getprop_result: - self.dut.log.warning("Failed to enable Bluetooth Hci Snoop Logging.") + getprop_result = self.dut.adb.getprop("persist.bluetooth.btsnooplogmode") + if getprop_result is None or ("full" not in getprop_result.lower()): + self.dut.log.warning( + "Failed to enable Bluetooth Hci Snoop Logging, getprop returned {}".format(getprop_result)) self.ble = BleLib(dut=self.dut) @@ -95,7 +96,10 @@ class GdSl4aBaseTestClass(BaseTestClass): # Make sure BLE is disabled and Bluetooth is disabled after test self.dut.sl4a.bluetoothDisableBLE() disable_bluetooth(self.dut.sl4a, self.dut.ed) - self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest()) + try: + self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest()) + except Exception: + logging.error("Failed to stop CERT stack") # TODO: split cert logcat logs into individual tests current_test_dir = get_current_context().get_full_output_path() diff --git a/system/gd/Android.bp b/system/gd/Android.bp index 38ce29c930..205df4ce55 100644 --- a/system/gd/Android.bp +++ b/system/gd/Android.bp @@ -283,14 +283,16 @@ cc_binary { shared_libs: [ "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", - "android.system.suspend.control-V1-ndk", - "android.system.suspend-V1-ndk", "libbinder_ndk", "libhidlbase", "libutils", "libcutils", "libstatslog_bt", ], + static_libs: [ + "android.system.suspend.control-V1-ndk", + "android.system.suspend-V1-ndk", + ], }, host: { required: [ diff --git a/system/setup.py b/system/setup.py index cdb76f8a3a..597b9df2ed 100644 --- a/system/setup.py +++ b/system/setup.py @@ -29,7 +29,7 @@ force_install = False install_requires = [ 'grpcio', 'psutil', - 'protobuf>=3.14.0', + 'protobuf>=3.14.0, <4.0', 'mobly', ] |