From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YeCh2be1; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id CD43F5A004C for ; Fri, 08 Nov 2024 10:33:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731058428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EWqvcGQyakLZZA9gKUeUM13ilzsu+H9W0eDKW2q0G9k=; b=YeCh2be1/zzsWRxlKjb5W7H1CwTz/diy3BmXHzfXmcrL1QTXO4HTlrf2hfBLX4GOKCNBag IaUy8uP3qAjACWwxGZOfpDthPIjK3u1wsDxKVegGY2PzGDTJSZVTA16Iw3dUZSSd4V/VoR IbSpJOVpP6IrA9WX5F5hDPwljKPzWU0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-282-AcYK2ki1MNuOh3IemDD1bg-1; Fri, 08 Nov 2024 04:33:47 -0500 X-MC-Unique: AcYK2ki1MNuOh3IemDD1bg-1 X-Mimecast-MFC-AGG-ID: AcYK2ki1MNuOh3IemDD1bg Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4316300bb15so12720275e9.2 for ; Fri, 08 Nov 2024 01:33:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731058424; x=1731663224; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EWqvcGQyakLZZA9gKUeUM13ilzsu+H9W0eDKW2q0G9k=; b=FZLtPXDloqXvTUu3ytcYq1kyClskCnnC/uYDZjvOaVFUVOMNvj6Lrche4A+H7HlB6g CHG8scz9a3sioziL5tQnGFc1UNORK0JAIAfCJuvtmT9MSiaIy3JKzk+H7R6j5WFuf4x/ DnlYYrCg7XkaLAdwwpkQxt9hxsnRNM49Fmx159Cd65ChJcYh1HqTxOo8+qPvfLJmEii/ jKJY6B+nnJiWOT53RKFLaKY0uQBBCeGEsVaRVgJtCuGg91y1rzOGAcEwEnMMO2djnHMh l17m/NAzAsA+y+yW9+k6PPyQBPgonGb02kh36xi1QTP/8ppX2D1+5w3Y8qVAPP/KC+jX k48A== X-Gm-Message-State: AOJu0YyBGtH3lI+YnL8aMfDw83Twd8NLSTvrR58jWiwVUBYZwIsTMJHZ acfLFx/dfCwrtIAxWIq1Sgc3lZnyDlLxbzlrR8WDhvRY3QXRME+/6s3wk2APXjfSIDWYkoNlxP/ 5QNHjXIchwLIV/zFqgMtbE2S6fzyZbP2RyYHfONS9+v0qIYKbiEkfWINc3Q== X-Received: by 2002:a05:600c:3b09:b0:431:3bf9:3ebb with SMTP id 5b1f17b1804b1-432b7518365mr15075975e9.24.1731058424584; Fri, 08 Nov 2024 01:33:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/RkEBtFodvgc0ZZZ+JK46W/w2oiOLsYDFp/3qGXqWGs5q3gLbrzc3ysVtsR7zQ6tv5rNLzA== X-Received: by 2002:a05:600c:3b09:b0:431:3bf9:3ebb with SMTP id 5b1f17b1804b1-432b7518365mr15075815e9.24.1731058424206; Fri, 08 Nov 2024 01:33:44 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa5b5b2dsm91592975e9.1.2024.11.08.01.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 01:33:43 -0800 (PST) Date: Fri, 8 Nov 2024 10:33:41 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 2/2] test: Improve test for NDP assigned prefix Message-ID: <20241108103341.62a4a4c4@elisabeth> In-Reply-To: <20241106014415.1765896-3-david@gibson.dropbear.id.au> References: <20241106014415.1765896-1-david@gibson.dropbear.id.au> <20241106014415.1765896-3-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -MzwHx3brfhS2qIqFHxaqlmhHPkplrAgZ2Sj2mZOQls_1731058425 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: AMTYJSALQCFK7MRGU646KD4ECMX5ZJNO X-Message-ID-Hash: AMTYJSALQCFK7MRGU646KD4ECMX5ZJNO X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 6 Nov 2024 12:44:15 +1100 David Gibson wrote: > In the NDP tests we search explicitly for a guest address with prefix > length 64. AFAICT this is an attempt to specifically find the SLAAC > assigned address, rather than something assigned by other means. We can do > that more explicitly by checking for .protocol == "kernel_ra". however. > > The SLAAC prefixes we assigned *will* always be 64-bit, that's hard-coded > into our NDP implementation. RFC4862 doesn't really allow anything else > since the interface identifiers for an Ethernet-like link are 64-bits. > > Let's actually verify that, rather than just assuming it, by extracting the > prefix length assigned in the guest and checking it as well. > > Signed-off-by: David Gibson > --- > test/passt/ndp | 4 ++-- > test/pasta/ndp | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/test/passt/ndp b/test/passt/ndp > index f54b8ce..56b385b 100644 > --- a/test/passt/ndp > +++ b/test/passt/ndp > @@ -23,8 +23,8 @@ hout HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").d > check [ -n "__IFNAME__" ] > > test SLAAC: prefix > -gout ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .prefixlen == 64).local] | .[0]' > -gout PREFIX6 sipcalc __ADDR6__/64 | grep prefix | cut -d' ' -f4 > +gout ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .protocol == "kernel_ra") | .local + "/" + (.prefixlen | tostring)] | .[0]' This makes tests occasionally fail for me. The pasta/ndp tests is not affected. __PREFIX6__ is empty because there are no addresses with protocol "kernel_ra" when we check. If I do: @@ -23,6 +23,7 @@ hout HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").d check [ -n "__IFNAME__" ] test SLAAC: prefix +sleep 2 gout ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .protocol == "kernel_ra") | .local + "/" + (.prefixlen | tostring)] | .[0]' gout PREFIX6 sipcalc __ADDR6__ | grep prefix | cut -d' ' -f4 hout HOST_ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__HOST_IFNAME6__").addr_info[] | select(.scope == "global" and .deprecated != true).local] | .[0]' things seem to work, but I didn't test many times, and looking at 47f0bd503210 ("net: Add new protocol attribute to IP addresses"), I don't see how that would help. -- Stefano