This patch-set adds the GATT client unit test cases for,
1) Read Characteristic Descriptors by Client
2) Read Characteristic Descriptors - Read Not Permitted
3) Read Characteristic Descriptors - Invalid Handle]
4) Read Characteristic Descriptors - Insufficient Authorization
5) Read Characteristic Descriptors - Insufficient Authentication
6) Read Characteristic Descriptors - Insufficient Encryption Key Size
Bharat Panda (3):
unit/gatt: Add TP/GAR/CL/BI-25-C test
unit/gatt: Add TP/GAR/CL/BI-26-C test
unit/gatt: Add TP/GAR/CL/BI-27-C test
Gowtham Anandha Babu (3):
unit/gatt: Add /TP/GAR/CL/BV-06-C test
unit/gatt: Add TP/GAR/CL/BI-23-C test
unit/gatt: Add TP/GAR/CL/BI-24-C test
unit/test-gatt.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
--
1.9.1
Hi Bharat,
On Fri, Feb 13, 2015 at 4:48 PM, Bharat Panda <[email protected]> wrote:
> This patch-set adds the GATT client unit test cases for,
>
> 1) Read Characteristic Descriptors by Client
> 2) Read Characteristic Descriptors - Read Not Permitted
> 3) Read Characteristic Descriptors - Invalid Handle]
> 4) Read Characteristic Descriptors - Insufficient Authorization
> 5) Read Characteristic Descriptors - Insufficient Authentication
> 6) Read Characteristic Descriptors - Insufficient Encryption Key Size
>
> Bharat Panda (3):
> unit/gatt: Add TP/GAR/CL/BI-25-C test
> unit/gatt: Add TP/GAR/CL/BI-26-C test
> unit/gatt: Add TP/GAR/CL/BI-27-C test
>
> Gowtham Anandha Babu (3):
> unit/gatt: Add /TP/GAR/CL/BV-06-C test
> unit/gatt: Add TP/GAR/CL/BI-23-C test
> unit/gatt: Add TP/GAR/CL/BI-24-C test
>
> unit/test-gatt.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 68 insertions(+)
>
> --
> 1.9.1
Applied, thanks.
--
Luiz Augusto von Dentz
Verify Generic Attribute Profile client behavior when the Read
Characteristic Descriptor 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 89c9f23..f6a44bd 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -765,6 +765,12 @@ static const struct test_step test_read_10 = {
.expected_att_ecode = 0x05,
};
+static const struct test_step test_read_11 = {
+ .handle = 0x0004,
+ .func = test_read,
+ .expected_att_ecode = 0x0c,
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -2648,5 +2654,11 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x04, 0x00),
raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05));
+ define_test_client("/TP/GAR/CL/BI-27-C", test_client, service_db_1,
+ &test_read_11,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x04, 0x00),
+ raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x0c));
+
return g_test_run();
}
--
1.9.1
Verify Generic Attribute Profile client behavior when the Read
Characteristic Descriptor 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 55b06f6..89c9f23 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -759,6 +759,12 @@ static const struct test_step test_read_9 = {
.expected_att_ecode = 0x08,
};
+static const struct test_step test_read_10 = {
+ .handle = 0x0004,
+ .func = test_read,
+ .expected_att_ecode = 0x05,
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -2636,5 +2642,11 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x04, 0x00),
raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x08));
+ define_test_client("/TP/GAR/CL/BI-26-C", test_client, service_db_1,
+ &test_read_10,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x04, 0x00),
+ raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05));
+
return g_test_run();
}
--
1.9.1
Verify Generic Attribute Profile client behavior when the Read
Characteristic Descriptor procedure fails due to insufficient
authorization.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 2594b0f..55b06f6 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -753,6 +753,12 @@ static const struct test_step test_read_8 = {
.expected_att_ecode = 0x02,
};
+static const struct test_step test_read_9 = {
+ .handle = 0x0004,
+ .func = test_read,
+ .expected_att_ecode = 0x08,
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -2624,5 +2630,11 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x00, 0x00),
raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
+ define_test_client("/TP/GAR/CL/BI-25-C", test_client, service_db_1,
+ &test_read_9,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x04, 0x00),
+ raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x08));
+
return g_test_run();
}
--
1.9.1
From: Gowtham Anandha Babu <[email protected]>
Verify Generic Attribute Profile client behavior when the Read
Characteristic Descriptor procedure fails due to invalid handle.
---
unit/test-gatt.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 6fc4212..2594b0f 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2618,5 +2618,11 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x04, 0x00),
raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x02));
+ define_test_client("/TP/GAR/CL/BI-24-C", test_client, service_db_1,
+ &test_read_2,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x00, 0x00),
+ raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
+
return g_test_run();
}
--
1.9.1
From: Gowtham Anandha Babu <[email protected]>
Verify Generic Attribute Profile client behavior when the Read
Characteristic Descriptor procedure fails due to read not permitted.
---
unit/test-gatt.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 5f07d2d..6fc4212 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -746,6 +746,13 @@ static const struct test_step test_read_7 = {
.value = read_data_1,
.length = 0x03
};
+
+static const struct test_step test_read_8 = {
+ .handle = 0x0004,
+ .func = test_read,
+ .expected_att_ecode = 0x02,
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -2605,5 +2612,11 @@ int main(int argc, char *argv[])
raw_pdu(0x0a, 0x04, 0x00),
raw_pdu(0x0b, 0x01, 0x02, 0x03));
+ define_test_client("/TP/GAR/CL/BI-23-C", test_client, service_db_1,
+ &test_read_8,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x04, 0x00),
+ raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x02));
+
return g_test_run();
}
--
1.9.1
From: Gowtham Anandha Babu <[email protected]>
Verify that a Generic Attribute Profile client can read a
characteristic descriptor selected by handle.
---
unit/test-gatt.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 6c98cfa..5f07d2d 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -739,6 +739,13 @@ static const struct test_step test_read_6 = {
.expected_att_ecode = 0x0c,
};
+static const struct test_step test_read_7 = {
+ .handle = 0x0004,
+ .func = test_read,
+ .expected_att_ecode = 0x00,
+ .value = read_data_1,
+ .length = 0x03
+};
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -2592,5 +2599,11 @@ int main(int argc, char *argv[])
raw_pdu(0x1D, 0x03, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x1E));
+ define_test_client("/TP/GAR/CL/BV-06-C", test_client, service_db_1,
+ &test_read_7,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x0a, 0x04, 0x00),
+ raw_pdu(0x0b, 0x01, 0x02, 0x03));
+
return g_test_run();
}
--
1.9.1