From patchwork Sun May 24 12:59:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Brivio X-Patchwork-Id: 1296845 X-Patchwork-Delegate: pablo@netfilter.org 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=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KX//J4Uw; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49VL141k5Zz9sSf for ; Sun, 24 May 2020 23:00:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728807AbgEXNAG (ORCPT ); Sun, 24 May 2020 09:00:06 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:25250 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725873AbgEXNAG (ORCPT ); Sun, 24 May 2020 09:00:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590325204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=amIRaCQJsifw59sAdCoNsH1Xquev8M0L1J8U8PCCSkU=; b=KX//J4UwAfpJsfF4+Evr/Qk56w3H0MTAmRIvmpQcBtlHNFtHkBOwaVeXGo2HpUYXG+MP+X 59ybKQC7BASBNL0W8QayHlaMkIygu9XOlRHlR1EdfVy5agsztvqwP2IsnPfFj5rDanIYRl 9ob3SWAf+MQRDu3OSaxh8FzYwqIduvU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-55-LLkR7up6Nl2lskQjUC3OgA-1; Sun, 24 May 2020 09:00:02 -0400 X-MC-Unique: LLkR7up6Nl2lskQjUC3OgA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E15FB1800D42; Sun, 24 May 2020 13:00:00 +0000 (UTC) Received: from epycfail.redhat.com (unknown [10.36.110.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id C679E5C1B2; Sun, 24 May 2020 12:59:59 +0000 (UTC) From: Stefano Brivio To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [PATCH nft] tests: shell: Avoid breaking basic connectivity when run Date: Sun, 24 May 2020 14:59:57 +0200 Message-Id: <9742365b595a791d4bd47abee6ad6271abe0950b.1590323912.git.sbrivio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org It might be convenient to run tests from a development branch that resides on another host, and if we break connectivity on the test host as tests are executed, we con't run them this way. To preserve connectivity, for shell tests, we can simply use the 'forward' hook instead of 'input' in chains/0036_policy_variable_0 and transactions/0011_chain_0, without affecting test coverage. For py tests, this is more complicated as some test cases install chains for all the available hooks, and we would probably need a more refined approach to avoid dropping relevant traffic, so I'm not covering that right now. Signed-off-by: Stefano Brivio --- tests/shell/testcases/chains/0036policy_variable_0 | 2 +- tests/shell/testcases/transactions/0011chain_0 | 2 +- tests/shell/testcases/transactions/dumps/0011chain_0.nft | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/shell/testcases/chains/0036policy_variable_0 b/tests/shell/testcases/chains/0036policy_variable_0 index d4d98ede0d8d..e9246dd9e974 100755 --- a/tests/shell/testcases/chains/0036policy_variable_0 +++ b/tests/shell/testcases/chains/0036policy_variable_0 @@ -9,7 +9,7 @@ define default_policy = \"drop\" table inet global { chain prerouting { - type filter hook prerouting priority filter + type filter hook forward priority filter policy \$default_policy } }" diff --git a/tests/shell/testcases/transactions/0011chain_0 b/tests/shell/testcases/transactions/0011chain_0 index 3bed16dddf40..bdfa14975180 100755 --- a/tests/shell/testcases/transactions/0011chain_0 +++ b/tests/shell/testcases/transactions/0011chain_0 @@ -5,7 +5,7 @@ set -e RULESET="add table x add chain x y delete chain x y -add chain x y { type filter hook input priority 0; } +add chain x y { type filter hook forward priority 0; } add chain x y { policy drop; }" $NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/transactions/dumps/0011chain_0.nft b/tests/shell/testcases/transactions/dumps/0011chain_0.nft index df88ad47c5d9..a12726069efc 100644 --- a/tests/shell/testcases/transactions/dumps/0011chain_0.nft +++ b/tests/shell/testcases/transactions/dumps/0011chain_0.nft @@ -1,5 +1,5 @@ table ip x { chain y { - type filter hook input priority filter; policy drop; + type filter hook forward priority filter; policy drop; } }