From patchwork Wed Feb 28 18:58:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 879306 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=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=netfilter.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zs4b73ZGQz9s15 for ; Thu, 1 Mar 2018 05:58:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932242AbeB1S60 (ORCPT ); Wed, 28 Feb 2018 13:58:26 -0500 Received: from mail.us.es ([193.147.175.20]:46570 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176AbeB1S6Z (ORCPT ); Wed, 28 Feb 2018 13:58:25 -0500 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 89B2050EA9 for ; Wed, 28 Feb 2018 19:58:24 +0100 (CET) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 77752DA788 for ; Wed, 28 Feb 2018 19:58:24 +0100 (CET) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 6CEA3DA786; Wed, 28 Feb 2018 19:58:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 94DC0DA789 for ; Wed, 28 Feb 2018 19:58:22 +0100 (CET) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Wed, 28 Feb 2018 19:58:22 +0100 (CET) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from salvia.here (sys.soleta.eu [212.170.55.40]) (Authenticated sender: pneira@us.es) by entrada.int (Postfix) with ESMTPA id 73A264265A2F for ; Wed, 28 Feb 2018 19:58:22 +0100 (CET) X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Subject: [PATCH nft] tests: shell: regression test for bugzilla 1228 Date: Wed, 28 Feb 2018 19:58:19 +0100 Message-Id: <20180228185819.22705-1-pablo@netfilter.org> X-Mailer: git-send-email 2.11.0 X-Virus-Scanned: ClamAV using ClamSMTP Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Add regression test for netfilter's bugzilla 1228. Signed-off-by: Pablo Neira Ayuso --- .../sets/0030add_many_elements_interval_0 | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tests/shell/testcases/sets/0030add_many_elements_interval_0 diff --git a/tests/shell/testcases/sets/0030add_many_elements_interval_0 b/tests/shell/testcases/sets/0030add_many_elements_interval_0 new file mode 100755 index 000000000000..b67aa6b0b0b6 --- /dev/null +++ b/tests/shell/testcases/sets/0030add_many_elements_interval_0 @@ -0,0 +1,30 @@ +#!/bin/bash + +HOWMANY=255 + +tmpfile=$(mktemp) +if [ ! -w $tmpfile ] ; then + echo "Failed to create tmp file" >&2 + exit 0 +fi + +trap "rm -rf $tmpfile" EXIT # cleanup if aborted + +generate() { + echo -n "{" + for ((i=1; i<=HOWMANY; i++)) ; do + for ((j=1; j<=HOWMANY; j++)) ; do + echo -n "10.${i}.${j}.0/24" + [ "$i" == "$HOWMANY" ] && [ "$j" == "$HOWMANY" ] && break + echo -n ", " + done + done + echo -n "}" +} + +echo "add table x +add set x y { type ipv4_addr; } +add element x y $(generate)" > $tmpfile + +set -e +$NFT -f $tmpfile