Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp569832pxb; Wed, 25 Aug 2021 09:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1Vd5KJvQKINO1133hUkd0ZbtsryxiA2YF7UOD28SQeYne9IcbR9JviN/dVkd9vbyrU72n X-Received: by 2002:a92:a801:: with SMTP id o1mr31361774ilh.128.1629909496394; Wed, 25 Aug 2021 09:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629909496; cv=none; d=google.com; s=arc-20160816; b=l5Hh2tmOczOxoXcTE7XTBLBXLbj2v/kJe7AikbDvwm5OpUwnbd97ew4JJV10HXvsyi ggglIK2X/s9kNkLB7RdMrx2nxm8fYk10wv7RTQXaHZm1pNvn9+eDA/uHVLMSt9Mo8rCE iiOVLR9PnN9SO7cNJraa+m9edGLAN1YiiwtV+mjmgBYT9IPuDqxvvFeWT84DM30iDr6p JieN5H3pwSRDLZ+cx5mL89MAF459C7GCoW9e49aOaY5IE0Cd4D2eiCHXLLJYoJQuanRj KvsNiyAvWjBNumG5n6TK1GZRvUvWfsPTdiZ9K/Ljw44p5UukwCwF/8iwv92Qt7pQGFHa CX9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=1K9N5MpNmrjGAXxPDH6ASnSz5pQKTpuvkicsC84kSJQ=; b=dliTWXKa47USxB8K7goWwXOtzsixGP/0OMz8Wvoa06eKPDYs9AoKD9VyAX3yPqjbKz qbuAQGxWMyQFqoBYuKOPSPdKqERsoGLidlm2H2phUE6EecFmRMVln8CqVeew9oBT5gRQ /ML4OFYjpyxg8xY5QkmwhjdIhSXCEFR+RYbwLY0vGEJxNkoYUqpIdTMxOwPBTMIuJ8La LrmP1HlUUxVqRRnIv+ezH3EsFNA3y2KzbVodAjXhN97m3LUaLd/Y7XBa3b/LbI1gbyoS dqhNCz1wHfXx4MMLaZpW9tlyV9Ti8b4gN+0yb5ZjINHbGww1KoG7H/md+gIJ4c6RHLpy BJbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g/6iBX5t"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si64933jav.89.2021.08.25.09.38.03; Wed, 25 Aug 2021 09:38:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g/6iBX5t"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231234AbhHYQie (ORCPT + 99 others); Wed, 25 Aug 2021 12:38:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbhHYQid (ORCPT ); Wed, 25 Aug 2021 12:38:33 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1880C061757; Wed, 25 Aug 2021 09:37:47 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id u3so52876744ejz.1; Wed, 25 Aug 2021 09:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1K9N5MpNmrjGAXxPDH6ASnSz5pQKTpuvkicsC84kSJQ=; b=g/6iBX5tJrRFfNspQP63D4yGRv27vOeGfOWrFoh+KDZaMsWO0TvTgvongSC9frZPMO 0CtMaRip+gjDHUzTiN3ED4VCKiE+eOXnZV0PADS8PaRFzZ+QLxOf9NIjno9KzEVSKFez tvl7toFz+9dqEoBa/m7i/UkYTK/ym0xJKg/WhpgyOiRy621xbdotMyQmxHhKQ0PoaWDm uM2ChNbe1qc3aORXJGlP2KlEz3DBsEcJ1hapEwuvxUepBtbYHb6d/OuIdMWWwS02+H4h qSTnj8gMKhZRHKjtNG0arkqYh9QiZ1QKOawTbq+TmJ0DSSwTqDOhgs0T+6tayOe30Nqh cApg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1K9N5MpNmrjGAXxPDH6ASnSz5pQKTpuvkicsC84kSJQ=; b=fH+rmHKZx/FPyCVBunTA/24Lc5z5655vJdqZVjz/cLOdze8TZhH0ntKfiwMSrNamT4 3iYLg4/c216eD9yWUJnBd1g6WiGE8Vavk9hk84MfSoYfi5dIcv1Kw3xrznqY8lA8sbXN iEH4qlyDw2zsgDn/IcwvBU319ViDK5PPIkn7RODtfN8hUy82fTzKUZdNAG/MqoEwE1vh lzm3J1cdsjhkYDDaywCbrD6fJvDUSZXxvI61A8XnKMfu264rWmr+H3sbgONX+GD//YYj yN1vbqYFaTyMAjBVUuSRyCfrSVXtzxgOD/tDo8w/sakShiwbR0tXZr4jMSYNeXA5iWtu veVA== X-Gm-Message-State: AOAM532eOBJNYcjribeRIg7m05f4Tv33L2rw+bUs/aguQE9mlS7hYBMr yHhdAtDJxqfPUSRNoYqC5jr9jkNqt2p2DQ== X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr47492298ejc.196.1629909464473; Wed, 25 Aug 2021 09:37:44 -0700 (PDT) Received: from ?IPv6:2a04:241e:502:1d80:f02c:a1bd:70b1:fe95? ([2a04:241e:502:1d80:f02c:a1bd:70b1:fe95]) by smtp.gmail.com with ESMTPSA id u18sm78992ejf.118.2021.08.25.09.37.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 09:37:43 -0700 (PDT) From: Leonard Crestez Subject: Re: [RFCv3 09/15] selftests: tcp_authopt: Test key address binding To: David Ahern , Shuah Khan Cc: Eric Dumazet , "David S. Miller" , Herbert Xu , Kuniyuki Iwashima , Hideaki YOSHIFUJI , Dmitry Safonov <0x7f454c46@gmail.com>, Jakub Kicinski , Yuchung Cheng , Francesco Ruggeri , Mat Martineau , Christoph Paasch , Ivan Delalande , Priyaranjan Jha , Menglong Dong , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <09c7cff43f832d0aba8dfad67f56066aeeca8475.1629840814.git.cdleonard@gmail.com> <922fe343-c867-62ff-14b8-3d84ed2e1b76@gmail.com> Message-ID: Date: Wed, 25 Aug 2021 19:37:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <922fe343-c867-62ff-14b8-3d84ed2e1b76@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 25.08.2021 08:18, David Ahern wrote: > On 8/24/21 2:34 PM, Leonard Crestez wrote: >> By default TCP-AO keys apply to all possible peers but it's possible to >> have different keys for different remote hosts. >> >> This patch adds initial tests for the behavior behind the >> TCP_AUTHOPT_KEY_BIND_ADDR flag. Server rejection is tested via client >> timeout so this can be slightly slow. >> >> Signed-off-by: Leonard Crestez >> --- >> .../tcp_authopt_test/netns_fixture.py | 63 +++++++ >> .../tcp_authopt/tcp_authopt_test/server.py | 82 ++++++++++ >> .../tcp_authopt/tcp_authopt_test/test_bind.py | 143 ++++++++++++++++ >> .../tcp_authopt/tcp_authopt_test/utils.py | 154 ++++++++++++++++++ >> 4 files changed, 442 insertions(+) >> create mode 100644 tools/testing/selftests/tcp_authopt/tcp_authopt_test/netns_fixture.py >> create mode 100644 tools/testing/selftests/tcp_authopt/tcp_authopt_test/server.py >> create mode 100644 tools/testing/selftests/tcp_authopt/tcp_authopt_test/test_bind.py >> create mode 100644 tools/testing/selftests/tcp_authopt/tcp_authopt_test/utils.py >> > > This should be under selftests/net as a single "tcp_authopt" directory > from what I can tell. Maybe? I found no clear guidelines for organizing tests by subsystem. I just did a grep for .py in selftests and placed mine next to tc-testing. Having a tcp_authopt_test code directory under tcp_authopt is the standard pattern for python packages, otherwise all submodules with utilities of dubious generality are dumped at the global level. Removing the tcp_authopt/tcp_authopt_test structure is awkward in python. One way to deal with this is to add my test code in tools/testing/selftests/net/tcp_authopt and my setup.cfg and similar directly in tools/testing/selftests/net. This would make "net" the root of the package and make it easy to add other networking pytests. This seems close to what you mean. kselftest itself does not seem to offer any special support for python code, only some for C and shell. Maybe it could offer a "kselftest" package with common utilities that are used by multiple test packages and everything would be installed into a single virtualenv by makefiles. -- Regards, Leonard