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

Commit befbd109 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Run scripted_beacon_test in one invocation"

parents 9e2fcf56 a0a63888
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import string
import struct
import sys
from scapy.all import *
import time
""" Add some more SCAPY stuff"""


@@ -361,6 +362,9 @@ class HCIShell(cmd.Cmd):
        split_args = args.split()
        enable = int(split_args[0]) if len(split_args) > 0 else 1
        filter_dups = int(split_args[1]) if len(split_args) > 1 else 1
        set_scan_parameters = HCI_Hdr(type=1) / HCI_Command_Hdr(opcode=0x200b) / HCI_Cmd_LE_Set_Scan_Parameters(type=1)
        print('Tx: ' + set_scan_parameters.__repr__())
        self._hci.send(set_scan_parameters)
        set_scan_enable = HCI_Hdr(type=1) / HCI_Command_Hdr(opcode=0x200c) / HCI_Cmd_LE_Set_Scan_Enable(
            enable=enable, filter_dups=filter_dups)
        print('Tx: ' + set_scan_enable.__repr__())
@@ -379,6 +383,12 @@ class HCIShell(cmd.Cmd):
        print('Tx: ' + inquiry.__repr__())
        self._hci.send(inquiry)

    def do_wait(self, args):
        """Arguments: time in seconds (float).
    """
        sleep_time = float(args.split()[0])
        time.sleep(sleep_time)

    def do_quit(self, args):
        """Arguments: None.

+0 −6
Original line number Diff line number Diff line

#$ANDROID_BUILD_TOP/out/host/linux-x86/bin/root-canal &
sleep 1
python3 scripts/test_channel.py 6401 < scripts/scripted_beacon_test_add_beacon
python3 scripts/hci_socket.py 6402 < scripts/scripted_beacon_test_start_scan
sleep 30
+11 −0
Original line number Diff line number Diff line
This test:

- Starts RootCanal
- Adds scripted beacons
- Sets the permissions for some of the files
- Dumps the proto output for manual verification


cd $ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/vendor_libs/test_vendor_lib
. scripts/scripted_beacon_test/run_test.sh
+10 −0
Original line number Diff line number Diff line
wait 1
add scripted_beacon be:ac:01:55:00:01 scripts/scripted_beacon_test/test_events.pb /tmp/logs/scripted_beacon_test/beacon.pb
add_device_to_phy 1 1
add scripted_beacon be:ac:01:55:00:02 scripts/scripted_beacon_test/no_permission.pb /tmp/logs/scripted_beacon_test/no_permission.pb
add_device_to_phy 2 1
add scripted_beacon be:ac:01:55:00:02 scripts/scripted_beacon_test/grant_permission.pb /tmp/logs/scripted_beacon_test/grant_permission.pb
add_device_to_phy 3 1
list
wait 10
quit
Loading