1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/testing/selftests/bpf/prog_tests/wq.c
Benjamin Tissoires 05cbc217aa selftests/bpf: Drop an unused local variable
Some copy/paste leftover, this is never used.

Fixes: e3d9eac99a ("selftests/bpf: wq: add bpf_wq_init() checks")
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/20240430-bpf-next-v3-3-27afe7f3b17c@kernel.org
2024-04-30 16:28:58 +02:00

40 lines
942 B
C

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024 Benjamin Tissoires */
#include <test_progs.h>
#include "wq.skel.h"
#include "wq_failures.skel.h"
void serial_test_wq(void)
{
struct wq *wq_skel = NULL;
int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
RUN_TESTS(wq);
/* re-run the success test to check if the timer was actually executed */
wq_skel = wq__open_and_load();
if (!ASSERT_OK_PTR(wq_skel, "wq_skel_load"))
return;
err = wq__attach(wq_skel);
if (!ASSERT_OK(err, "wq_attach"))
return;
prog_fd = bpf_program__fd(wq_skel->progs.test_syscall_array_sleepable);
err = bpf_prog_test_run_opts(prog_fd, &topts);
ASSERT_OK(err, "test_run");
ASSERT_EQ(topts.retval, 0, "test_run");
usleep(50); /* 10 usecs should be enough, but give it extra */
ASSERT_EQ(wq_skel->bss->ok_sleepable, (1 << 1), "ok_sleepable");
wq__destroy(wq_skel);
}
void serial_test_failures_wq(void)
{
RUN_TESTS(wq_failures);
}