From 3d8a888a7596435fbd5da28f23dddfc46ddff0e7 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 11 Aug 2014 11:52:04 +0300 Subject: [PATCH] smp-tester: Add invalid opcode test case --- tools/smp-tester.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/smp-tester.c b/tools/smp-tester.c index a9a883059..f63813217 100644 --- a/tools/smp-tester.c +++ b/tools/smp-tester.c @@ -295,6 +295,19 @@ static const struct smp_data smp_server_nval_req_3_test = { .req_count = G_N_ELEMENTS(srv_nval_req_2), }; +static const uint8_t smp_nval_req_4[] = { 0xff, 0xff }; +static const uint8_t smp_nval_req_4_rsp[] = { 0x05, 0x07 }; + +static const struct smp_req_rsp srv_nval_req_3[] = { + { smp_nval_req_4, sizeof(smp_nval_req_4), + smp_nval_req_4_rsp, sizeof(smp_nval_req_4_rsp) }, +}; + +static const struct smp_data smp_server_nval_req_4_test = { + .req = srv_nval_req_3, + .req_count = G_N_ELEMENTS(srv_nval_req_3), +}; + static const uint8_t smp_basic_req_1[] = { 0x01, /* Pairing Request */ 0x03, /* NoInputNoOutput */ 0x00, /* OOB Flag */ @@ -728,6 +741,9 @@ int main(int argc, char *argv[]) test_smp("SMP Server - Invalid Request 3", &smp_server_nval_req_3_test, setup_powered_server, test_server); + test_smp("SMP Server - Invalid Request 4", + &smp_server_nval_req_4_test, + setup_powered_server, test_server); test_smp("SMP Client - Basic Request 1", &smp_client_basic_req_1_test, -- 2.47.3