From: Andreas Gruenbacher <agruenba@redhat.com>
To: fstests@vger.kernel.org
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Subject: [PATCH] generic/004: Check resulting file permissions
Date: Wed, 19 Oct 2016 12:51:07 +0200 [thread overview]
Message-ID: <1476874267-16499-1-git-send-email-agruenba@redhat.com> (raw)
Check the file permissions resulting from linking an O_TMPFILE file into
the namespace: they should be the same as creating a normal file.
(Note that this patch depends on patch "xfs_io: Fix initial -m option"
for xfsprogs.)
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
tests/generic/004 | 14 +++++++++++++-
tests/generic/004.out | 8 ++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/tests/generic/004 b/tests/generic/004
index d0926f1..f9a7520 100755
--- a/tests/generic/004
+++ b/tests/generic/004
@@ -52,12 +52,24 @@ rm -f $seqres.full
testfile="${TEST_DIR}/tst-tmpfile-flink"
# test creating a r/w tmpfile, do I/O and link it into the namespace
-$XFS_IO_PROG -T \
+echo umask 022
+umask 022
+$XFS_IO_PROG -T -m 0666 \
-c "pwrite 0 4096" \
-c "pread 0 4096" \
-c "flink ${testfile}" \
${TEST_DIR} | _filter_xfs_io
+stat -c '%a' ${testfile}
+rm ${testfile}
+echo umask 027
+umask 027
+$XFS_IO_PROG -T -m 0666 \
+ -c "pwrite 0 4096" \
+ -c "pread 0 4096" \
+ -c "flink ${testfile}" \
+ ${TEST_DIR} | _filter_xfs_io
+stat -c '%a' ${testfile}
rm ${testfile}
# test creating a r/o tmpfile. Should fail
diff --git a/tests/generic/004.out b/tests/generic/004.out
index 527b2c2..11f44e7 100644
--- a/tests/generic/004.out
+++ b/tests/generic/004.out
@@ -1,6 +1,14 @@
QA output created by 004
+umask 022
wrote 4096/4096 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 4096/4096 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+644
+umask 027
+wrote 4096/4096 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 4096/4096 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+640
TEST_DIR: Invalid argument
--
2.7.4
next reply other threads:[~2016-10-19 14:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 10:51 Andreas Gruenbacher [this message]
2016-10-20 16:56 ` [PATCH] generic/004: Check resulting file permissions 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=1476874267-16499-1-git-send-email-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=fstests@vger.kernel.org \
/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