summaryrefslogtreecommitdiff
path: root/unit/test-sdp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-01-06 14:37:36 -0800
committerMarcel Holtmann <marcel@holtmann.org>2013-01-06 14:37:36 -0800
commit1e2c32119db82da4daa2d733f3e2ce2f94231df8 (patch)
tree93b6ea030c913bf76518aa0c638d8d2499f405e0 /unit/test-sdp.c
parent60aa371009981c56ba6b563c84f7ec2054058b81 (diff)
downloadbluez-1e2c32119db82da4daa2d733f3e2ce2f94231df8.tar.gz
unit: Add test cases for SDP Service Search Requests
Diffstat (limited to 'unit/test-sdp.c')
-rw-r--r--unit/test-sdp.c113
1 files changed, 113 insertions, 0 deletions
diff --git a/unit/test-sdp.c b/unit/test-sdp.c
index c20790746..2c55c95a8 100644
--- a/unit/test-sdp.c
+++ b/unit/test-sdp.c
@@ -726,5 +726,118 @@ int main(int argc, char *argv[])
raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
0x01, 0x00, 0x01, 0x00, 0x01, 0x00));
+ /*
+ * Service Search Request
+ *
+ * Verify the correct behaviour of the IUT when searching for
+ * existing service(s), using continuation state.
+ */
+ define_ss("BV-03-C/UUID-16",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
+ 0x01, 0x00, 0xff, 0xff, 0x00),
+ raw_pdu_cont(8, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x08, 0x00,
+ 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
+ 0x05, 0x00, 0x01, 0x00, 0x06, 0x08),
+ raw_pdu_cont(8, 0x02, 0x00, 0x02, 0x00, 0x10, 0x35, 0x03, 0x19,
+ 0x01, 0x00, 0xff, 0xff, 0x08),
+ raw_pdu(0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0x08, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x07, 0x00));
+ define_ss("BV-03-C/UUID-32",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
+ 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00),
+ raw_pdu_cont(8, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x08, 0x00,
+ 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
+ 0x05, 0x00, 0x01, 0x00, 0x06, 0x08),
+ raw_pdu_cont(8, 0x02, 0x00, 0x02, 0x00, 0x12, 0x35, 0x05, 0x1a,
+ 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x08),
+ raw_pdu(0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0x08, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x07, 0x00));
+ define_ss("BV-03-C/UUID-128",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
+ 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
+ 0xff, 0xff, 0x00),
+ raw_pdu_cont(8, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x08, 0x00,
+ 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
+ 0x05, 0x00, 0x01, 0x00, 0x06, 0x08),
+ raw_pdu_cont(8, 0x02, 0x00, 0x02, 0x00, 0x1e, 0x35, 0x11, 0x1c,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
+ 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
+ 0xff, 0xff, 0x08),
+ raw_pdu(0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0x08, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x07, 0x00));
+
+ /*
+ * Service Search Request
+ *
+ * Verify the correct behaviour of the IUT when searching for
+ * no existing service(s).
+ */
+ define_ss("BV-04-C/UUID-16",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
+ 0xff, 0xff, 0x00, 0x01, 0x00),
+ raw_pdu(0x03, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x00, 0x00));
+ define_ss("BV-04-C/UUID-128",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x01, 0x00),
+ raw_pdu(0x03, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x00, 0x00));
+ define_ss("BV-04-C/UUID-32",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00),
+ raw_pdu(0x03, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x00, 0x00));
+
+ /*
+ * Service Search Request
+ *
+ * Verify the correct behaviour of the IUT when searching for
+ * existing service(s), using invalid PDU size.
+ */
+ define_ss("BI-01-C/UUID-16",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
+ 0x01, 0x00, 0x00, 0x05, 0x00),
+ raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
+ define_ss("BI-01-C/UUID-32",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00),
+ raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
+ define_ss("BI-01-C/UUID-128",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
+ 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
+ 0x00, 0x05, 0x00),
+ raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
+
+ /*
+ * Service Search Request
+ *
+ * Verify the correct behaviour of the IUT when searching for
+ * existing service(s), using invalid request syntax.
+ */
+ define_ss("BI-02-C/UUID-16",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x06, 0x35, 0x03, 0x19,
+ 0x01, 0x00, 0x00),
+ raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
+ define_ss("BI-02-C/UUID-32",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x05, 0x1a,
+ 0x00, 0x00, 0x01, 0x00, 0x00),
+ raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
+ define_ss("BI-02-C/UUID-128",
+ raw_pdu(0x02, 0x00, 0x01, 0x00, 0x14, 0x35, 0x11, 0x1c,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
+ 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
+ 0x00),
+ raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
+
return g_test_run();
}