From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] selftests/bpf: make correct use of exit codes in bpf selftests Date: Tue, 13 Jun 2017 13:59:11 -0400 (EDT) Message-ID: <20170613.135911.2275664194512785458.davem@davemloft.net> References: <20170613142211.4bc50e1f@redhat.com> <149735983914.1567.4267221692702581758.stgit@firesoul> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, fengguang.wu@intel.com, borkmann@iogearbox.net, linux-kselftest@vger.kernel.org To: brouer@redhat.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:46348 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635AbdFMR7X (ORCPT ); Tue, 13 Jun 2017 13:59:23 -0400 In-Reply-To: <149735983914.1567.4267221692702581758.stgit@firesoul> Sender: netdev-owner@vger.kernel.org List-ID: From: Jesper Dangaard Brouer Date: Tue, 13 Jun 2017 15:17:19 +0200 > The selftests depend on using the shell exit code as a mean of > detecting the success or failure of test-binary executed. The > appropiate output "[PASS]" or "[FAIL]" in generated by > tools/testing/selftests/lib.mk. > > Notice that the exit code is masked with 255. Thus, be careful if > using the number of errors as the exits code, as 256 errors would be > seen as a success. > > There are two standard defined exit(3) codes: > /usr/include/stdlib.h > #define EXIT_FAILURE 1 /* Failing exit status. */ > #define EXIT_SUCCESS 0 /* Successful exit status. */ > > Fix test_verifier.c to not use the negative value of variable > "results", but instead return EXIT_FAILURE. > > Fix test_align.c and test_progs.c to actually use exit codes, before > they were always indicating success regardless of results. > > Signed-off-by: Jesper Dangaard Brouer Applied with commit log message corrected, thanks.