This implements the unit tests for reading a characteristic value
having insufficient authentication and encryption key size.
Gowtham Anandha Babu (2):
unit/gatt: Add TP/GAR/CL/BI-04-C test
unit/gatt: Add TP/GAR/CL/BI-05-C test
unit/test-gatt.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
--
1.9.1
Verify Generic Attribute Profile client behavior when the Read
Characteristic Value procedure fails due to insufficient encryption
key size.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 5952026..22c9823 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -662,6 +662,12 @@ static const struct test_step test_read_5 = {
.expected_att_ecode = 0x05,
};
+static const struct test_step test_read_6 = {
+ .handle = 0x0003,
+ .func = test_read,
+ .expected_att_ecode = 0x0c,
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -1860,6 +1866,12 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x03, 0x00),
raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05));
+ define_test_client("/TP/GAR/CL/BI-05-C", test_client, service_db_1,
+ &test_read_6,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x03, 0x00),
+ raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x0c));
+
define_test_server("/TP/GAR/SR/BV-01-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1
Verify Generic Attribute Profile client behavior when the Read
Characteristic Value procedure fails due to insufficient authentication.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index bbafbda..5952026 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -656,6 +656,12 @@ static const struct test_step test_read_4 = {
.expected_att_ecode = 0x08,
};
+static const struct test_step test_read_5 = {
+ .handle = 0x0003,
+ .func = test_read,
+ .expected_att_ecode = 0x05,
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -1848,6 +1854,12 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x03, 0x00),
raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x08));
+ define_test_client("/TP/GAR/CL/BI-04-C", test_client, service_db_1,
+ &test_read_5,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x03, 0x00),
+ raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05));
+
define_test_server("/TP/GAR/SR/BV-01-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1