All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfstests generic/306 fixes
Date: Fri, 26 Apr 2013 14:28:34 -0500	[thread overview]
Message-ID: <517AD562.3060208@redhat.com> (raw)

older xfs_io refused to write to /dev/null because it's
not a file on an xfs filesystem.  So add -F.

While we're at it, add another testcase, symlink
on a RO device pointing to a file on a RW device.
That should pass too (and burned me as well).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/generic/306 b/tests/generic/306
index 35fb5ef..b990e38 100755
--- a/tests/generic/306
+++ b/tests/generic/306
@@ -49,6 +49,8 @@ _require_scratch
 
 DEVNULL=$SCRATCH_MNT/devnull
 DEVZERO=$SCRATCH_MNT/devzero
+SYMLINK=$SCRATCH_MNT/symlink
+TARGET=$TEST_DIR/target
 
 rm -f $seqres.full
 _scratch_mkfs > $seqres.full 2>&1
@@ -58,6 +60,8 @@ rm -f $DEVNULL $DEVZERO
 
 mknod $DEVNULL c 1 3 || _fail "Could not create devnull device"
 mknod $DEVZERO c 1 5 || _fail "Could not create devzero device"
+touch $TARGET || _fail "Could not create symlink target"
+ln -s $TARGET $SYMLINK
 
 _scratch_unmount || _fail "Could not unmount scratch device"
 _scratch_mount -o ro || _fail "Could notemount scratch readonly"
@@ -66,15 +70,18 @@ _scratch_mount -o ro || _fail "Could notemount scratch readonly"
 echo "== try to create new file"
 touch $SCRATCH_MNT/this_should_fail 2>&1 | _filter_scratch
 echo "== pwrite to null device"
-$XFS_IO_PROG -c "pwrite 0 512" /dev/null | _filter_xfs_io
+$XFS_IO_PROG -F -c "pwrite 0 512" /dev/null | _filter_xfs_io
 echo "== pread from zero device"
-$XFS_IO_PROG -c "pread 0 512" /dev/zero | _filter_xfs_io
+$XFS_IO_PROG -F -c "pread 0 512" /dev/zero | _filter_xfs_io
 
 echo "== truncating write to null device"
 echo foo > $DEVNULL 2>&1 | _filter_scratch
 echo "== appending write to null device"
 echo foo >> $DEVNULL 2>&1 | _filter_scratch
 
+echo "== writing to symlink from ro dev to rw dev"
+$XFS_IO_PROG -F -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
+
 # success, all done
 status=0
 exit
diff --git a/tests/generic/306.out b/tests/generic/306.out
index 8644f38..3fd5f63 100644
--- a/tests/generic/306.out
+++ b/tests/generic/306.out
@@ -9,3 +9,6 @@ read 512/512 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == truncating write to null device
 == appending write to null device
+== writing to symlink from ro dev to rw dev
+wrote 512/512 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

                 reply	other threads:[~2013-04-26 19:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=517AD562.3060208@redhat.com \
    --to=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.