From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
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 [thread overview]
Message-ID: <1499168434-23859-3-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1499168434-23859-1-git-send-email-amir73il@gmail.com>
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 <amir73il@gmail.com>
---
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
--
2.7.4
next prev parent reply other threads:[~2017-07-04 11:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 11:40 [PATCH v2 0/7] overlay hardlink tests Amir Goldstein
2017-07-04 11:40 ` [PATCH v2 1/7] overlay/018: re-factor and add to hardlink group Amir Goldstein
2017-07-04 11:40 ` Amir Goldstein [this message]
2017-07-04 11:40 ` [PATCH v2 3/7] overlay/018: test broken hardlinks after mount cycle Amir Goldstein
2017-07-04 11:40 ` [PATCH v2 4/7] overlay/018: test lower hardlinks re-unite on copy up Amir Goldstein
2017-07-04 11:40 ` [PATCH v2 5/7] overlay: test concurrent copy up of lower hardlinks Amir Goldstein
2017-07-05 9:59 ` Eryu Guan
2017-07-05 10:46 ` Amir Goldstein
2017-07-05 11:32 ` Eryu Guan
2017-07-05 11:49 ` Amir Goldstein
2017-07-11 20:23 ` Amir Goldstein
2017-07-12 3:17 ` Eryu Guan
2017-07-12 6:11 ` Amir Goldstein
2017-07-04 11:40 ` [PATCH v2 6/7] overlay: test nlink accounting of overlay hardlinks Amir Goldstein
2017-07-04 11:40 ` [PATCH v2 7/7] overlay: test dropping nlink below zero Amir Goldstein
2017-07-05 10:09 ` Eryu Guan
2017-07-05 11:17 ` Amir Goldstein
2017-07-05 11:29 ` Eryu Guan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499168434-23859-3-git-send-email-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox