From patchwork Tue Jul 4 11:40:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9824645 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 7209260237 for ; Tue, 4 Jul 2017 11:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64C192811E for ; Tue, 4 Jul 2017 11:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 595D4283B4; Tue, 4 Jul 2017 11:40: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.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 0AE632811E for ; Tue, 4 Jul 2017 11:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179AbdGDLk1 (ORCPT ); Tue, 4 Jul 2017 07:40:27 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36077 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbdGDLk0 (ORCPT ); Tue, 4 Jul 2017 07:40:26 -0400 Received: by mail-wm0-f65.google.com with SMTP id y5so25682646wmh.3; Tue, 04 Jul 2017 04:40:25 -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=ACknCxRSB/RTcP1pKln3rAvD9ZiORBAWBeJ7NRQdkU9UHBCrh8TSHcsdddj45GYbzN qQJNw4LUtwFB9GH5fvHxRU82TpEJdugp3+6RZULlyGdXYhfei7E23CwDZ1l+50drdAiK qnHtLBOVgyBcvz73jRbaKE0I9BVzSa9WR3/HJ4g2GbAsGtkkIznVXd74fKulfucmuWN2 Lar8piVHMZURm58ie0lzF1/Ti/2yhGGjp8SmO47d88DPCKc6Gz2+GLLRufIki4eBeCJb 0/Gp0muFfRQzgsDqrVLS+fGqFuBhfpsQwyBtLuVFzjrVzRj6LgOp5s4rbvFoBWkMDgmQ 0P7w== 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=IZC4BRW8apw9CCyLPlw8Zyauq2Kb+N0R6NISL+fBvmEaDZDhAwbG/COC5OeeYg7vX5 2XNRKYI4HokuAIogHS7StZ7NJ2tt5vtcGYWOBKGyGBhAd77C+XQo01J0NayXVgo99KAW r8FlcDFFDpMl+bDMsk0A6ZyWLzv3I5JDhkHa03uoAWu9KRYJHsrDHzciAHgtRYBWmnpr mT2LjRpJCov99LpRBztHa9FHXQA9RDkSvZXS4nN+pLmwXWHAu6Bg7lARIJADwqFXCR9G US8l1gRWZsgzCCgdbc/CZgl/ZEdEngM15UyNZinHn5i0O/5k3sYkdI7leAg+iI3ETxww nCqQ== X-Gm-Message-State: AIVw110H5MEs0E4d568sl4TUTjVXRfEHI3wiSL9EClhohEqnaJm9cPEQ CixZfRfIbjOYJyKR X-Received: by 10.28.214.213 with SMTP id n204mr2432807wmg.114.1499168420122; Tue, 04 Jul 2017 04:40: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 90sm18842912wrk.38.2017.07.04.04.40.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:40:19 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 2/7] overlay/018: print hardlink content to golden output Date: Tue, 4 Jul 2017 14:40:29 +0300 Message-Id: <1499168434-23859-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168434-23859-1-git-send-email-amir73il@gmail.com> References: <1499168434-23859-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