From 87391ba1eebdd8b5229b9fb4a73a84c6d02ffaf5 Mon Sep 17 00:00:00 2001 From: Dave Thaler Date: Thu, 28 Mar 2024 22:53:32 -0700 Subject: [PATCH] Update tests Signed-off-by: Dave Thaler --- tests/end_to_end/netsh_test.cpp | 14 +++++++------- tests/unit/libbpf_test.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/end_to_end/netsh_test.cpp b/tests/end_to_end/netsh_test.cpp index 4d9bee7030..7cc9eb767e 100644 --- a/tests/end_to_end/netsh_test.cpp +++ b/tests/end_to_end/netsh_test.cpp @@ -398,20 +398,20 @@ 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" @@ -419,14 +419,14 @@ TEST_CASE("show verification xdp_datasize_unsafe.o", "[netsh][verification]") "; ./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"); @@ -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"); diff --git a/tests/unit/libbpf_test.cpp b/tests/unit/libbpf_test.cpp index 5df3bfe583..d1f681fe13 100644 --- a/tests/unit/libbpf_test.cpp +++ b/tests/unit/libbpf_test.cpp @@ -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 @@ -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