From patchwork Tue Dec 16 07:00:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 422461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9F8C7140079 for ; Thu, 18 Dec 2014 13:56:33 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 21607280697; Thu, 18 Dec 2014 03:52:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DATE_IN_PAST_24_48, FREEMAIL_FROM,T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id DCDCD28BC14 for ; Thu, 18 Dec 2014 03:51:54 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -8.5 Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 18 Dec 2014 03:51:48 +0100 (CET) Received: by mail-pd0-f172.google.com with SMTP id y13so417208pdi.31 for ; Wed, 17 Dec 2014 18:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wTQrHMgDnpPHQDI1TdnMDqbWIW/Btnx49CyoMQP3qmc=; b=nHWl9CnippQYfXjnNaVKiRR1kZ9TK1qKuKW98KazM/15dkPEB7/dBsgTNwVI1FSERv HQqMnfPLS7V6FHlhG1QJ0VJkBfH19xJ++kqMbI/Xp4Yf96nmqQUNawj3cD+fJ4Y5D7S/ tz2IjxdL9QEYkhpKfv98mApzzheRGQDAl4yAx9PtWHH/U1Xo58N4EOs+xmiW4ODk+L2C YhOaaJvMOCdeKRhFmMf5EBjbjTxszkWdoF/gpCivRjbo59ca1mrkg/5OqKpZxbQjEkCr CRNxHuT4K6H4MLe7nEU1fGzcNqeixnpZmlUUxXT6Ihrk6qLb2rXXwHlIF0Cm82osifMp vphQ== X-Received: by 10.70.119.71 with SMTP id ks7mr51778833pdb.140.1418871218830; Wed, 17 Dec 2014 18:53:38 -0800 (PST) Received: from debian.lan ([103.29.140.56]) by mx.google.com with ESMTPSA id oy7sm5104495pbc.88.2014.12.17.18.53.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Dec 2014 18:53:37 -0800 (PST) From: Yousong Zhou To: nbd@openwrt.org Date: Tue, 16 Dec 2014 15:00:10 +0800 Message-Id: <1418713218-16300-9-git-send-email-yszhou4tech@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1418713218-16300-1-git-send-email-yszhou4tech@gmail.com> References: <1418713218-16300-1-git-send-email-yszhou4tech@gmail.com> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH v2 08/16] tests: add test coverage for `uci batch' command. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Yousong Zhou --- test/references/batch_set.result | 9 +++++++++ test/tests.d/060_batch | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/references/batch_set.result create mode 100644 test/tests.d/060_batch diff --git a/test/references/batch_set.result b/test/references/batch_set.result new file mode 100644 index 0000000..c726bad --- /dev/null +++ b/test/references/batch_set.result @@ -0,0 +1,9 @@ + +config section 'SEC0' + option option0 'value0' + option option1 '"Hello, + World"' + +config section 'SEC1' + option option0 'value1' + diff --git a/test/tests.d/060_batch b/test/tests.d/060_batch new file mode 100644 index 0000000..49d15e4 --- /dev/null +++ b/test/tests.d/060_batch @@ -0,0 +1,17 @@ +test_batch_set() +{ + touch ${CONFIG_DIR}/batch_set + + ${UCI} batch <