tools/l2cap-tester: Add server side security block test case

Note that this test will currently fail part of the time due to a race
on the kernel side. This is because the kernel doesn't wait for remote
feature resolution before processing incoming L2CAP signaling packets.
This commit is contained in:
Johan Hedberg 2014-01-14 12:19:48 +02:00
parent 6f10ace263
commit 4110e841dd

View File

@ -326,6 +326,23 @@ static const struct l2cap_server_data l2cap_server_write_success_test = {
.data_len = sizeof(l2_data),
};
static const uint8_t l2cap_sec_block_rsp[] = { 0x00, 0x00, /* dcid */
0x41, 0x00, /* scid */
0x03, 0x00, /* Sec Block */
0x00, 0x00 /* status */
};
static const struct l2cap_server_data l2cap_server_sec_block_test = {
.server_psm = 0x1001,
.send_req_code = BT_L2CAP_PDU_CONN_REQ,
.send_req = l2cap_connect_req,
.send_req_len = sizeof(l2cap_connect_req),
.expect_rsp_code = BT_L2CAP_PDU_CONN_RSP,
.expect_rsp = l2cap_sec_block_rsp,
.expect_rsp_len = sizeof(l2cap_sec_block_rsp),
.enable_ssp = true,
};
static const uint8_t l2cap_nval_psm_rsp[] = { 0x00, 0x00, /* dcid */
0x41, 0x00, /* scid */
0x02, 0x00, /* nval PSM */
@ -1071,6 +1088,10 @@ int main(int argc, char *argv[])
&l2cap_server_write_success_test,
setup_powered_server, test_server);
test_l2cap_bredr("L2CAP BR/EDR Server - Security Block",
&l2cap_server_sec_block_test,
setup_powered_server, test_server);
test_l2cap_bredr("L2CAP BR/EDR Server - Invalid PSM",
&l2cap_server_nval_psm_test,
setup_powered_server, test_server);