selftests/bpf: Fix use of uninitialized op_name in log tests
authorLorenz Bauer <lmb@isovalent.com>
Thu, 13 Apr 2023 09:47:40 +0000 (10:47 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 13 Apr 2023 12:17:02 +0000 (14:17 +0200)
One of the test assertions uses an uninitialized op_name, which leads
to some headscratching if it fails. Use a string constant instead.

Fixes: b1a7a480a112 ("selftests/bpf: Add fixed vs rotating verifier log tests")
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230413094740.18041-1-lmb@isovalent.com
tools/testing/selftests/bpf/prog_tests/verifier_log.c

index 475092a..8337c6b 100644 (file)
@@ -110,7 +110,7 @@ static void verif_log_subtest(const char *name, bool expect_load_error, int log_
                }
                if (!ASSERT_EQ(strlen(logs.buf), 24, "log_fixed_25"))
                        goto cleanup;
-               if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, op_name))
+               if (!ASSERT_STRNEQ(logs.buf, logs.reference, 24, "log_fixed_contents_25"))
                        goto cleanup;
        }