diff options
author | Jakub Tyszkowski <jakub.tyszkowski@tieto.com> | 2014-07-21 09:40:26 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-21 11:44:12 +0300 |
commit | f4a7d9784362c3b5a5a98290e0d96e7f8ba2fe58 (patch) | |
tree | 10c9cfc2307c05ae7e78c420c0e7d499ecf96510 /android/tester-bluetooth.c | |
parent | a4ca2594e91ba69da6a67117ccb060964eb689a6 (diff) | |
download | bluez-f4a7d9784362c3b5a5a98290e0d96e7f8ba2fe58.tar.gz |
android/tester-ng: Add wrong PIN reply test case
Diffstat (limited to 'android/tester-bluetooth.c')
-rw-r--r-- | android/tester-bluetooth.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c index 3a70f2b55..dbcd78271 100644 --- a/android/tester-bluetooth.c +++ b/android/tester-bluetooth.c @@ -199,11 +199,19 @@ static struct bt_action_data prop_emu_remote_ble_fname_req = { static bt_pin_code_t emu_pin_value = { .pin = { 0x30, 0x30, 0x30, 0x30 }, }; +static bt_pin_code_t emu_pin_invalid_value = { + .pin = { 0x30, 0x10, 0x30, 0x30 }, +}; static struct bt_action_data emu_pin_set_req = { .addr = &emu_remote_bdaddr_val, .pin = &emu_pin_value, .pin_len = 4, }; +static struct bt_action_data emu_pin_set_invalid_req = { + .addr = &emu_remote_bdaddr_val, + .pin = &emu_pin_invalid_value, + .pin_len = 4, +}; static bt_property_t prop_emu_default_set[] = { { BT_PROPERTY_BDADDR, sizeof(emu_bdaddr_val), NULL }, @@ -960,6 +968,30 @@ static struct test_case test_cases[] = { CALLBACK_BOND_STATE(BT_BOND_STATE_BONDED, &prop_emu_remote_bdadr, 1), ), + TEST_CASE_BREDR("Bt. Create Bond PIN - Bad PIN", + ACTION_SUCCESS(bluetooth_enable_action, NULL), + CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON), + ACTION_SUCCESS(emu_setup_powered_remote_action, NULL), + ACTION_SUCCESS(emu_set_pin_code_action, &emu_pin_set_req), + ACTION_SUCCESS(bt_start_discovery_action, NULL), + CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED, + BT_DISCOVERY_STARTED), + CALLBACK_DEVICE_FOUND(prop_emu_remotes_default_set, 3), + ACTION_SUCCESS(bt_cancel_discovery_action, NULL), + CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED, + BT_DISCOVERY_STOPPED), + ACTION_SUCCESS(bt_create_bond_action, + &prop_test_remote_ble_bdaddr_req), + CALLBACK_BOND_STATE(BT_BOND_STATE_BONDING, + &prop_emu_remote_bdadr, 1), + CALLBACK_PROPS(CB_BT_PIN_REQUEST, prop_emu_remotes_pin_req_set, + 2), + ACTION_SUCCESS(bt_pin_reply_accept_action, + &emu_pin_set_invalid_req), + CALLBACK_BOND_STATE_FAILED(BT_BOND_STATE_NONE, + &prop_emu_remote_bdadr, 1, + BT_STATUS_AUTH_FAILURE), + ), }; struct queue *get_bluetooth_tests(void) |