security/cert/simple_security_test.py \
shim/cert/stack_test.py
-
bluetooth_cert_test_file_list := $(addprefix $(LOCAL_PATH)/,$(bluetooth_cert_test_file_list))
bluetooth_cert_test_file_list += \
$(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \
$(HOST_OUT_NATIVE_TESTS)/root-canal/root-canal
+bluetooth_cert_env_provider_path := \
+ $(call intermediates-dir-for,PACKAGING,bluetooth_cert_test_package,HOST)/system/bt/gd/cert/environment_provider.py
+
+$(bluetooth_cert_env_provider_path):
+ @mkdir -p $(dir $@)
+ $(hide) echo "PRODUCT_DEVICE = \"$(PRODUCT_DEVICE)\"" > $@
+
bluetooth_cert_zip_path := \
$(call intermediates-dir-for,PACKAGING,bluetooth_cert_test_package,HOST)/bluetooth_cert_test.zip
$(bluetooth_cert_zip_path): PRIVATE_BLUETOOTH_CERT_TEST_FILE_LIST := $(bluetooth_cert_test_file_list)
-$(bluetooth_cert_zip_path) : $(SOONG_ZIP) $(bluetooth_cert_test_file_list)
- $(hide) $(SOONG_ZIP) -d -o $@ $(addprefix -f ,$(PRIVATE_BLUETOOTH_CERT_TEST_FILE_LIST))
+$(bluetooth_cert_zip_path): PRIVATE_BLUETOOTH_CERT_ENV_PROVIDER_PATH := $(bluetooth_cert_env_provider_path)
+
+$(bluetooth_cert_zip_path) : $(SOONG_ZIP) $(bluetooth_cert_env_provider_path) $(bluetooth_cert_test_file_list)
+ $(hide) $(SOONG_ZIP) -d -o $@ $(addprefix -f ,$(PRIVATE_BLUETOOTH_CERT_TEST_FILE_LIST)) \
+ -C $(call intermediates-dir-for,PACKAGING,bluetooth_cert_test_package,HOST) -f $(PRIVATE_BLUETOOTH_CERT_ENV_PROVIDER_PATH)
$(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_zip_path):bluetooth_cert_test.zip)
import signal
import subprocess
-ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
-
class GdFacadeOnlyBaseTestClass(BaseTestClass):
self.rootcanal_logs = open(rootcanal_logpath, 'w')
rootcanal_config = self.controller_configs['rootcanal']
rootcanal_hci_port = str(rootcanal_config.get("hci_port", "6402"))
- android_host_out = os.environ.get('ANDROID_HOST_OUT')
- rootcanal = android_host_out + "/nativetest64/root-canal/root-canal"
+ rootcanal = os.path.join(
+ os.getcwd(),
+ "out/host/linux-x86/nativetest64/root-canal/root-canal")
self.rootcanal_process = subprocess.Popen(
[
rootcanal,
rootcanal_hci_port,
str(rootcanal_config.get("link_layer_port", "6403"))
],
- cwd=ANDROID_BUILD_TOP,
+ cwd=os.getcwd(),
env=os.environ.copy(),
stdout=self.rootcanal_logs,
stderr=self.rootcanal_logs)
import grpc
-ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
-ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
-ANDROID_PRODUCT_OUT = os.environ.get('ANDROID_PRODUCT_OUT')
+from cert.environment_provider import PRODUCT_DEVICE
+
+ANDROID_PRODUCT_OUT = os.path.join(
+ os.getcwd(), "out/dist/bluetooth_cert_test/out/target/product",
+ PRODUCT_DEVICE)
+
WAIT_CHANNEL_READY_TIMEOUT = 10
rootcanal_port = ""
if serial_number == "DUT" or serial_number == "CERT":
raise Exception("Did you forget to configure the serial number?")
- return string.replace("$ANDROID_HOST_OUT", ANDROID_HOST_OUT) \
+ android_host_out = os.path.join(os.getcwd(), "out/host/linux-x86")
+ return string.replace("$ANDROID_HOST_OUT", android_host_out) \
.replace("$(grpc_port)", config.get("grpc_port")) \
.replace("$(grpc_root_server_port)", config.get("grpc_root_server_port")) \
.replace("$(rootcanal_port)", rootcanal_port) \
self.backing_process = subprocess.Popen(
cmd,
- cwd=ANDROID_BUILD_TOP,
+ cwd=os.getcwd(),
env=os.environ.copy(),
stdout=self.backing_process_logs,
stderr=self.backing_process_logs)
#! /bin/bash
-PYTHONPATH=$PYTHONPATH:$ANDROID_BUILD_TOP/out/host/linux-x86/lib64:$ANDROID_BUILD_TOP/system/bt/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd python3.8 "$@"
+PYTHONPATH=$ANDROID_BUILD_TOP/out/host/linux-x86/lib64:$ANDROID_BUILD_TOP/system/bt/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/system/bt/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd:$PYTHONPATH \
+PATH=$ANDROID_HOST_OUT/nativetest64/root-canal:$ANDROID_HOST_OUT/nativetest64/bin:$PATH \
+ python3.8 "$@"
unzip -o -q $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py.zip \
-d $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py
-PYTHONPATH=$PYTHONPATH:$ANDROID_BUILD_TOP/out/host/linux-x86/lib64:$ANDROID_BUILD_TOP/system/bt/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd \
+unzip -o -q $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test.zip \
+ -d $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test
+
+pushd .
+cd $ANDROID_BUILD_TOP
+PYTHONPATH=$ANDROID_BUILD_TOP/out/host/linux-x86/lib64:$ANDROID_BUILD_TOP/system/bt/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/system/bt/gd:$ANDROID_BUILD_TOP/system/bt/gd:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd:$PYTHONPATH \
+PATH=$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/nativetest64/root-canal:$ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/out/host/linux-x86/bin:$PATH \
python3.8 `which act.py`\
-c $TEST_CONFIG \
$TEST_FILTER \
-tp $ANDROID_BUILD_TOP/system/bt/gd
+popd
\ No newline at end of file
unzip -u $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py.zip -d $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py
# For bluetooth_packets_python3
+pushd .
+cd $ANDROID_BUILD_TOP
python3.8-gd `which act.py` -c $ANDROID_BUILD_TOP/system/bt/gd/cert/pts.json -tf $ANDROID_BUILD_TOP/system/bt/gd/cert/pts_l2cap_testcase -tp $ANDROID_BUILD_TOP/system/bt/gd
+popd
\ No newline at end of file
cd $ANDROID_BUILD_TOP/system/bt/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/system/bt/gd/cert cert
+ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_test/system/bt/gd/cert cert
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd/facade facade
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd/hal hal
ln -sfT $ANDROID_BUILD_TOP/out/dist/bluetooth_cert_generated_py/system/bt/gd/hci hci