From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding Date: Wed, 4 Jul 2018 23:39:51 +0300 Message-ID: <20180704203951.GA24525@splinter> References: <62ecbcf0c905dde3bfde51cd260e2f7c59e21028.1530512974.git.lucien.xin@gmail.com> <03b43b2dbda208510514082b2bd94643c3a6580c.1530512974.git.lucien.xin@gmail.com> <5e5f7edf-1313-cfef-9005-b05ec9051b25@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Ahern , network dev , davem , Davide Caratti To: Xin Long Return-path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43417 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbeGDUjz (ORCPT ); Wed, 4 Jul 2018 16:39:55 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jul 05, 2018 at 01:56:23AM +0800, Xin Long wrote: > On Wed, Jul 4, 2018 at 3:23 AM, David Ahern wrote: > > your commands are not a proper test. The test should succeed and fail > > based on the routing lookup, not iptables rules. > A proper test can be done easily with netns, as vrf can't isolate much. > I don't want to bother forwarding/ directory with netns, so I will probably > just drop this selftest, and let the feature patch go first. > > What do you think? You can add a tc rule on the ingress of h2 and make sure that in the first case ping succeeds and the tc rule wasn't hit. In the second case ping should also succeed, but the tc rule should be hit. This is similar to your original netns test. You can look at tc_flower.sh for reference and in particular at tc_check_packets().