From patchwork Tue Dec 5 17:23:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Varma X-Patchwork-Id: 844950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BGBzlGqT"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yrxFH6170z9s4q for ; Wed, 6 Dec 2017 09:27:14 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2A6F9BDB; Tue, 5 Dec 2017 22:27:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 27412BBC for ; Tue, 5 Dec 2017 22:27:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B6726403 for ; Tue, 5 Dec 2017 22:27:09 +0000 (UTC) Received: by mail-pf0-f173.google.com with SMTP id c204so1218064pfc.13 for ; Tue, 05 Dec 2017 14:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=z8wjNx2sDxWss0R6yIxTBBi0sB3WKcH7WazJ6TQkaM4=; b=BGBzlGqTc0qWpiSvb+xsMPprnij7eDHej+bmZoRN6JaeFULPmdditcTSeol2ANJHLm F/YsPDaNRZel+VaT5dNi1lcOsJV23vmMeSYj7CdoBBTiq7znxkX/xl9JaLiPADiwM89K WfFr5Q1ywbd9jNRDp9+5TyWoUfkaRS2I3eFzisRDkTEF9VZYps8mnH6DItvOFuhwqPiV eY25Mlv8XzbEI8YFpcKIXKADsescTc/ebzG+WSkgGS/H6iiys3He9JTxthMbP/aNK2tC 9I23S/8P63KsrAYVJHwxJN2SS52Qhxs9Fi5NF6l0ZHyhMQbMj4uXw7D4/xJuowHOHbnH 3igw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=z8wjNx2sDxWss0R6yIxTBBi0sB3WKcH7WazJ6TQkaM4=; b=QLGJYKrzeFkzl7FMil2HQA1E9w6eBg2S9ICmjVvf2o/2XN0tea5UopAs3skSt8CXgB vvUeXMypXrZJa7CZmz3XaSRlKQzZZCoJz8xFX3gkHF3teABveFHOuzC4W4RWViChyHdK FJMFoLpej+XOJlkmvYDhe7TUjOZzsm0K6KdSHkClP/fnYgLI8y86lbDuErOxLxRtALH7 f4CcCfwekH7lq73IAJUkUsWWutsj4XQ4e5LWfmwuPoi7vUmmT7EU+8uiSu1dsTTUhczf rqmjORwtDloRegruz5I0EajpnSP6vjdxH0o9USwHGBbY60q/JdMj1GZlsNeGoSFZTUUN a+bA== X-Gm-Message-State: AKGB3mIRu/eCvGHASrw4H4K8Foll93QXzLLBKNZ7s0HXvyHlONKAX49q oa77E3arVZIc98H7+6NQGMggeA== X-Google-Smtp-Source: AGs4zMYjUX/oFnw6nXClEz35hbRZLJLiZtfOWIyTBxY3mRZrBuWFlBxDSI+B6lTRRefW29wl4kckJg== X-Received: by 10.98.139.138 with SMTP id e10mr37472pfl.231.1512512828903; Tue, 05 Dec 2017 14:27:08 -0800 (PST) Received: from ashish-Ubuntu-WorkStation.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id c191sm2115793pfg.24.2017.12.05.14.27.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Dec 2017 14:27:07 -0800 (PST) From: Ashish Varma To: dev@openvswitch.org Date: Tue, 5 Dec 2017 09:23:03 -0800 Message-Id: <1512494583-29613-1-git-send-email-ashishvarma.ovs@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] tests: add-del-add sequence for interface X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org added a unit test case for testing the condition when a tap interface is added to br0 and then the tap interface is deleted from the system and added back with the same name. Signed-off-by: Ashish Varma --- tests/automake.mk | 3 ++- tests/system-interface.at | 22 ++++++++++++++++++++++ tests/system-kmod-testsuite.at | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/system-interface.at diff --git a/tests/automake.mk b/tests/automake.mk index 7eed106..8c5f1b9 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -118,7 +118,8 @@ SYSTEM_TESTSUITE_AT = \ tests/system-common-macros.at \ tests/system-ovn.at \ tests/system-layer3-tunnels.at \ - tests/system-traffic.at + tests/system-traffic.at \ + tests/system-interface.at SYSTEM_OFFLOADS_TESTSUITE_AT = \ tests/system-common-macros.at \ diff --git a/tests/system-interface.at b/tests/system-interface.at new file mode 100644 index 0000000..a71e2aa --- /dev/null +++ b/tests/system-interface.at @@ -0,0 +1,22 @@ +AT_BANNER([system-inteface]) + +dnl add a tap interface to br0, then delete and re-create +dnl the tap interface with the same name in the system +AT_SETUP([interface - add delete add same interface]) + +OVS_TRAFFIC_VSWITCHD_START() + +AT_CHECK([ip tuntap add dev ovs-tap0 mode tap]) +on_exit 'ip tuntap del dev ovs-tap0 mode tap' + +AT_CHECK([ovs-vsctl add-port br0 ovs-tap0]) + +AT_CHECK([ip tuntap del dev ovs-tap0 mode tap]) +AT_CHECK([ip tuntap add dev ovs-tap0 mode tap]) + +AT_CHECK([ovs-vsctl del-port br0 ovs-tap0]) + +OVS_TRAFFIC_VSWITCHD_STOP(["/could not open network device ovs-tap0/d"]) + +AT_CLEANUP + diff --git a/tests/system-kmod-testsuite.at b/tests/system-kmod-testsuite.at index 975b200..bda314a 100644 --- a/tests/system-kmod-testsuite.at +++ b/tests/system-kmod-testsuite.at @@ -25,3 +25,4 @@ m4_include([tests/system-kmod-macros.at]) m4_include([tests/system-traffic.at]) m4_include([tests/system-layer3-tunnels.at]) m4_include([tests/system-ovn.at]) +m4_include([tests/system-interface.at])