Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1b4ce59 authored by Jack He's avatar Jack He
Browse files

Cert: Use site-packages instead of root

* Symbolic link libraries in site-packages instead of root one
* Now we can finally run cert tests in virtualenv without PYTHONPATH

Example command without PYTHONPATH:

    act.py -c $ANDROID_BUILD_TOP/system/bt/gd/cert/host_only_config.json -tf $ANDROID_BUILD_TOP/system/bt/gd/cert/cert_testcases_facade_only -tp $ANDROID_BUILD_TOP/system/bt/gd

Bug: 148147248
Test: set up virtual env and run tests
Change-Id: I42ba29602addab41059916071c5d0b42cf17fd8f
parent f63ca749
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ fi

# Set up artifacts
pushd .
cd $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/gd_cert_venv/lib/python3.8
cd $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/gd_cert_venv/lib/python3.8/site-packages
# Python generated code
ln -sfT $ANDROID_BUILD_TOP/tools/test/connectivity/acts/framework/acts acts
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/cert cert
@@ -168,14 +168,13 @@ ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/l2cap l2cap
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/neighbor neighbor
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/security security
# Native libraries
# Symbolic link does not work for dynamic libraries
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/lib64/bluetooth_packets_python3.so bluetooth_packets_python3.so
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/lib64/libbluetooth_gd.so libbluetooth_gd.so
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/lib64/libgrpc++_unsecure.so libgrpc++_unsecure.so
# Per systrace, Python only load from python3.8/lib64 directory for libc++.so
# Per systrace, Python only load from python3.8/lib64 directory for plugin imported native libraries
mkdir -p $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/gd_cert_venv/lib/python3.8/lib64
cd $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/gd_cert_venv/lib/python3.8/lib64
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/lib64/libc++.so libc++.so
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/lib64/libbluetooth_gd.so libbluetooth_gd.so
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/lib64/libgrpc++_unsecure.so libgrpc++_unsecure.so
# Binaries
cd $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/gd_cert_venv/bin
ln -sfT $ANDROID_BUILD_TOP/out/host/linux-x86/bin/bluetooth_stack_with_facade bluetooth_stack_with_facade