]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: test that the xfs_io scrub/repair commands actually work
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 30 Jun 2017 04:12:39 +0000 (21:12 -0700)
committerEryu Guan <eguan@redhat.com>
Mon, 3 Jul 2017 12:25:01 +0000 (20:25 +0800)
When we call _require_xfs_io_command for the scrub ioctl, we have to
actually try calling the ioctl to make sure that the ioctl is
present on the running kernel.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc

index 57d596cd4f2e9b1e62c3d5d6ce538c15c84dfb0c..b5053659c1c8cd26d17ee407d48b53c8b81b9155 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2179,6 +2179,11 @@ _require_xfs_io_command()
                echo $testio | egrep -q "invalid option" && \
                        _notrun "xfs_io $command support is missing"
                ;;
+       "scrub"|"repair")
+               testio=`$XFS_IO_PROG -x -c "$command dummy 0" $TEST_DIR 2>&1`
+               echo $testio | egrep -q "Inappropriate ioctl" && \
+                       _notrun "xfs_io $command support is missing"
+               ;;
        "utimes" )
                testio=`$XFS_IO_PROG -f -c "utimes" 0 0 0 0 $testfile 2>&1`
                ;;