From patchwork Tue Jul 4 11:20:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9824601 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 4C102602F0 for ; Tue, 4 Jul 2017 11:20:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CFB02844E for ; Tue, 4 Jul 2017 11:20:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E6DE2845D; Tue, 4 Jul 2017 11:20:29 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 D3FC628478 for ; Tue, 4 Jul 2017 11:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326AbdGDLU2 (ORCPT ); Tue, 4 Jul 2017 07:20:28 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:33700 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752313AbdGDLU1 (ORCPT ); Tue, 4 Jul 2017 07:20:27 -0400 Received: by mail-wr0-f193.google.com with SMTP id x23so47065732wrb.0; Tue, 04 Jul 2017 04:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6/NgXZIFhaDvPprnIAK10ROaMUBJ3ShYjQuXUL3P8Ek=; b=SsoaPIAwcifSc19C2rCzY3DpVkvC0gj/AkZL1R1hu/WzhGjbRbJF2e4vEtkqvU/GmS 28NHayVB/W9gmB8wv5+rkWprsu+fk+gKkcFkrCZgfux9f/bvXNJEr465xuGK/QoH+l3D ovUAKGeE2dhntVdFF0/Z7X1V++eIRgmcH+FYKhMIfw9F3w9UBfWsPfmT9qirlNxZpzZi suSsdmHfBICqMV5BTy5aYgLXsb4l+8ZHa3YWDpWLAFPfQO/KrSpRynjCLj/9nbkvOUCt YMlrHqpS4GH0xS9Zl/ZSISS70+LEcJt4KuNfVadEs02VJU0nizuO1C8Llcps42HnwuTi 7brw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6/NgXZIFhaDvPprnIAK10ROaMUBJ3ShYjQuXUL3P8Ek=; b=Aj+o3ZrI1RhHmt/qBB86RVDlnmPGzqBwfRdg8Niv5Cjvi+2R2GkGi4a770EZWBogoi f6J6NRgbED22yi75dHie5lmLn2CQWTsEheDMbTo191Ak1XO0Tr9APMob4nEgMe3fYtUi 8nd3R4Kw+u9jRmducaM9owGXDpH2NMPiL3iavCI2n8Hq9dY8j+e2VLrWgpZCYexQw1j7 Pq4CHlTzoybIhchB23gdlcIid4GDZ/EU0fiYA/8s4X1eJZqFMttcB2siiAFlOMNA6IHa fTeCyQ0oAwedtuyEnS+muGUmsXF/3JEqOcRGdsro3/eQZDsIWO9PT/e7X8nrcAGpe4FT uX0A== X-Gm-Message-State: AKS2vOzVRsr/MlcgQy7Fh7h0bIhH87Dc26XVaYi6XTFZhk4PFwtOuC7e zvR7fvw/Pn9D5w== X-Received: by 10.223.160.111 with SMTP id l44mr35842264wrl.31.1499167220638; Tue, 04 Jul 2017 04:20:20 -0700 (PDT) Received: from amir-VirtualBox.ctera.local (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id l20sm14121449wre.25.2017.07.04.04.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:20:20 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 2/6] overlay/018: print hardlink content to golden output Date: Tue, 4 Jul 2017 14:20:30 +0300 Message-Id: <1499167234-22779-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499167234-22779-1-git-send-email-amir73il@gmail.com> References: <1499167234-22779-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP diff may skips comparing content of files with identical st_ino/st_dev. Overlayfs stat(2) may return same st_dev/st_ino for hardlink copy ups, but it does not mean that read(2) will return the same content. Convert the test to output hardlink files content to golden output instead of using diff. Signed-off-by: Amir Goldstein --- tests/overlay/018 | 12 ++++++------ tests/overlay/018.out | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/overlay/018 b/tests/overlay/018 index 527b9d1..7570a16 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -57,7 +57,7 @@ _scratch_mkfs >>$seqres.full 2>&1 # Create 2 hardlinked files in lower lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER mkdir -p $lowerdir -echo "patient zero" >> $lowerdir/foo +echo "zero" >> $lowerdir/foo ln $lowerdir/foo $lowerdir/bar @@ -91,16 +91,16 @@ bar=$SCRATCH_MNT/bar FILES="$foo $bar" +echo "== Before copy up ==" +cat $FILES record_ino_nlink $tmp.before # Modify content of one of the hardlinks -echo "mutated" >> $foo +echo "one" >> $foo +echo "== After write one ==" +cat $FILES check_ino_nlink $tmp.before $tmp.after -# Compare content of files - expect silence -diff $foo $bar - -echo "Silence is golden" status=0 exit diff --git a/tests/overlay/018.out b/tests/overlay/018.out index 8849e30..784e8bc 100644 --- a/tests/overlay/018.out +++ b/tests/overlay/018.out @@ -1,2 +1,9 @@ QA output created by 018 -Silence is golden +== Before copy up == +zero +zero +== After write one == +zero +one +zero +one