From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ECDDEB8FA5 for ; Wed, 6 Sep 2023 10:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238591AbjIFKFf (ORCPT ); Wed, 6 Sep 2023 06:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238805AbjIFKF1 (ORCPT ); Wed, 6 Sep 2023 06:05:27 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D5919BA for ; Wed, 6 Sep 2023 03:04:43 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qdpOq-0005e2-S2; Wed, 06 Sep 2023 12:04:40 +0200 Date: Wed, 6 Sep 2023 12:04:40 +0200 From: Florian Westphal To: Thomas Haller Cc: Florian Westphal , netfilter-devel@vger.kernel.org Subject: Re: [PATCH RFC] tests: add feature probing Message-ID: <20230906100440.GD9603@breakpoint.cc> References: <20230831135112.30306-1-fw@strlen.de> <20230904085301.GC11802@breakpoint.cc> <7731edd7662e606a06b1d4c60fb4cff9096fa758.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7731edd7662e606a06b1d4c60fb4cff9096fa758.camel@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Thomas Haller wrote: > On Mon, 2023-09-04 at 10:53 +0200, Florian Westphal wrote: > > Thomas Haller wrote: > > > > > > > > > But why this "nft -f" specific detection? Why not just executable > > > scripts? > > > > Because I want it to be simple, > > It does not seem "simple[r]" to me. The approach requires extra > infrastructure in run-test.sh, while being less flexible. I can add bla.nft and use nft --check -f bla.nft. Or, I can add bla.sh, which does exec $NFT -f - < > I could do that, but I don't see the need for arbitrary scripts so > > far. > > When building without JSON support, various tests fail, but should be > skipped. > > Could we detect JSON support via .nft files? Would we drop then a JSON > .nft file and change the check call to `nft --check -j`?). No, but the test that should be skipped can do $NFT -j list ruleset || exit 77 as first line of the script, no need to load any files, nft will fail with error in case its not built with json support. > Or maybe detection of JSON support needs to be a shell script (doing > `ldd "$NFT_REAL" | greq libjansson`)? In that case, we would have > features-as-shell-scripts very soon. Sure, I see no reason why to not have both. The flat files have the '*nft' suffix for a reason... I'll no longer work on this for the remainder of the month due to time constraints.