Re: [PATCH bpf-next v2 3/3] selftests/bpf: test array presets in veristat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 5, 2025 at 11:36 AM Mykyta Yatsenko
<mykyta.yatsenko5@xxxxxxxxx> wrote:
>
> From: Mykyta Yatsenko <yatsenko@xxxxxxxx>
>
> Modify existing veristat tests to verify that array presets are applied
> as expected.
> Introduce few negative tests as well to check that common error modes
> are handled.
>
> Signed-off-by: Mykyta Yatsenko <yatsenko@xxxxxxxx>
> ---
>  .../selftests/bpf/prog_tests/test_veristat.c  | 86 ++++++++++++++++++-
>  .../selftests/bpf/progs/set_global_vars.c     | 51 +++++++----
>  2 files changed, 114 insertions(+), 23 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/test_veristat.c b/tools/testing/selftests/bpf/prog_tests/test_veristat.c
> index 47b56c258f3f..057c249c82fa 100644
> --- a/tools/testing/selftests/bpf/prog_tests/test_veristat.c
> +++ b/tools/testing/selftests/bpf/prog_tests/test_veristat.c
> @@ -60,12 +60,15 @@ static void test_set_global_vars_succeeds(void)
>             " -G \"var_s8 = -128\" "\
>             " -G \"var_u8 = 255\" "\
>             " -G \"var_ea = EA2\" "\
> -           " -G \"var_eb = EB2\" "\
> -           " -G \"var_ec = EC2\" "\
> +           " -G \"var_eb  =  EB2\" "\
> +           " -G \"var_ec=EC2\" "\
>             " -G \"var_b = 1\" "\
> -           " -G \"struct1.struct2.u.var_u8 = 170\" "\
> +           " -G \"struct1[2].struct2[1].u.var_u8[2]=170\" "\
>             " -G \"union1.struct3.var_u8_l = 0xaa\" "\
>             " -G \"union1.struct3.var_u8_h = 0xaa\" "\
> +           " -G \"arr[3]= 171\" "      \
> +           " -G \"arr[EA2] =172\" "    \
> +           " -G \"enum_arr[EC2]=EA3\" "        \
>             "-vl2 > %s", fix->veristat, fix->tmpfile);

can you please also add tests for cases where user specifies array
index for non-array type and vice versa?

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux