Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Mar 29, 2024
1 parent 583f8f7 commit 87391ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tests/end_to_end/netsh_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,35 +398,35 @@ TEST_CASE("show verification xdp_datasize_unsafe.o", "[netsh][verification]")
"\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:32\n"
"; if (next_header + sizeof(ETHERNET_HEADER) > (char*)ctx->data_end) {\n"
"4: (r3.type in {number, ctx, stack, packet, shared})\n"
"4: Invalid type (r3.type in {number, ctx, stack, packet, shared})\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:32\n"
"; if (next_header + sizeof(ETHERNET_HEADER) > (char*)ctx->data_end) {\n"
"5: Invalid type (valid_access(r3.offset) for comparison/subtraction)\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:32\n"
"; if (next_header + sizeof(ETHERNET_HEADER) > (char*)ctx->data_end) {\n"
"5: (r3.type == non_map_fd)\n"
"5: Invalid type (r3.type == non_map_fd)\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:32\n"
"; if (next_header + sizeof(ETHERNET_HEADER) > (char*)ctx->data_end) {\n"
"5: Cannot subtract pointers to different regions (r3.type == r1.type in {ctx, stack, packet})\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:38\n"
"; if (ethernet_header->Type != ntohs(ETHERNET_TYPE_IPV4) && ethernet_header->Type != "
"ntohs(ETHERNET_TYPE_IPV6)) {\n"
"6: (r2.type in {ctx, stack, packet, shared})\n"
"6: Invalid type (r2.type in {ctx, stack, packet, shared})\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:38\n"
"; if (ethernet_header->Type != ntohs(ETHERNET_TYPE_IPV4) && ethernet_header->Type != "
"ntohs(ETHERNET_TYPE_IPV6)) {\n"
"6: Invalid type (valid_access(r2.offset+12, width=2) for read)\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:38\n"
"; if (ethernet_header->Type != ntohs(ETHERNET_TYPE_IPV4) && ethernet_header->Type != "
"ntohs(ETHERNET_TYPE_IPV6)) {\n"
"7: (r1.type == number)\n"
"7: Invalid type (r1.type == number)\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:38\n"
"; if (ethernet_header->Type != ntohs(ETHERNET_TYPE_IPV4) && ethernet_header->Type != "
"ntohs(ETHERNET_TYPE_IPV6)) {\n"
"8: (r1.type == number)\n"
"8: Invalid type (r1.type == number)\n"
"; ./tests/sample/unsafe/xdp_datasize_unsafe.c:43\n"
"; return rc;\n"
"10: (r0.type == number)\n"
"10: Invalid type (r0.type == number)\n"
"\n"
"9 errors\n"
"\n");
Expand All @@ -449,7 +449,7 @@ TEST_CASE("show verification printk_unsafe.o", "[netsh][verification]")
"\n"
"; ./tests/sample/unsafe/printk_unsafe.c:22\n"
"; bpf_printk(\"ctx: %u\", (uint64_t)ctx);\n"
"7: (r3.type == number)\n"
"7: Invalid type (r3.type == number)\n"
"\n"
"1 errors\n"
"\n");
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/libbpf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ TEST_CASE("invalid bpf_load_program", "[libbpf][deprecated]")
REQUIRE(program_fd < 0);
#if !defined(CONFIG_BPF_JIT_DISABLED)
REQUIRE(errno == EACCES);
REQUIRE(strcmp(log_buffer, "\n0: (r0.type == number)\n\n") == 0);
REQUIRE(strcmp(log_buffer, "\n0: Invalid type (r0.type == number)\n\n") == 0);
#else
REQUIRE(errno == ENOTSUP);
#endif
Expand All @@ -243,7 +243,7 @@ TEST_CASE("invalid bpf_prog_load", "[libbpf]")
REQUIRE(program_fd < 0);
#if !defined(CONFIG_BPF_JIT_DISABLED)
REQUIRE(errno == EACCES);
REQUIRE(strcmp(log_buffer, "\n0: (r0.type == number)\n\n") == 0);
REQUIRE(strcmp(log_buffer, "\n0: Invalid type (r0.type == number)\n\n") == 0);
#else
REQUIRE(errno == ENOTSUP);
#endif
Expand Down

0 comments on commit 87391ba

Please sign in to comment.