Adds the below client test cases (tested against service db):
1) Write Characteristic Descriptors – by Client
2) Write Characteristic Descriptor – Invalid Handle
3) Write Characteristic Descriptor – Write Not Permitted
4) Write Characteristic Descriptor – Insufficient Authorization
5) Write Characteristic Descriptor – Insufficient Authentication
6) Write Characteristic Descriptor – Insufficient Encryption Key Size
and updated the test-gatt count in doc/test-coverage.
Gowtham Anandha Babu (7):
unit/test-gatt: Add TP/GAW/CL/BV-08-C test
unit/test-gatt: Add TP/GAW/CL/BI-20-C test
unit/test-gatt: Add TP/GAW/CL/BI-21-C test
unit/test-gatt: Add TP/GAW/CL/BI-22-C test
unit/test-gatt: Add TP/GAW/CL/BI-23-C test
unit/test-gatt: Add TP/GAW/CL/BI-24-C test
doc/test-coverage: Update test-gatt count
doc/test-coverage.txt | 5 +--
unit/test-gatt.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 2 deletions(-)
--
1.9.1
Hi Gowtham,
On Thu, Mar 5, 2015 at 11:13 AM, Gowtham Anandha Babu
<[email protected]> wrote:
> Adds the below client test cases (tested against service db):
> 1) Write Characteristic Descriptors – by Client
> 2) Write Characteristic Descriptor – Invalid Handle
> 3) Write Characteristic Descriptor – Write Not Permitted
> 4) Write Characteristic Descriptor – Insufficient Authorization
> 5) Write Characteristic Descriptor – Insufficient Authentication
> 6) Write Characteristic Descriptor – Insufficient Encryption Key Size
>
> and updated the test-gatt count in doc/test-coverage.
>
> Gowtham Anandha Babu (7):
> unit/test-gatt: Add TP/GAW/CL/BV-08-C test
> unit/test-gatt: Add TP/GAW/CL/BI-20-C test
> unit/test-gatt: Add TP/GAW/CL/BI-21-C test
> unit/test-gatt: Add TP/GAW/CL/BI-22-C test
> unit/test-gatt: Add TP/GAW/CL/BI-23-C test
> unit/test-gatt: Add TP/GAW/CL/BI-24-C test
> doc/test-coverage: Update test-gatt count
>
> doc/test-coverage.txt | 5 +--
> unit/test-gatt.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 87 insertions(+), 2 deletions(-)
>
> --
> 1.9.1
Applied, thank.
--
Luiz Augusto von Dentz
---
doc/test-coverage.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index 141bb8e..5696ee3 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -1,3 +1,4 @@
+
BlueZ test coverage
*******************
@@ -28,9 +29,9 @@ test-gobex-header 28 OBEX header handling
test-gobex-apparam 18 OBEX apparam handling
test-gobex-transfer 36 OBEX transfer handling
test-gdbus-client 13 D-Bus client handling
-test-gatt 122 GATT qualification test cases
+test-gatt 131 GATT qualification test cases
-----
- 697
+ 706
Automated end-to-end testing
--
1.9.1
Generic Attribute Profile client behavior when the Write Characteristic
Descriptor procedure fails due to insufficient encryption key size.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 465a06c..2edcacb 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -869,6 +869,14 @@ static const struct test_step test_write_11 = {
.length = 0x03
};
+static const struct test_step test_write_12 = {
+ .handle = 0x0008,
+ .func = test_write,
+ .expected_att_ecode = 0x0c,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void test_write_without_response(struct context *context)
{
const struct test_step *step = context->data->step;
@@ -3157,5 +3165,11 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x12, 0x08, 0x00, 0x05));
+ define_test_client("/TP/GAW/CL/BI-24-C", test_client, service_db_1,
+ &test_write_12,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x12, 0x08, 0x00, 0x0c));
+
return tester_run();
}
--
1.9.1
Verify Generic Attribute Profile client behavior when the Write
Characteristic Descriptor procedure fails due to insufficient
authentication.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 57786ba..465a06c 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -861,6 +861,14 @@ static const struct test_step test_write_10 = {
.length = 0x03
};
+static const struct test_step test_write_11 = {
+ .handle = 0x0008,
+ .func = test_write,
+ .expected_att_ecode = 0x05,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void test_write_without_response(struct context *context)
{
const struct test_step *step = context->data->step;
@@ -3143,5 +3151,11 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x12, 0x08, 0x00, 0x08));
+ define_test_client("/TP/GAW/CL/BI-23-C", test_client, service_db_1,
+ &test_write_11,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x12, 0x08, 0x00, 0x05));
+
return tester_run();
}
--
1.9.1
Verify Generic Attribute Profile client behavior when the Write
Characteristic Descriptor procedure fails due to insufficient
authorization.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 5ed5154..57786ba 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -853,6 +853,14 @@ static const struct test_step test_write_9 = {
.length = 0x03
};
+static const struct test_step test_write_10 = {
+ .handle = 0x0008,
+ .func = test_write,
+ .expected_att_ecode = 0x08,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void test_write_without_response(struct context *context)
{
const struct test_step *step = context->data->step;
@@ -3129,5 +3137,11 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x12, 0x08, 0x00, 0x03));
+ define_test_client("/TP/GAW/CL/BI-22-C", test_client, service_db_1,
+ &test_write_10,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x12, 0x08, 0x00, 0x08));
+
return tester_run();
}
--
1.9.1
Verify Generic Attribute Profile client behavior when the Write
Characteristic Descriptor procedure fails due to write not permitted.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 3c664fe..5ed5154 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -845,6 +845,14 @@ static const struct test_step test_write_8 = {
.length = 0x03
};
+static const struct test_step test_write_9 = {
+ .handle = 0x0008,
+ .func = test_write,
+ .expected_att_ecode = 0x03,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void test_write_without_response(struct context *context)
{
const struct test_step *step = context->data->step;
@@ -3115,5 +3123,11 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x00, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x12, 0x00, 0x00, 0x01));
+ define_test_client("/TP/GAW/CL/BI-21-C", test_client, service_db_1,
+ &test_write_9,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x12, 0x08, 0x00, 0x03));
+
return tester_run();
}
--
1.9.1
Verify Generic Attribute Profile client behavior when the Write
Characteristic Descriptor procedure fails due to invalid handle.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 8aec60b..3c664fe 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -837,6 +837,14 @@ static const struct test_step test_write_7 = {
.length = 0x03
};
+static const struct test_step test_write_8 = {
+ .handle = 0x0000,
+ .func = test_write,
+ .expected_att_ecode = 0x01,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void test_write_without_response(struct context *context)
{
const struct test_step *step = context->data->step;
@@ -3101,5 +3109,11 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x13));
+ define_test_client("/TP/GAW/CL/BI-20-C", test_client, service_db_1,
+ &test_write_8,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x12, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x12, 0x00, 0x00, 0x01));
+
return tester_run();
}
--
1.9.1
Verify that a Generic Attribute Profile client can write a
characteristic descriptor selected by handle.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 06f9193..8aec60b 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -829,6 +829,14 @@ static const struct test_step test_write_6 = {
.length = 0x03
};
+static const struct test_step test_write_7 = {
+ .handle = 0x0008,
+ .func = test_write,
+ .expected_att_ecode = 0,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void test_write_without_response(struct context *context)
{
const struct test_step *step = context->data->step;
@@ -3087,5 +3095,11 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x04, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x12, 0x04, 0x00, 0x03));
+ define_test_client("/TP/GAW/CL/BV-08-C", test_client, service_db_1,
+ &test_write_7,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x13));
+
return tester_run();
}
--
1.9.1