lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 17 Feb 2023 15:02:09 -0800
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Martin KaFai Lau <martin.lau@...ux.dev>
Cc:     bpf@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>, netdev@...r.kernel.org,
        kernel-team@...a.com
Subject: Re: [PATCH bpf-next 4/4] selftests/bpf: Add bpf_fib_lookup test

On Thu, Feb 16, 2023 at 4:42 PM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> From: Martin KaFai Lau <martin.lau@...nel.org>
>
> This patch tests the bpf_fib_lookup helper when looking up
> a neigh in NUD_FAILED and NUD_STALE state. It also adds test
> for the new BPF_FIB_LOOKUP_SKIP_NEIGH flag.
>
> Signed-off-by: Martin KaFai Lau <martin.lau@...nel.org>
> ---
>  .../selftests/bpf/prog_tests/fib_lookup.c     | 187 ++++++++++++++++++
>  .../testing/selftests/bpf/progs/fib_lookup.c  |  22 +++
>  2 files changed, 209 insertions(+)
>  create mode 100644 tools/testing/selftests/bpf/prog_tests/fib_lookup.c
>  create mode 100644 tools/testing/selftests/bpf/progs/fib_lookup.c
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/fib_lookup.c b/tools/testing/selftests/bpf/prog_tests/fib_lookup.c
> new file mode 100644
> index 000000000000..61ccddccf485
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/fib_lookup.c
> @@ -0,0 +1,187 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
> +
> +#include <sys/types.h>
> +#include <net/if.h>
> +
> +#include "test_progs.h"
> +#include "network_helpers.h"
> +#include "fib_lookup.skel.h"
> +
> +#define SYS(fmt, ...)                                          \
> +       ({                                                      \
> +               char cmd[1024];                                 \
> +               snprintf(cmd, sizeof(cmd), fmt, ##__VA_ARGS__); \
> +               if (!ASSERT_OK(system(cmd), cmd))               \
> +                       goto fail;                              \
> +       })

it's probably a high time to move this SYS() macro into test_progs.h
and stop copy/pasting it across many test?

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ