File: one_device_bench_test.py

package info (click to toggle)
python-bumble 0.0.220-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 9,280 kB
  • sloc: python: 71,701; java: 3,782; javascript: 823; xml: 203; sh: 172; makefile: 8
file content (68 lines) | stat: -rw-r--r-- 2,422 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from mobly import base_test, test_runner
from mobly.controllers import android_device


class OneDeviceBenchTest(base_test.BaseTestClass):

    def setup_class(self):
        self.ads = self.register_controller(android_device)
        self.dut = self.ads[0]
        self.dut.load_snippet("bench", "com.github.google.bumble.btbench")

    def test_rfcomm_client_ping(self):
        runner = self.dut.bench.runRfcommClient(
            "ping", "DC:E5:5B:E5:51:2C", 100, 970, 100
        )
        print("### Initial status:", runner)
        final_status = self.dut.bench.waitForRunnerCompletion(runner["id"])
        print("### Final status:", final_status)

    def test_rfcomm_client_send(self):
        runner = self.dut.bench.runRfcommClient(
            "send", "DC:E5:5B:E5:51:2C", 100, 970, 0
        )
        print("### Initial status:", runner)
        final_status = self.dut.bench.waitForRunnerCompletion(runner["id"])
        print("### Final status:", final_status)

    def test_l2cap_client_ping(self):
        runner = self.dut.bench.runL2capClient(
            "ping", "4B:2A:67:76:2B:E3", 128, True, 100, 970, 100, "HIGH"
        )
        print("### Initial status:", runner)
        final_status = self.dut.bench.waitForRunnerCompletion(runner["id"])
        print("### Final status:", final_status)

    def test_l2cap_client_send(self):
        runner = self.dut.bench.runL2capClient(
            "send",
            "F1:F1:F1:F1:F1:F1",
            128,
            True,
            100,
            970,
            0,
            "HIGH",
            10000,
        )
        print("### Initial status:", runner)
        final_status = self.dut.bench.waitForRunnerCompletion(runner["id"])
        print("### Final status:", final_status)

    def test_gatt_client_send(self):
        runner = self.dut.bench.runGattClient(
            "send", "F1:F1:F1:F1:F1:F1", 128, True, 100, 970, 100, "HIGH"
        )
        print("### Initial status:", runner)
        final_status = self.dut.bench.waitForRunnerCompletion(runner["id"])
        print("### Final status:", final_status)

    def test_gatt_server_receive(self):
        runner = self.dut.bench.runGattServer("receive")
        print("### Initial status:", runner)
        final_status = self.dut.bench.waitForRunnerCompletion(runner["id"])
        print("### Final status:", final_status)


if __name__ == "__main__":
    test_runner.main()