Adds the below server test cases (tested against small and large DB):
1) Characteristic Value Reliable Writes - to Server
2) Nested Long Characteristic Value Reliable Writes - to Server
3) Characteristic Value Reliable Writes - Invalid Handle Response
4) Characteristic Value Reliable Writes - Write Not Permitted Response
5) Cancel Reliable Write Characteristic – from Server
Tested using valgrind, no regression/core dump found.
Gowtham Anandha Babu (7):
unit/test-gatt: Add TP/GAW/SR/BV-06-C test
unit/test-gatt: Add TP/GAW/SR/BV-10-C test
unit/test-gatt: Add TP/GAW/SR/BI-14-C test
unit/test-gatt: Add TP/GAW/SR/BI-15-C test
unit/test-gatt: Add TP/GAW/SR/BV-07-C test
doc/test-coverage: Update test-gatt count
shared/tester: Fix divide by zero error
doc/test-coverage.txt | 4 +--
src/shared/tester.c | 3 +-
unit/test-gatt.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 95 insertions(+), 4 deletions(-)
--
1.9.1
Hi Gowtham,
On Wed, Mar 18, 2015 at 12:05 PM, Gowtham Anandha Babu
<[email protected]> wrote:
> Adds the below server test cases (tested against small and large DB):
> 1) Characteristic Value Reliable Writes - to Server
> 2) Nested Long Characteristic Value Reliable Writes - to Server
> 3) Characteristic Value Reliable Writes - Invalid Handle Response
> 4) Characteristic Value Reliable Writes - Write Not Permitted Response
> 5) Cancel Reliable Write Characteristic – from Server
>
> Tested using valgrind, no regression/core dump found.
>
> Gowtham Anandha Babu (7):
> unit/test-gatt: Add TP/GAW/SR/BV-06-C test
> unit/test-gatt: Add TP/GAW/SR/BV-10-C test
> unit/test-gatt: Add TP/GAW/SR/BI-14-C test
> unit/test-gatt: Add TP/GAW/SR/BI-15-C test
> unit/test-gatt: Add TP/GAW/SR/BV-07-C test
> doc/test-coverage: Update test-gatt count
> shared/tester: Fix divide by zero error
>
> doc/test-coverage.txt | 4 +--
> src/shared/tester.c | 3 +-
> unit/test-gatt.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 95 insertions(+), 4 deletions(-)
>
> --
> 1.9.1
Applied, thanks.
--
Luiz Augusto von Dentz
Before adding a check - o/p:
Total: 0, Passed: 0 (-nan%), Failed: 0, Not Run: 0
After check - o/p:
Total: 0, Passed: 0 (0.0%), Failed: 0, Not Run: 0
---
src/shared/tester.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/tester.c b/src/shared/tester.c
index d05bf08..3c3089f 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -319,7 +319,8 @@ static int tester_summarize(void)
COLOR_RED "Failed: %d" COLOR_OFF ", "
COLOR_YELLOW "Not Run: %d" COLOR_OFF "\n",
not_run + passed + failed, passed,
- (float) passed * 100 / (not_run + passed + failed),
+ (not_run + passed + failed) ?
+ (float) passed * 100 / (not_run + passed + failed) : 0,
failed, not_run);
execution_time = g_timer_elapsed(test_timer, NULL);
--
1.9.1
---
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 c64057c..1f179c8 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -29,10 +29,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 149 GATT qualification test cases
+test-gatt 159 GATT qualification test cases
test-hog 6 HID Over GATT qualification test cases
-----
- 730
+ 740
Automated end-to-end testing
--
1.9.1
Verify that a Generic Attribute Profile server can support cancel
of a reliable write.
---
unit/test-gatt.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index fd5752f..3e4353f 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -3107,6 +3107,28 @@ int main(int argc, char *argv[])
raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x12, 0x07, 0x00, 0x0c));
+ define_test_server("/TP/GAW/SR/BV-07-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x18, 0x00),
+ raw_pdu(0x19),
+ raw_pdu(0x0a, 0x03, 0x00),
+ raw_pdu(0x0b, 0x42, 0x6c, 0x75, 0x65, 0x5a));
+
+ define_test_server("/TP/GAW/SR/BV-07-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0xc4, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0xc4, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x18, 0x00),
+ raw_pdu(0x19),
+ raw_pdu(0x0a, 0xc4, 0x00),
+ raw_pdu(0x0b, '1', '1', '1', '1', '1', '2', '2', '2',
+ '2', '2', '3', '3', '3', '3', '3', '4', '4',
+ '4', '4', '4', '5'));
+
define_test_server("/TP/GAW/SR/BV-03-C/small", test_server,
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
--
1.9.1
Verify that a Generic Attribute Profile server can detect and
reject a Characteristic Value Reliable Write Request to a
non-writeable Characteristic Value and issue a Write Not
Permitted Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 37e95f5..fd5752f 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -3259,6 +3259,18 @@ int main(int argc, char *argv[])
raw_pdu(0x16, 0x0f, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
raw_pdu(0x01, 0x16, 0x0f, 0xf0, 0x01));
+ define_test_server("/TP/GAW/SR/BI-15-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x05, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x05, 0x00, 0x03));
+
+ define_test_server("/TP/GAW/SR/BI-15-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x73, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x73, 0x00, 0x03));
+
define_test_client("/TP/GAW/CL/BV-08-C", test_client, service_db_1,
&test_write_7,
SERVICE_DATA_1_PDUS,
--
1.9.1
Verify that a Generic Attribute Profile server can detect and
reject a Reliable Write Request to an invalid Characteristic
handle and issue an Invalid Handle Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 09ca61a..37e95f5 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -3247,6 +3247,18 @@ int main(int argc, char *argv[])
raw_pdu(0x18, 0x01),
raw_pdu(0x19));
+ define_test_server("/TP/GAW/SR/BI-14-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01));
+
+ define_test_server("/TP/GAW/SR/BI-14-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x0f, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x01, 0x16, 0x0f, 0xf0, 0x01));
+
define_test_client("/TP/GAW/CL/BV-08-C", test_client, service_db_1,
&test_write_7,
SERVICE_DATA_1_PDUS,
--
1.9.1
Verify that a Generic Attribute Profile server can support reliable
writing to a Characteristic Value selected by handle.
---
unit/test-gatt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 93ee2c7..65bdc52 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -3203,6 +3203,22 @@ int main(int argc, char *argv[])
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
raw_pdu(0x01, 0x16, 0x73, 0x00, 0x03));
+ define_test_server("/TP/GAW/SR/BV-06-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x18, 0x01),
+ raw_pdu(0x19));
+
+ define_test_server("/TP/GAW/SR/BV-06-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x18, 0x01),
+ raw_pdu(0x19));
+
define_test_client("/TP/GAW/CL/BV-08-C", test_client, service_db_1,
&test_write_7,
SERVICE_DATA_1_PDUS,
--
1.9.1
Verify that a Generic Attribute Profile server can support nested
reliable writing to long Characteristic Values selected by handle.
---
unit/test-gatt.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 65bdc52..09ca61a 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1204,7 +1204,7 @@ static struct gatt_db *make_test_spec_small_db(void)
BT_GATT_CHRC_PROP_READ,
"BlueZ Unit Tester"),
CHARACTERISTIC(0000B009-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_READ,
+ BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
BT_GATT_CHRC_PROP_READ, 0x09),
CHARACTERISTIC(GATT_CHARAC_APPEARANCE, BT_ATT_PERM_READ,
BT_GATT_CHRC_PROP_READ, 0x00, 0x00),
@@ -3219,6 +3219,34 @@ int main(int argc, char *argv[])
raw_pdu(0x18, 0x01),
raw_pdu(0x19));
+ define_test_server("/TP/GAW/SR/BV-10-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x16, 0x15, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x15, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x16, 0x03, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x17, 0x03, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x16, 0x15, 0xf0, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x17, 0x15, 0xf0, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x18, 0x01),
+ raw_pdu(0x19));
+
+ define_test_server("/TP/GAW/SR/BV-10-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x16, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x17, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x16, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x17, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x16, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x17, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
+ raw_pdu(0x18, 0x01),
+ raw_pdu(0x19));
+
define_test_client("/TP/GAW/CL/BV-08-C", test_client, service_db_1,
&test_write_7,
SERVICE_DATA_1_PDUS,
--
1.9.1