3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:49:37 +01:00

unit: Add another test with an out-of-order tag

This commit is contained in:
Denis Kenzior 2019-01-30 11:21:06 -06:00
parent 995cbc7ad3
commit 3cf0184089

View File

@ -126,7 +126,7 @@ static const uint8_t probe_req_good2[] = {
static const struct test_frame_data probe_req_good2_data = static const struct test_frame_data probe_req_good2_data =
{ probe_req_good2, sizeof(probe_req_good2), true }; { probe_req_good2, sizeof(probe_req_good2), true };
static const uint8_t probe_req_bad1[] = { static const uint8_t probe_req_ie_out_of_order1[] = {
/* Header */ /* Header */
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00,
0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x64, 0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x64,
@ -134,10 +134,12 @@ static const uint8_t probe_req_bad1[] = {
0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x30, 0x48, 0x60, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x30, 0x48, 0x60,
0x6c, 0x01, 0x08, 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x6c, 0x01, 0x08, 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24,
}; };
static const struct test_frame_data probe_req_bad1_data =
{ probe_req_bad1, sizeof(probe_req_bad1), false };
static const uint8_t probe_req_bad2[] = { static const struct test_frame_data probe_req_ie_out_of_order1_data = {
probe_req_ie_out_of_order1, sizeof(probe_req_ie_out_of_order1), true
};
static const uint8_t probe_req_ie_out_of_order2[] = {
/* Header */ /* Header */
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00,
0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x64, 0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x64,
@ -146,8 +148,25 @@ static const uint8_t probe_req_bad2[] = {
0x74, 0x31, 0x01, 0x08, 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x74, 0x31, 0x01, 0x08, 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24,
0x32, 0x04, 0x30, 0x48, 0x60, 0x6c, 0x32, 0x04, 0x30, 0x48, 0x60, 0x6c,
}; };
static const struct test_frame_data probe_req_bad2_data =
{ probe_req_bad2, sizeof(probe_req_bad2), false }; static const struct test_frame_data probe_req_ie_out_of_order2_data = {
probe_req_ie_out_of_order2, sizeof(probe_req_ie_out_of_order2), true
};
static const uint8_t probe_req_ie_out_of_order3[] = {
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xda, 0xa1,
0x19, 0x11, 0xec, 0x70, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x25,
0x00, 0x00, 0x01, 0x04, 0x02, 0x04, 0x0b, 0x16, 0x32, 0x08, 0x0c, 0x12,
0x18, 0x24, 0x30, 0x48, 0x60, 0x6c, 0x03, 0x01, 0x06, 0x2d, 0x1a, 0x6e,
0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xdd, 0x07, 0x00, 0x50, 0xf2, 0x08, 0x00, 0x01, 0x00, 0x7f, 0x05,
0x00, 0x00, 0x0a, 0x02, 0x01,
};
static const struct test_frame_data probe_req_ie_out_of_order3_data = {
probe_req_ie_out_of_order3, sizeof(probe_req_ie_out_of_order3), true
};
static void ie_order_test(const void *data) static void ie_order_test(const void *data)
{ {
@ -165,8 +184,12 @@ int main(int argc, char *argv[])
l_test_add("/IE order/Good 1", ie_order_test, &probe_req_good1_data); l_test_add("/IE order/Good 1", ie_order_test, &probe_req_good1_data);
l_test_add("/IE order/Good 2", ie_order_test, &probe_req_good2_data); l_test_add("/IE order/Good 2", ie_order_test, &probe_req_good2_data);
l_test_add("/IE order/Bad 1", ie_order_test, &probe_req_bad1_data); l_test_add("/IE order/Good (Out of Order IE) 1", ie_order_test,
l_test_add("/IE order/Bad 2", ie_order_test, &probe_req_bad2_data); &probe_req_ie_out_of_order1_data);
l_test_add("/IE order/Good (Out of Order IE) 2", ie_order_test,
&probe_req_ie_out_of_order2_data);
l_test_add("/IE order/Good 3", ie_order_test,
&probe_req_ie_out_of_order3_data);
return l_test_run(); return l_test_run();
} }