From patchwork Wed Jul 5 12:02:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9826435 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 23976608B8 for ; Wed, 5 Jul 2017 12:02:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A85627F54 for ; Wed, 5 Jul 2017 12:02:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F2F7284B5; Wed, 5 Jul 2017 12:02:06 +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 B094028397 for ; Wed, 5 Jul 2017 12:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbdGEMCE (ORCPT ); Wed, 5 Jul 2017 08:02:04 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33961 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbdGEMB4 (ORCPT ); Wed, 5 Jul 2017 08:01:56 -0400 Received: by mail-wm0-f68.google.com with SMTP id p204so32065855wmg.1; Wed, 05 Jul 2017 05:01:55 -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=W018+/MVX4kRri9tFnpU8QUlVQruBxOSdVjQCtrayyLxEdzHrLufn7RvuxA+CT+a6a i1kHMkjxn9iND2+OxRqA8+ncVriHbBYgnZEMa1nadFfhNrbgpJW6ek2Tt+vjpj2BDYRq OeTcly81ufv4AVYdYz0vCGU2Sz/Bd1K7vGKU30AAOKoj3G/7jWtLj8CBsPMZFHmC9o9k EXdzSiOWC0mj7ClfuENOuaTVL5c5HGC7mOcgqMHPZCRjjvd28+o62YS4xJNXupRopw6e Nv24S62qqEg/mtZvpk6Awog664UNwuk1fprYeYco7skryFexfplm7qlWi86yzA3lN1Ct 6Afg== 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=Tr2thfyHtsdwxSf7NiK1bXaEUZqbnK+h33zvMB42Cu1HWo5gWwAa9FKn8JZKdqyO1j iMhvs0ccPgQEPjb8IU69GA/Ivjb8NfHhd0tRiTtZw8rQ+2R3Sfl3HKcMobalL4vXrkcl LoeBL9skRwgqgMYEFMteYI2NYrtqZZCslurzUgH13EiQnzL8LPzeqKvcUoPa89jFts9k kgS6fs4P7eclomQQnh63Snt0YkrCx/4Y1UEQ1gmVRzpBZOGuVABtYfWv0VX1LyIaZ5im i2pOCUmM3hKn9Cj9iFRxrnXUK/SvcYoxlxonD5DA90BlFBa9WXCBaAnOEIm0IrFrZ5Iy AwhQ== X-Gm-Message-State: AKS2vOwy9dlUOayxSShQjJ+RSOyK/9htBbCU7ODag/xrziU7H8kz+AhC Hmsgmn00iwI+dA== X-Received: by 10.28.113.214 with SMTP id d83mr33691926wmi.62.1499256109973; Wed, 05 Jul 2017 05:01:49 -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 143sm155578wmg.9.2017.07.05.05.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Jul 2017 05:01:49 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v3 2/7] overlay/018: print hardlink content to golden output Date: Wed, 5 Jul 2017 15:02:01 +0300 Message-Id: <1499256126-21866-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499256126-21866-1-git-send-email-amir73il@gmail.com> References: <1499256126-21866-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