From patchwork Thu Dec 15 04:33:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 9475467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 91F656047D for ; Thu, 15 Dec 2016 04:33:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D1662865F for ; Thu, 15 Dec 2016 04:33:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 717ED2867C; Thu, 15 Dec 2016 04:33:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B08028681 for ; Thu, 15 Dec 2016 04:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932109AbcLOEdY (ORCPT ); Wed, 14 Dec 2016 23:33:24 -0500 Received: from mgwkm01.jp.fujitsu.com ([202.219.69.168]:23570 "EHLO mgwkm01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754878AbcLOEdX (ORCPT ); Wed, 14 Dec 2016 23:33:23 -0500 Received: from kw-mxauth.gw.nic.fujitsu.com (unknown [192.168.231.132]) by mgwkm01.jp.fujitsu.com with smtp id 0409_517d_505ee854_825b_4496_b7f9_a82ef0a46f76; Thu, 15 Dec 2016 13:33:18 +0900 Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by kw-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id 5539FAC0160 for ; Thu, 15 Dec 2016 13:33:18 +0900 (JST) Received: from WIN-5MHF4RKU941.jp.fujitsu.com (unknown [10.124.102.163]) by m3050.s.css.fujitsu.com (Postfix) with SMTP id 23615472; Thu, 15 Dec 2016 13:33:18 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.3.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20150223 X-SHieldMailCheckerMailID: f07f8d8fc4374fd09b4462f55d81e8a4 Message-Id: <201612150433.AA00026@WIN-5MHF4RKU941.jp.fujitsu.com> From: Tsutomu Itoh Date: Thu, 15 Dec 2016 13:33:05 +0900 To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH v2] btrfs-progs: tests: add test for --sync option of qgroup show In-Reply-To: <201612080544.AA00023@WIN-5MHF4RKU941.jp.fujitsu.com> References: <201612080544.AA00023@WIN-5MHF4RKU941.jp.fujitsu.com> MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simple test script for the following patch. btrfs-progs: qgroup: add sync option to 'qgroup show' Signed-off-by: Tsutomu Itoh --- v2: dropped the test of --no-sync --- tests/cli-tests/005-qgroup-show-sync/test.sh | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tests/cli-tests/005-qgroup-show-sync/test.sh diff --git a/tests/cli-tests/005-qgroup-show-sync/test.sh b/tests/cli-tests/005-qgroup-show-sync/test.sh new file mode 100755 index 0000000..a325b48 --- /dev/null +++ b/tests/cli-tests/005-qgroup-show-sync/test.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# simple test of qgroup show --sync option + +source $TOP/tests/common + +check_prereq mkfs.btrfs +check_prereq btrfs + +setup_root_helper +prepare_test_dev 1g + +run_check $TOP/mkfs.btrfs -f $IMAGE +run_check_mount_test_dev + +run_check $SUDO_HELPER $TOP/btrfs subvolume create $TEST_MNT/Sub +run_check $SUDO_HELPER $TOP/btrfs quota enable $TEST_MNT/Sub + +for opt in '' '--' '--sync'; do + run_check $SUDO_HELPER $TOP/btrfs qgroup limit 300M $TEST_MNT/Sub + run_check $SUDU_HELPER dd if=/dev/zero of=$TEST_MNT/Sub/file bs=1M count=200 + + run_check $SUDO_HELPER $TOP/btrfs qgroup show -re $opt $TEST_MNT/Sub + + run_check $SUDO_HELPER $TOP/btrfs qgroup limit none $TEST_MNT/Sub + run_check rm -f $TEST_MNT/Sub/file + run_check $TOP/btrfs filesystem sync $TEST_MNT/Sub +done + +run_check_umount_test_dev