From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id ABC068015B for ; Mon, 21 Sep 2026 14:53:26 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68LEqE9d006594; Mon, 21 Sep 2026 17:52:15 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68LEqE9d006594 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="oM/aiqec" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68LEppRm006532 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 21 Sep 2026 17:51:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68LEppRm006532 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-486f9d150c3so1287815f8f.3 for ; Mon, 21 Sep 2026 07:51:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvByKdbr7Mr2MF3YfrSA5Wo24fDyCrm0HGNbygC/OYR7zXiOVrjCRzIy/hoCk0c2h1HP0IuzAvw==@openvz.org X-Gm-Message-State: AFuF++mK9xARe1qgzp5ffEGLdXil+psEHFyGgDW68JkmNRJWZ37Ook0m iNjnWBfkx2RU1oTlix8aBqP6c1h1Fp2TilXIK3vDalh6D9kag0wkqPdLdb/rxDlDaXhPedn8YdN A0yufn3ImGgfHQdWgUgGf1wEJP0BbkQ3Gc/+QMHY0hHwNXLOfUjiZ5Q== X-Gm-Gg: AYBFou12K7+Oz9VEHqJND+lcf0mGd8DWmZZ0SPQxWGyOC4ZgUgFdsHla4SGN/PhjqPp LRe+L52L5sGRXg5MvPh6A7Aia3O2dY87wMBjSp0MqATcoWDDeMSB3nX1M1Mc4VYfL3oLE+NC0r/ tGOAESETQdZIdEpcjl88U/uly9hqa9uBXZBK0pltZYIqrXR305pSl/IuZiWs7PXsNrgvUKk796l Gys4LjFqNQJkhJvxrTWDc8cwgAAs7j5pwIDw8HtsABUCbxLeGjzkiucNMOM7jez4S9vUqDCcPFl Cow/QBiTPebLVwg6UKNCv9m2oKSmYeIhPLwoUziIAvBEHBFWDcuP4FVKby429JDAaCKjHhlO4Fw 5Ypb9IcA5+0AGUMqKmRAu6eg2fGAc X-Received: by 2002:a05:6000:2912:b0:487:72f:fb42 with SMTP id ffacd0b85a97d-4871e25ddafmr22030243f8f.14.1790002311042; Mon, 21 Sep 2026 07:51:51 -0700 (PDT) X-Received: by 2002:a05:6000:2912:b0:487:72f:fb42 with SMTP id ffacd0b85a97d-4871e25ddafmr22030223f8f.14.1790002310555; Mon, 21 Sep 2026 07:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790002310; cv=none; d=google.com; s=arc-20260327; b=j4fumqhFJvjxOLAjv5LWeDaJYjbKxmsSUT0a3DUna1fPCKepmTqaH2TyF8vOkMz+6h 4Dnazgj5zOxbEZD7BLU+yFyYe+ZDMzkz112MipOi4rP+4BerOmEQcALXPAElW+A+uEUj tkKmBMumnClN/o6T+gX8ZsFSdH341VV7OAgUwOg1/WJWZEG2yYTMBOsutEZGpbGxZzC2 U0/gQiCz5q3v2PJKOr2y54m7mROltT1w0iGbxhErQZnRxqYfagrRwoZkeBLQhmrctE2K 1UUBIMYk1Cy3Dl/NQLn2phqYt3YnSfeRAZFpwWW3LP3W2gY4mn9WTrAdtoyZ8st6MYdt qUow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=cuV+0J73VDBnXT3Irbgae/quV8KnPuQKbdgnT7IzG1A=; fh=CTF2GHyV+XdzB5TROrdG4fdLri6JSHNOBC+LNuNq5bA=; b=YNC1w2Appmj4gnqnaCnxMXOo91HZYIhuZtqpHDiOxpON+ZghAwfdme4wjgygyzcQSK vowd0J4RAefc+LWPmaAQr/TO0+w16J7OWNtyM0WhognGmHozSrS6ORKET90ZLocKmyJU CFGY93Ft0fCCkEmf6GCnQDMKbqavbedIwD7k/PDDRIoLUONW9NbecvmDb9TCHzzYhoiy +SEa5qA4nl2I8buwX45Vfl8M4f4Dnpj2gvA8QjIu6jhMG4VBQbQpnA9ih+9hktckUiEz cZgNUz/B+Y3OKSLstA98u1f+R3x8Fn3h3//RCLk9PLdOsaNI3EVAe2KKsW/DuBQibN23 wMGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="oM/aiqec"; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-487245b82dbsi13869530f8f.435.2026.09.21.07.51.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 07:51:50 -0700 (PDT) Received-SPF: pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="oM/aiqec"; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=cuV+0J73VDBnXT3Irbgae/quV8KnPuQKbdgnT7IzG1A=; b=oM/aiqec5+Ml mx6Ei7p3quD6QOeDtZEDFDAhXfbq49T0MXAtPB/w1WmHA/TfaYmC4zbZ24JUby7HKUxz1oMd+hhXf Wx+hSMjKcQEyjLPgRLcg+psMhFMywLS6jXVeXDrJ1TmnHL4Q2Ox6FVKD6U9X7fzYMYqkr4wLG/GdR L4JJKne2Ij1y8Pl06BrIEG4Z0s9Z+FZMj99Vc8MCg5pLbp363RWbhE2iSZO92Ybg8rrT6yfxMHyOZ Q6ck/8FbGhFlASG2cA29Ky2YDSMzv4J4i9psSYV1VuVKIgXsPFOmitsAuPsfBFVGux1D8zlxO512n vTdUfHRuj8QPVfov6bdZog==; Received: from [130.117.225.5] (helo=dev012.aci.vzint.dev) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x8fK8-0032It-0K; Mon, 21 Sep 2026 16:51:41 +0200 MIME-Version: 1.0 From: Vladimir Riabchun To: Eva Kurchatova In-Reply-To: <20260831224850.1642265-3-eva.kurchatova@virtuozzo.com> References: <20260831224850.1642265-1-eva.kurchatova@virtuozzo.com> <20260831224850.1642265-3-eva.kurchatova@virtuozzo.com> Date: Mon, 21 Sep 2026 14:51:47 +0000 Message-Id: <179000230735.645403.4114738534027274554.b4-review@b4> X-Mailer: b4 0.16.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH vz10 3/7] selftests: net: skip what this kernel and iproute2 do not have X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org > Five cases report a failure where a feature is simply not there. > > tls asks for every cipher it knows and fails on the ones the kernel does > not implement, SM4 and ARIA, which answer ENOENT at setsockopt > time. Skip a cipher the kernel refuses that way; the run then reports > 632 passed, 264 skipped and none failed. > > rtnetlink.sh sets up an erspan tunnel, which this kernel does not have > and which fails with "Unknown device type", and checks a netconf dump > whose exit status iproute2 gets wrong: 6.11 exits 2 on a dump that > worked, 6.17 exits 0. Probe for both and skip when unusable. > > rtnetlink.py asks for an IPv4 multicast address dump the kernel answers > with EOPNOTSUPP, and ip_local_port_range asks for protocols it does not > have. Skip those too. > > https://virtuozzo.atlassian.net/browse/VSTOR-139651 > Feature: fix selftests > Signed-off-by: Eva Kurchatova > > diff --git a/tools/testing/selftests/net/ip_local_port_range.c b/tools/testing/selftests/net/ip_local_port_range.c > index 29451d2244b7..2d7b9c852b2b 100644 > --- a/tools/testing/selftests/net/ip_local_port_range.c > +++ b/tools/testing/selftests/net/ip_local_port_range.c > @@ -118,10 +118,6 @@ static int get_ip_local_port_range(int fd, __u32 *range) > > FIXTURE(ip_local_port_range) {}; > > -FIXTURE_SETUP(ip_local_port_range) > -{ > -} > - > FIXTURE_TEARDOWN(ip_local_port_range) > { > } > @@ -180,6 +176,19 @@ FIXTURE_VARIANT_ADD(ip_local_port_range, ip6_mptcp) { > .so_protocol = IPPROTO_MPTCP, > }; > > +FIXTURE_SETUP(ip_local_port_range) > +{ > + int fd; > + > + /* Not every protocol under test is built into every kernel. */ > + fd = socket(variant->so_domain, variant->so_type, variant->so_protocol); > + if (fd < 0 && (errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || > + errno == EAFNOSUPPORT)) > + SKIP(return, "%s", strerror(errno)); > + ASSERT_GE(fd, 0) TH_LOG("socket failed"); > + close(fd); > +} > + > TEST_F(ip_local_port_range, invalid_option_value) > { > __u16 val16; > diff --git a/tools/testing/selftests/net/rtnetlink.py b/tools/testing/selftests/net/rtnetlink.py > index baa7b33f313e..425fc7a3941b 100755 > --- a/tools/testing/selftests/net/rtnetlink.py > +++ b/tools/testing/selftests/net/rtnetlink.py > @@ -1,7 +1,9 @@ > #! /usr/bin/python3 -sP > # SPDX-License-Identifier: GPL-2.0 > > -from lib.py import ksft_exit, ksft_run, ksft_ge, RtnlAddrFamily > +from lib.py import ksft_exit, ksft_run, ksft_ge, KsftSkipEx > +from lib.py import NlError, RtnlAddrFamily > +import errno > import socket > > IPV4_ALL_HOSTS_MULTICAST = b'\xe0\x00\x00\x01' > @@ -12,7 +14,12 @@ def dump_mcaddr_check(rtnl: RtnlAddrFamily) -> None: > At least the loopback interface should have this address. > """ > > - addresses = rtnl.getmulticast({"ifa-family": socket.AF_INET}, dump=True) > + try: > + addresses = rtnl.getmulticast({"ifa-family": socket.AF_INET}, dump=True) > + except NlError as e: > + if e.nl_msg.error == -errno.EOPNOTSUPP: > + raise KsftSkipEx("IPv4 multicast address dump is not supported") > + raise > > all_host_multicasts = [ > addr for addr in addresses if addr['multicast'] == IPV4_ALL_HOSTS_MULTICAST > diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh > index 5f72b447e940..cc4e94b90002 100755 > --- a/tools/testing/selftests/net/rtnetlink.sh > +++ b/tools/testing/selftests/net/rtnetlink.sh > @@ -142,10 +142,30 @@ kci_del_dummy() > run_cmd ip link del dev "$devdummy" > } > > +# Some iproute2 versions exit non-zero from a netconf dump that worked, > +# printing the devconf and then failing anyway. Nothing about the kernel > +# can be learned from the exit status of such an ip, so find out once. > +netconf_exit_status_usable() > +{ > + local out > + > + out=$(ip -4 netconf show dev lo 2>/dev/null) > + if [ $? -ne 0 ] && [ -n "$out" ]; then > + return 1 > + fi > + return 0 > +} > + > kci_test_netconf() > { > dev="$1" > r=$ret > + > + if ! netconf_exit_status_usable; then > + end_test "SKIP: ip netconf $dev: iproute2 fails a dump that worked" > + return $ksft_skip > + fi > + > run_cmd ip netconf show dev "$dev" > for f in 4 6; do > run_cmd ip -$f netconf show dev "$dev" > @@ -920,6 +940,17 @@ kci_test_erspan() > return $ksft_skip > fi > > + # the kernel can be built without erspan, rtnetlink then has no ops > + # for the type and says so. A kernel that has it gets past this and > + # fails on the attributes the probe leaves out. > + if ip -netns "$testns" link add dev "$DEV_NS" type erspan 2>&1 | \ > + grep -q "Unknown device type"; then > + end_test "SKIP: erspan: not supported by the kernel" > + ip netns del "$testns" > + return $ksft_skip > + fi > + ip -netns "$testns" link del dev "$DEV_NS" 2>/dev/null > + > # test native tunnel erspan v1 > run_cmd ip -netns "$testns" link add dev "$DEV_NS" type erspan seq \ > key 102 local 172.16.1.100 remote 172.16.1.200 \ > diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c > index c9b0b4337e12..07f2b454d755 100644 > --- a/tools/testing/selftests/net/tls.c > +++ b/tools/testing/selftests/net/tls.c > @@ -413,6 +413,8 @@ FIXTURE_SETUP(tls) > return; > > ret = setsockopt(self->fd, SOL_TLS, TLS_TX, &tls12, tls12.len); > + if (ret < 0 && errno == ENOENT) > + SKIP(return, "Cipher not built into the kernel"); Just a small question: ENOENT error is not in setsockopt man. It seems more like ENOPROTOOPT, but if the fix is here, it probably helped. Could you tell where ENOENT comes from? Maybe we should test for ENOPROTOOPT as well here? > ASSERT_EQ(ret, 0); > > ret = setsockopt(self->cfd, SOL_TLS, TLS_RX, &tls12, tls12.len); Reviewed-by: Vladimir Riabchun -- Vladimir Riabchun _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel