diff options
author | George Melikov <[email protected]> | 2017-04-10 03:17:55 +0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-04-09 16:17:55 -0700 |
commit | a8d6ae1e16b253ac2bdb362b9a76945627faa7db (patch) | |
tree | 47a250dc399ae7833f60a46b4e9300ae826249f7 | |
parent | f94a5dccf76a68a8a3a6bf7914474a5e401fdb8a (diff) |
zfstest - replace dircmp with diff
`dircmp` doesn't exist in Linux while `diff` is already used
by zfstests on all platforms.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: John Wren Kennedy <[email protected]>
Signed-off-by: George Melikov <[email protected]>
Closes #5996
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh index df9c49b9f..12914f778 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh @@ -90,9 +90,11 @@ for i in 1 2 3; do done log_note "verify snapshot contents" for ds in $datasets; do - status=$(dircmp /$ds /$ds/.zfs/snapshot/snap | grep "different") - [[ -z $status ]] || log_fail "snapshot contents are different from" \ - "the filesystem" + diff -q -r /$ds /$ds/.zfs/snapshot/snap > /dev/null 2>&1 + if [[ $? -eq 1 ]]; then + log_fail "snapshot contents are different from" \ + "the filesystem" + fi done # We subtract 3 + 7 + 7 + 1 = 18 for three slashes (/), strlen("TESTFSA") == 7, diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh index 611c4154a..f9c05e651 100755 --- a/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_002_pos.ksh @@ -125,9 +125,8 @@ log_must tar xf $TESTDIR/tarball.snapshot.tar cd $CWD || log_fail "Could not cd $CWD" -dircmp $TESTDIR/original $TESTDIR/snapshot > /tmp/zfs_snapshot2.$$ -grep different /tmp/zfs_snapshot2.$$ >/dev/null 2>&1 -if [[ $? -ne 1 ]]; then +diff -q -r $TESTDIR/original $TESTDIR/snapshot > /dev/null 2>&1 +if [[ $? -eq 1 ]]; then log_fail "Directory structures differ." fi diff --git a/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh b/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh index 6269e4a8b..632f50059 100755 --- a/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh +++ b/tests/zfs-tests/tests/functional/snapshot/snapshot_006_pos.ksh @@ -123,9 +123,8 @@ log_must tar xf $TESTDIR1/tarball.snapshot.tar cd $CWD || log_fail "Could not cd $CWD" -dircmp $TESTDIR1/original $TESTDIR1/snapshot > /tmp/zfs_snapshot2.$$ -grep different /tmp/zfs_snapshot2.$$ >/dev/null 2>&1 -if [[ $? -ne 1 ]]; then +diff -q -r $TESTDIR1/original $TESTDIR1/snapshot > /dev/null 2>&1 +if [[ $? -eq 1 ]]; then log_fail "Directory structures differ." fi |