From patchwork Wed Dec 23 13:19:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arturo Borrero X-Patchwork-Id: 560544 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 961FE140BF0 for ; Thu, 24 Dec 2015 00:19:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755232AbbLWNTb (ORCPT ); Wed, 23 Dec 2015 08:19:31 -0500 Received: from smtp3.cica.es ([150.214.5.190]:43135 "EHLO smtp.cica.es" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752318AbbLWNTb (ORCPT ); Wed, 23 Dec 2015 08:19:31 -0500 Received: from localhost (unknown [127.0.0.1]) by smtp.cica.es (Postfix) with ESMTP id 596C151F1BD; Wed, 23 Dec 2015 13:19:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at cica.es Received: from smtp.cica.es ([127.0.0.1]) by localhost (mail.cica.es [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3oMKPWgrMU+A; Wed, 23 Dec 2015 14:19:23 +0100 (CET) Received: from r2d2.cica.es (r2d2.cica.es [IPv6:2a00:9ac0:c1ca:27::150]) by smtp.cica.es (Postfix) with ESMTP id DD83A51F1BB; Wed, 23 Dec 2015 14:19:22 +0100 (CET) Subject: [nft PATCH] tests/shell: add tests for handles and comments From: Arturo Borrero Gonzalez To: netfilter-devel@vger.kernel.org Cc: pablo@netfilter.org Date: Wed, 23 Dec 2015 14:19:22 +0100 Message-ID: <145087676257.18415.12296398243898533136.stgit@r2d2.cica.es> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Here some tests for optional things like rule handles and comments. Signed-off-by: Arturo Borrero Gonzalez --- tests/shell/testcases/optionals/comments_0 | 8 ++++++++ tests/shell/testcases/optionals/comments_handles_0 | 10 ++++++++++ tests/shell/testcases/optionals/handles_0 | 8 ++++++++ tests/shell/testcases/optionals/handles_1 | 8 ++++++++ 4 files changed, 34 insertions(+) create mode 100755 tests/shell/testcases/optionals/comments_0 create mode 100755 tests/shell/testcases/optionals/comments_handles_0 create mode 100755 tests/shell/testcases/optionals/handles_0 create mode 100755 tests/shell/testcases/optionals/handles_1 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tests/shell/testcases/optionals/comments_0 b/tests/shell/testcases/optionals/comments_0 new file mode 100755 index 0000000..29b8506 --- /dev/null +++ b/tests/shell/testcases/optionals/comments_0 @@ -0,0 +1,8 @@ +#!/bin/bash + +# comments are shown + +$NFT add table test +$NFT add chain test test +$NFT add rule test test tcp dport 22 counter accept comment test_comment +$NFT list table test -a | grep 'accept comment \"test_comment\"' >/dev/null diff --git a/tests/shell/testcases/optionals/comments_handles_0 b/tests/shell/testcases/optionals/comments_handles_0 new file mode 100755 index 0000000..30539bf --- /dev/null +++ b/tests/shell/testcases/optionals/comments_handles_0 @@ -0,0 +1,10 @@ +#!/bin/bash + +# handles and comments mix well + +$NFT add table test +$NFT add chain test test +$NFT add rule test test tcp dport 22 counter accept comment test_comment +set -e +$NFT list table test -a | grep 'accept comment \"test_comment\" # handle '[[:digit:]]$ >/dev/null +$NFT list table test | grep 'accept comment \"test_comment\"' | grep -v '# handle '[[:digit:]]$ >/dev/null diff --git a/tests/shell/testcases/optionals/handles_0 b/tests/shell/testcases/optionals/handles_0 new file mode 100755 index 0000000..7c6a437 --- /dev/null +++ b/tests/shell/testcases/optionals/handles_0 @@ -0,0 +1,8 @@ +#!/bin/bash + +# handles are shown last + +$NFT add table test +$NFT add chain test test +$NFT add rule test test tcp dport 22 counter accept +$NFT list table test -a | grep 'accept # handle '[[:digit:]]$ >/dev/null diff --git a/tests/shell/testcases/optionals/handles_1 b/tests/shell/testcases/optionals/handles_1 new file mode 100755 index 0000000..a3ae1a7 --- /dev/null +++ b/tests/shell/testcases/optionals/handles_1 @@ -0,0 +1,8 @@ +#!/bin/bash + +# handles are not shown if not asked for them + +$NFT add table test +$NFT add chain test test +$NFT add rule test test tcp dport 22 counter accept +$NFT list table test | grep 'accept # handle '[[:digit:]]$ >/dev/null