From patchwork Sat Jun 10 22:50:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 774280 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wlZC05yqXz9s82 for ; Sun, 11 Jun 2017 08:51:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbdFJWvC (ORCPT ); Sat, 10 Jun 2017 18:51:02 -0400 Received: from www62.your-server.de ([213.133.104.62]:57836 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbdFJWvA (ORCPT ); Sat, 10 Jun 2017 18:51:00 -0400 Received: from [92.105.166.74] (helo=localhost) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128) (Exim 4.85_2) (envelope-from ) id 1dJpDe-0006pC-Rv; Sun, 11 Jun 2017 00:50:58 +0200 From: Daniel Borkmann To: davem@davemloft.net Cc: ast@fb.com, netdev@vger.kernel.org, Daniel Borkmann Subject: [PATCH net-next 6/8] bpf, tests: set rlimit also for test_align, so it doesn't fail Date: Sun, 11 Jun 2017 00:50:45 +0200 Message-Id: <1f92ac2c63bc5ab688c036b17e45051df3be65b6.1497133948.git.daniel@iogearbox.net> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.2/23462/Sat Jun 10 22:07:58 2017) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When running all the tests, through 'make run_tests', I had test_align failing due to insufficient rlimit. Set it the same way as all other test cases from BPF selftests do, so that test case properly loads everything. [...] Summary: 7 PASSED, 1 FAILED selftests: test_progs [PASS] /home/foo/net-next/tools/testing/selftests/bpf Test 0: mov ... Failed to load program. FAIL Test 1: shift ... Failed to load program. FAIL Test 2: addsub ... Failed to load program. FAIL Test 3: mul ... Failed to load program. FAIL Test 4: unknown shift ... Failed to load program. FAIL Test 5: unknown mul ... Failed to load program. FAIL Test 6: packet const offset ... Failed to load program. FAIL Test 7: packet variable offset ... Failed to load program. FAIL Results: 0 pass 8 fail selftests: test_align [PASS] [...] Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- tools/testing/selftests/bpf/test_align.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/bpf/test_align.c b/tools/testing/selftests/bpf/test_align.c index 9644d4e..1426594 100644 --- a/tools/testing/selftests/bpf/test_align.c +++ b/tools/testing/selftests/bpf/test_align.c @@ -9,6 +9,8 @@ #include #include +#include + #include #include #include @@ -432,6 +434,9 @@ static int do_test(unsigned int from, unsigned int to) int main(int argc, char **argv) { unsigned int from = 0, to = ARRAY_SIZE(tests); + struct rlimit rinf = { RLIM_INFINITY, RLIM_INFINITY }; + + setrlimit(RLIMIT_MEMLOCK, &rinf); if (argc == 3) { unsigned int l = atoi(argv[argc - 2]);