Adds the below client test cases:
1) Characteristic Value Reliable Write - by Client
2) Characteristic Value Reliable Write – Invalid Handle
3) Characteristic Value Reliable Write – Write Not Permitted
4) Characteristic Value Reliable Write – Insufficient Authorization
5) Characteristic Value Reliable Write – Insufficient Authentication
6) Characteristic Value Reliable Write – Insufficient Encryption Key Size
Current GATT TS Summary:
------------------------------------------------------------------------
Group Client Server
-------------------------------------------------------------------------
Configuration 100% (1 / 1) 100% (1 / 1)
Discovery 75% (6 / 8) 75% (6 / 8)
Read 100% (40 / 40) 40.5% (17 / 42)
Write 82.1% (32 / 39) 41.5% (17 / 41)
Notification/Indication 100% (2 / 2) 100% (2 / 2)
Services 0% (0 / 1) 0% (0 / 1)
Timeouts 0% (0 / 2) 0% (0 / 1)
Attributes 0% (0 / 10) 0% (0 / 10)
----------------------------------------------------------------------------
Total 78.6% (81 / 103) 40.5% (43 / 106)
----------------------------------------------------------------------------
ps: Not included the extra tests like small vs large DB, etc., computed it as single.
The reason for low server test cases are its missing functionality (encryption / authorization / authentication),
as discussed in the previous thread http://thread.gmane.org/gmane.linux.bluez.kernel/58852/focus=58853.
Gowtham Anandha Babu (7):
unit/gatt: Add TP/GAW/CL/BV-06-C test
unit/gatt: Add TP/GAW/CL/BI-14-C test
unit/gatt: Add TP/GAW/CL/BI-15-C test
unit/gatt: Add TP/GAW/CL/BI-17-C test
unit/gatt: Add TP/GAW/CL/BI-18-C test
unit/gatt: Add TP/GAW/CL/BI-19-C test
doc/test-coverage: Update test-gatt count
doc/test-coverage.txt | 4 +-
unit/test-gatt.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 121 insertions(+), 2 deletions(-)
--
1.9.1
Hi Gowtham,
On Thu, Apr 16, 2015 at 3:48 PM, Gowtham Anandha Babu
<[email protected]> wrote:
> Adds the below client test cases:
> 1) Characteristic Value Reliable Write - by Client
> 2) Characteristic Value Reliable Write – Invalid Handle
> 3) Characteristic Value Reliable Write – Write Not Permitted
> 4) Characteristic Value Reliable Write – Insufficient Authorization
> 5) Characteristic Value Reliable Write – Insufficient Authentication
> 6) Characteristic Value Reliable Write – Insufficient Encryption Key Size
>
> Current GATT TS Summary:
> ------------------------------------------------------------------------
> Group Client Server
> -------------------------------------------------------------------------
> Configuration 100% (1 / 1) 100% (1 / 1)
> Discovery 75% (6 / 8) 75% (6 / 8)
> Read 100% (40 / 40) 40.5% (17 / 42)
> Write 82.1% (32 / 39) 41.5% (17 / 41)
> Notification/Indication 100% (2 / 2) 100% (2 / 2)
> Services 0% (0 / 1) 0% (0 / 1)
> Timeouts 0% (0 / 2) 0% (0 / 1)
> Attributes 0% (0 / 10) 0% (0 / 10)
> ----------------------------------------------------------------------------
> Total 78.6% (81 / 103) 40.5% (43 / 106)
> ----------------------------------------------------------------------------
>
> ps: Not included the extra tests like small vs large DB, etc., computed it as single.
>
> The reason for low server test cases are its missing functionality (encryption / authorization / authentication),
> as discussed in the previous thread http://thread.gmane.org/gmane.linux.bluez.kernel/58852/focus=58853.
>
> Gowtham Anandha Babu (7):
> unit/gatt: Add TP/GAW/CL/BV-06-C test
> unit/gatt: Add TP/GAW/CL/BI-14-C test
> unit/gatt: Add TP/GAW/CL/BI-15-C test
> unit/gatt: Add TP/GAW/CL/BI-17-C test
> unit/gatt: Add TP/GAW/CL/BI-18-C test
> unit/gatt: Add TP/GAW/CL/BI-19-C test
> doc/test-coverage: Update test-gatt count
>
> doc/test-coverage.txt | 4 +-
> unit/test-gatt.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 121 insertions(+), 2 deletions(-)
>
> --
> 1.9.1
Applied, thanks.
--
Luiz Augusto von Dentz
---
doc/test-coverage.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index 19bb73c..2fb70ad 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -28,10 +28,10 @@ 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 159 GATT qualification test cases
+test-gatt 180 GATT qualification test cases
test-hog 6 HID Over GATT qualification test cases
-----
- 740
+ 761
Automated end-to-end testing
--
1.9.1
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to insufficient encryption
key size.
---
unit/test-gatt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 40e17fd..415680b 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1201,6 +1201,14 @@ static const struct test_step test_reliable_write_5 = {
.length = 0x03
};
+static const struct test_step test_reliable_write_6 = {
+ .handle = 0x0007,
+ .func = test_reliable_write,
+ .expected_att_ecode = 0x0c,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -3883,6 +3891,14 @@ int main(int argc, char *argv[])
raw_pdu(0x18, 0x00),
raw_pdu(0x19));
+ define_test_client("/TP/GAW/CL/BI-19-C", test_client, service_db_1,
+ &test_reliable_write_6,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x07, 0x00, 0x0c),
+ raw_pdu(0x18, 0x00),
+ raw_pdu(0x19));
+
define_test_server("/TP/GAW/SR/BV-06-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to insufficient authentication.
---
unit/test-gatt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index d97290e..40e17fd 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1193,6 +1193,14 @@ static const struct test_step test_reliable_write_4 = {
.length = 0x03
};
+static const struct test_step test_reliable_write_5 = {
+ .handle = 0x0007,
+ .func = test_reliable_write,
+ .expected_att_ecode = 0x05,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -3867,6 +3875,14 @@ int main(int argc, char *argv[])
raw_pdu(0x18, 0x00),
raw_pdu(0x19));
+ define_test_client("/TP/GAW/CL/BI-18-C", test_client, service_db_1,
+ &test_reliable_write_5,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x07, 0x00, 0x05),
+ raw_pdu(0x18, 0x00),
+ raw_pdu(0x19));
+
define_test_server("/TP/GAW/SR/BV-06-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to write not permitted.
---
unit/test-gatt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 9dfa974..e71e0fd 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1177,6 +1177,14 @@ static const struct test_step test_reliable_write_2 = {
.length = 0x03
};
+static const struct test_step test_reliable_write_3 = {
+ .handle = 0x0003,
+ .func = test_reliable_write,
+ .expected_att_ecode = 0x03,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -3835,6 +3843,14 @@ int main(int argc, char *argv[])
raw_pdu(0x18, 0x00),
raw_pdu(0x19));
+ define_test_client("/TP/GAW/CL/BI-15-C", test_client, service_db_1,
+ &test_reliable_write_3,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x03, 0x00, 0x03),
+ raw_pdu(0x18, 0x00),
+ raw_pdu(0x19));
+
define_test_server("/TP/GAW/SR/BV-06-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to invalid handle.
---
unit/test-gatt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index d60eab0..9dfa974 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1169,6 +1169,14 @@ static const struct test_step test_reliable_write_1 = {
.length = 0x03
};
+static const struct test_step test_reliable_write_2 = {
+ .handle = 0x0000,
+ .func = test_reliable_write,
+ .expected_att_ecode = 0x01,
+ .value = write_data_1,
+ .length = 0x03
+};
+
static void att_write_cb(struct gatt_db_attribute *att, int err,
void *user_data)
{
@@ -3819,6 +3827,14 @@ int main(int argc, char *argv[])
raw_pdu(0x18, 0x01),
raw_pdu(0x19));
+ define_test_client("/TP/GAW/CL/BI-14-C", test_client, service_db_1,
+ &test_reliable_write_2,
+ SERVICE_DATA_1_PDUS,
+ raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01),
+ raw_pdu(0x18, 0x00),
+ raw_pdu(0x19));
+
define_test_server("/TP/GAW/SR/BV-06-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1