From patchwork Wed Sep 16 18:02:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1365636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BsJ3Z2cvbzB3wy for ; Thu, 17 Sep 2020 10:38:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 57A2D86E4E; Wed, 16 Sep 2020 18:03:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oprPFhWUGRq3; Wed, 16 Sep 2020 18:02:58 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 5059886B31; Wed, 16 Sep 2020 18:02:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43B4AC0864; Wed, 16 Sep 2020 18:02:58 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7E702C0864 for ; Wed, 16 Sep 2020 18:02:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6E5EB85829 for ; Wed, 16 Sep 2020 18:02:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ezqnNfZSK2vx for ; Wed, 16 Sep 2020 18:02:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by hemlock.osuosl.org (Postfix) with ESMTPS id 65A21857BB for ; Wed, 16 Sep 2020 18:02:55 +0000 (UTC) X-Originating-IP: 78.45.89.65 Received: from im-t490s.redhat.com (ip-78-45-89-65.net.upcbroadband.cz [78.45.89.65]) (Authenticated sender: i.maximets@ovn.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id B10A920008; Wed, 16 Sep 2020 18:02:51 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Wed, 16 Sep 2020 20:02:46 +0200 Message-Id: <20200916180246.2972179-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Cc: Ilya Maximets Subject: [ovs-dev] [PATCH] system-userspace-packet-type-aware.at: Wait for ip address updates. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" ovs-router module checks for the source ip address of the interface while adding a new route. netdev module doesn't request ip addresses from the system every time, but instead it caches currently assigned ip addresses and updates the cache on netlink notifications if needed. So, there is a slight delay between setting ip address on interface in a system and a moment OVS updates list of ip addresses of this interface. If route addition happens within this time frame, it fails with the following error: # ovs-appctl ovs/route/add 10.0.0.0/24 br-p1 Error while inserting route. ovs-appctl: ovs-vswitchd: server returned an error This makes system tests to fail frequently. Let's wait until local route successfully added. This will mean that OVS finished processing of a netlink event and will use up to date list of ip addresses on desired interface. Fixes: 526cf4e1d6a8 ("tests: Added unit tests in packet-type-aware.at") Signed-off-by: Ilya Maximets Acked-by: Aaron Conole Acked-by: Flavio Leitner --- tests/system-userspace-packet-type-aware.at | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/system-userspace-packet-type-aware.at b/tests/system-userspace-packet-type-aware.at index c2246316d..974304758 100644 --- a/tests/system-userspace-packet-type-aware.at +++ b/tests/system-userspace-packet-type-aware.at @@ -129,6 +129,7 @@ AT_CHECK([ ip addr add 10.0.0.1/24 dev br-p1 ip link set br-p1 up ], [0], [stdout]) +OVS_WAIT_UNTIL([ovs-appctl ovs/route/show | grep -q br-p1]) AT_CHECK([ ovs-appctl ovs/route/add 10.0.0.0/24 br-p1 @@ -141,6 +142,7 @@ AT_CHECK([ ip addr add 20.0.0.2/24 dev br-p2 ip link set br-p2 up ], [0], [stdout]) +OVS_WAIT_UNTIL([ovs-appctl ovs/route/show | grep -q br-p2]) AT_CHECK([ ovs-appctl ovs/route/add 20.0.0.0/24 br-p2 @@ -153,6 +155,7 @@ AT_CHECK([ ip addr add 30.0.0.3/24 dev br-p3 ip link set br-p3 up ], [0], [stdout]) +OVS_WAIT_UNTIL([ovs-appctl ovs/route/show | grep -q br-p3]) AT_CHECK([ ovs-appctl ovs/route/add 30.0.0.0/24 br-p3