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: <5248b967-2887-2205-3e59-fc067e2ada33@iogearbox.net>
Date:   Wed, 21 Aug 2019 14:17:02 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Stanislav Fomichev <sdf@...gle.com>, netdev@...r.kernel.org,
        bpf@...r.kernel.org
Cc:     davem@...emloft.net, ast@...nel.org,
        Andrii Nakryiko <andriin@...com>
Subject: Re: [PATCH bpf-next v2 2/4] selftests/bpf: test_progs: remove global
 fail/success counts

On 8/19/19 9:17 PM, Stanislav Fomichev wrote:
> Now that we have a global per-test/per-environment state, there
> is no longer need to have global fail/success counters (and there
> is no need to save/get the diff before/after the test).

Thanks for the improvements, just a small comment below, otherwise LGTM.

> Introduce QCHECK macro (suggested by Andrii) and covert existing tests
> to it. QCHECK uses new test__fail() to record the failure.
> 
> Cc: Andrii Nakryiko <andriin@...com>
> Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
[...]
> @@ -96,17 +93,25 @@ extern struct ipv6_packet pkt_v6;
>   #define _CHECK(condition, tag, duration, format...) ({			\
>   	int __ret = !!(condition);					\
>   	if (__ret) {							\
> -		error_cnt++;						\
> +		test__fail();						\
>   		printf("%s:FAIL:%s ", __func__, tag);			\
>   		printf(format);						\
>   	} else {							\
> -		pass_cnt++;						\
>   		printf("%s:PASS:%s %d nsec\n",				\
>   		       __func__, tag, duration);			\
>   	}								\
>   	__ret;								\
>   })
>   
> +#define QCHECK(condition) ({						\
> +	int __ret = !!(condition);					\
> +	if (__ret) {							\
> +		test__fail();						\
> +		printf("%s:FAIL:%d ", __func__, __LINE__);		\
> +	}								\
> +	__ret;								\
> +})

I know it's just a tiny nit but the name QCHECK() really doesn't tell me anything
if I don't see its definition. Even just a CHECK_FAIL() might be 'better' and
more aligned with the CHECK() and CHECK_ATTR() we have, at least I don't think
many would automatically derive 'quiet' from the Q prefix [0].

   [0] https://lore.kernel.org/bpf/CAEf4BzbUGiUZBWkTWe2=LfhkXYhQGndN9gR6VTZwfV3eytstUw@mail.gmail.com/

>   #define CHECK(condition, tag, format...) \
>   	_CHECK(condition, tag, duration, format)
>   #define CHECK_ATTR(condition, tag, format...) \
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ