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]
Message-ID: <20200123172544.xjbcgtmaj5g3p6qp@kafai-mbp.dhcp.thefacebook.com>
Date:   Thu, 23 Jan 2020 17:26:44 +0000
From:   Martin Lau <kafai@...com>
To:     Lorenz Bauer <lmb@...udflare.com>
CC:     Shuah Khan <shuah@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
        "Daniel Borkmann" <daniel@...earbox.net>,
        Song Liu <songliubraving@...com>, "Yonghong Song" <yhs@...com>,
        Andrii Nakryiko <andriin@...com>,
        "linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf 3/4] selftests: bpf: make reuseport test output more
 legible

On Thu, Jan 23, 2020 at 04:59:32PM +0000, Lorenz Bauer wrote:
> Include the name of the mismatching result in human readable format
> when reporting an error. The new output looks like the following:
> 
>   unexpected result
>    result: [1, 0, 0, 0, 0, 0]
>   expected: [0, 0, 0, 0, 0, 0]
>   mismatch on DROP_ERR_INNER_MAP (bpf_prog_linum:153)
>   check_results:FAIL:382
> 
> Signed-off-by: Lorenz Bauer <lmb@...udflare.com>
> ---
>  .../bpf/prog_tests/select_reuseport.c         | 30 ++++++++++++++++---
>  1 file changed, 26 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/select_reuseport.c b/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
> index 2c37ae7dc214..09a536af139a 100644
> --- a/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
> +++ b/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
> @@ -316,6 +316,28 @@ static void check_data(int type, sa_family_t family, const struct cmd *cmd,
>  		       expected.len, result.len, get_linum());
>  }
>  
> +static const char *result_to_str(enum result res)
> +{
> +	switch (res) {
> +	case DROP_ERR_INNER_MAP:
> +		return "DROP_ERR_INNER_MAP";
> +	case DROP_ERR_SKB_DATA:
> +		return "DROP_ERR_SKB_DATA";
> +	case DROP_ERR_SK_SELECT_REUSEPORT:
> +		return "DROP_ERR_SK_SELECT_REUSEPORT";
> +	case DROP_MISC:
> +		return "DROP_MISC";
> +	case PASS:
> +		return "PASS";
> +	case PASS_ERR_SK_SELECT_REUSEPORT:
> +		return "PASS_ERR_SK_SELECT_REUSEPORT";
> +	case NR_RESULTS:
This should return "UNKNOWN" also.

> +		return "NR_RESULTS";
> +	default:
> +		return "UNKNOWN";
> +	}
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ