From patchwork Wed Aug 1 19:20:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Varma X-Patchwork-Id: 952359 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; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RodwlBG6"; 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 41gjq62Pcwz9s3Z for ; Thu, 2 Aug 2018 05:21:53 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B5344CE3; Wed, 1 Aug 2018 19:21:50 +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 0B4D4CE0 for ; Wed, 1 Aug 2018 19:21:49 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CB38B7F2 for ; Wed, 1 Aug 2018 19:21:47 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id p23-v6so11276470pgv.13 for ; Wed, 01 Aug 2018 12:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=noD5aUmj7DDBu1/bIk2GScS5ElWthcx9nzmGfcirlSY=; b=RodwlBG6L/ZiIvBqfvAzzzUza2JcyGEzZSUi0dHPoiZP+ib7eqeTn5TieKtBsYMBNC 4R1uINgR9qWNN2EbXCsw9hDsQb6GdBpxx/r3k5OZOblRLSBYNe/VjUKy6ktUKC8D+haf P/VodYflE0sMmlqbvF0wWppDWI+60261usX1c+Jb+Mbk13RIKWeQNYnwmkMhasHpsgwy JlQkjLs8Su7n5iguUbxdFP5rbWdHwQRqDK/Qk3qAooBybdfiHF9ij1VvV36RWeiezAq0 9Qr/M6c21wE1QnAyEIT11em5fsen/4XFlAN27YDYEYtiJxN0eajzafekfnZeMqXznFPk MHPA== 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=noD5aUmj7DDBu1/bIk2GScS5ElWthcx9nzmGfcirlSY=; b=O/Lg2kqPqgdQfWzOljtec++JNFV4Ix0b03rSMrz2Ws9PLlUNWcduf8ObqCAe24IoSb smgbrDNIFF8uUY1rdLnQRsBc18HqD5GvGlJ0yXYVKEexfzDBTKkgaIkDIuV5SSA52M4N BLaZJRu3kdcGLiGhQnr38INKjjw99MkRARBAPUTlxP3tCWZffYnVRVDNiJMmnWY2iW3R 3Ax1IVMCZfmQ11sodGz/LpDjwdz85fkYplG/KmT7iTFo2j0SS+WhUdjNTMuBVunByEDP yYZKjbn4U9vEFR5jkpyU+Ki/dBd2luiQpvMPDvUtRN6PFdcA4tVM663WXGsVQYB0QQe+ 8CGQ== X-Gm-Message-State: AOUpUlHs64UBrmv1Uw+8dw1d6AiiQaG0bLdK04rvoSVdh6mKqPYrm+Bp wwpK6EWlNrirFWzMhxPB+n8cOLgH X-Google-Smtp-Source: AAOMgpf8hg4h/TkmMHm01+yMCVDw+apoQsebMXvBx3epCQ2sdbJP/j/VVzrJChDSJ3zydBbm2BD1tw== X-Received: by 2002:a63:90c8:: with SMTP id a191-v6mr25890221pge.173.1533151307285; Wed, 01 Aug 2018 12:21:47 -0700 (PDT) Received: from ashish-Ubuntu-WorkStation.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id s73-v6sm30623704pfi.154.2018.08.01.12.21.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Aug 2018 12:21:46 -0700 (PDT) From: Ashish Varma To: dev@openvswitch.org Date: Wed, 1 Aug 2018 12:20:12 -0700 Message-Id: <1533151212-27932-1-git-send-email-ashishvarma.ovs@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham 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: Test for ovs-ofctl snoop command 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 test for snoop command to check for the initial handshake messages when a bridge connects to a controller via 'unix' connection method. Signed-off-by: Ashish Varma --- tests/ovs-ofctl.at | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 06597d7..794277b 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -3184,3 +3184,31 @@ AT_CHECK([grep -q "ct_dpif|DBG|.*ct_flush: zone 123" ovs-vswitchd.log]) OVS_VSWITCHD_STOP AT_CLEANUP + + +AT_SETUP([ovs-ofctl snoop-unix-connection]) +OVS_VSWITCHD_START + +dnl setup controller for br0 before starting the controller +AT_CHECK([ovs-vsctl set-controller br0 unix:testcontroller]) + +dnl then start listening on the '.snoop' connection +AT_CHECK([ovs-ofctl --detach --pidfile=ovsofctl_snoop.pid snoop br0 1> snoopbr0.txt 2>&1]) +on_exit 'kill `cat ovsofctl_snoop.pid`' +on_exit 'unlink snoopbr0.txt' + +dnl finally start the controller +AT_CHECK([ovs-testcontroller --detach --pidfile punix:testcontroller], [0], [ignore]) +on_exit 'kill `cat ovs-testcontroller.pid`' +OVS_WAIT_UNTIL([test -e testcontroller]) + +dnl wait for 2 seconds for snoop to collect the messages from the bridge +sleep 2 + +dnl check some of the initial openflow setup messages +AT_CHECK([egrep "OFPT_FEATURES_REQUEST" snoopbr0.txt 1> /dev/null 2>&1]) +AT_CHECK([egrep "OFPT_FEATURES_REPLY" snoopbr0.txt 1> /dev/null 2>&1]) +AT_CHECK([egrep "OFPT_SET_CONFIG" snoopbr0.txt 1> /dev/null 2>&1]) + +OVS_VSWITCHD_STOP(["/connection failed (No such file or directory)/d"]) +AT_CLEANUP