From 60faa1eb043e1031ee52323835e8f0921ca63635 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 6 Jan 2013 15:23:51 -0800 Subject: [PATCH] unit: Add SDP Service Search Attribute Requests invalid behavior tests --- unit/test-sdp.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/unit/test-sdp.c b/unit/test-sdp.c index f537a0323..310bce6b3 100644 --- a/unit/test-sdp.c +++ b/unit/test-sdp.c @@ -1322,5 +1322,52 @@ int main(int argc, char *argv[]) 0x00), raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04)); + /* + * Service Search Attribute Request + * + * Verify the correct behaviour of the IUT when searching + * for existing Attribute, using invalid request syntax, + * using the ServiceSearchAttributeRequest PDU. + */ + define_ssa("BI-01-C/UUID-16", + raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0b, 0x35, 0x03, 0x19, + 0x01, 0x00, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00), + raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03)); + define_ssa("BI-01-C/UUID-32", + raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x05, 0x1a, + 0x00, 0x00, 0x01, 0x00, 0x35, 0x03, 0x09, 0x00, + 0x01, 0x00), + raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03)); + define_ssa("BI-01-C/UUID-128", + raw_pdu(0x06, 0x00, 0x01, 0x00, 0x19, 0x35, 0x11, 0x1c, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb, + 0x35, 0x03, 0x09, 0x00, 0x01, 0x00), + raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03)); + + /* + * Service Search Attribute Request + * + * Verify the correct behaviour of the IUT when searching + * for existing Attribute, using invalid PDU-size, using the + * ServiceSearchAttributeRequest PDU. + */ + define_ssa("BI-02-C/UUID-16", + raw_pdu(0x06, 0x00, 0x01, 0x00, 0x12, 0x35, 0x03, 0x19, + 0x01, 0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, + 0x01, 0x00), + raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04)); + define_ssa("BI-02-C/UUID-32", + raw_pdu(0x06, 0x00, 0x01, 0x00, 0x14, 0x35, 0x05, 0x1a, + 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x35, 0x03, + 0x09, 0x00, 0x01, 0x00), + raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04)); + define_ssa("BI-02-C/UUID-128", + raw_pdu(0x06, 0x00, 0x01, 0x00, 0x20, 0x35, 0x11, 0x1c, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb, + 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00), + raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04)); + return g_test_run(); } -- 2.47.3