Diff between 60aa371009981c56ba6b563c84f7ec2054058b81 and 1e2c32119db82da4daa2d733f3e2ce2f94231df8

Changed Files

File Additions Deletions Status
unit/test-sdp.c +113 -0 modified

Full Patch

diff --git a/unit/test-sdp.c b/unit/test-sdp.c
index c207907..2c55c95 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();
 }