From patchwork Wed Nov 9 04:44:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 9418493 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 839116022E for ; Wed, 9 Nov 2016 04:44:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6962429103 for ; Wed, 9 Nov 2016 04:44:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C84B29108; Wed, 9 Nov 2016 04:44:44 +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 5241B29103 for ; Wed, 9 Nov 2016 04:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbcKIEok (ORCPT ); Tue, 8 Nov 2016 23:44:40 -0500 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:29702 "EHLO mgwym04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbcKIEoh (ORCPT ); Tue, 8 Nov 2016 23:44:37 -0500 Received: from yt-mxauth.gw.nic.fujitsu.com (unknown [192.168.229.68]) by mgwym04.jp.fujitsu.com with smtp id 64e5_b64c_2a4ca6b3_de33_4ae0_8383_f29fe132ece7; Wed, 09 Nov 2016 13:44:31 +0900 Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by yt-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id 8CD70AC0187 for ; Wed, 9 Nov 2016 13:44:31 +0900 (JST) Received: from WIN-5MHF4RKU941.jp.fujitsu.com (unknown [10.124.102.163]) by m3051.s.css.fujitsu.com (Postfix) with SMTP id 7851A352; Wed, 9 Nov 2016 13:44:31 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.3.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20150223 X-SHieldMailCheckerMailID: 8569ae3ad35c4349a76143b29275239e Message-Id: <201611090444.AA00014@WIN-5MHF4RKU941.jp.fujitsu.com> From: Tsutomu Itoh Date: Wed, 09 Nov 2016 13:44:15 +0900 To: dsterba@suse.cz, quwenruo@cn.fujitsu.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH v3] btrfs-progs: send-test: add checking of clone-src option In-Reply-To: <201611040835.AA00012@WIN-5MHF4RKU941.jp.fujitsu.com> References: <201611040835.AA00012@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 Sending stream size of clone-src(-c) option is checked. Fixed by "btrfs-progs: send: fix handling of -c option". Signed-off-by: Tsutomu Itoh --- V2: old sending stream image is used V3: image file has been compressed by gzip --- .../016-send-clone-src/send-stream-v4.8.2.img.gz | Bin 0 -> 11826 bytes tests/misc-tests/016-send-clone-src/test.sh | 50 +++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tests/misc-tests/016-send-clone-src/send-stream-v4.8.2.img.gz create mode 100755 tests/misc-tests/016-send-clone-src/test.sh diff --git a/tests/misc-tests/016-send-clone-src/send-stream-v4.8.2.img.gz b/tests/misc-tests/016-send-clone-src/send-stream-v4.8.2.img.gz new file mode 100644 index 0000000000000000000000000000000000000000..f49c5cba1a8307f99732530ab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Z zPN75Q)L;H&aS3t-c0IlWQ=h1)G=hr2x|9=^)>!P+6|nm<5y3k|7E?O~KkQQuq`~LN z5moOiQH-3ia#RFS4d(c$-sI+W7_{~H6P;pU5TBr_q4mW@Oz{cScEHlxmszzI(~hf< z$czQPsoB~{0&Rqgli_LLShj_G%Dq7Z$;p45Z;?x9Y+U-datuvVrzQ@R{L7=<#nT%^VLko6-V7X zlXm-iN8Rjm)J#RccFJ-<0~~7aTMx|GqF*gx6n%u ziO>D=k7a)|kqdva5OWpAs&IH!7-VIDE$+8MB-zAZteqEC#@T6|2YqO`abg+4PF|C0 z?ChxkrXTLIr#B!aA>q>*v+6MtE)z3=kDR#=0gk)hSfvzD%qe!n)449I=#;!3>?oLUeftDFsH}ffL1713$Y<;m?m}iyR zeGR0Arf)_%x@4O!j05iLqJE_OQR7^Vopt}Vna>IU!a2v~SvOkEsRgBTB*rXtUt$3q zYXiM_hQipk9#7iQ!E#n=ft}$xwlNRdQDb`zq@E*-PAFUE-VIPgVPP>eQVi^KZar^3 zf){wsi}$)diRRGDwP%ntB}Dq~8&ond4{IiQFK)ap{HQ%w19o1q^b5!`p7-~$x0WDZ v+xNTfI}y?Hq}T-WM6U2`>EqKmgxVZznz$ "$here"/old-send-stream.img +old_stream_size=`stat --format=%s "$here"/old-send-stream.img` +stream_size=`stat --format=%s "$here"/send-stream.img` + +if [ $old_stream_size -lt $stream_size ]; then + run_check ls -l "$here"/old-send-stream.img "$here"/send-stream.img + _fail "sending stream size is bigger than old stream" +fi + +run_check rm -f "$here"/old-send-stream.img "$here"/send-stream.img + +cd "$here" || _fail "cannot chdir back to test directory" + +run_check_umount_test_dev +