2 # Ensure dd treats `--' properly.
3 # Also test some flag values.
10 if test "$VERBOSE" = yes; then
16 echo data > $tmp_in || test_failure=1
17 ln $tmp_in $tmp_in2 || test_failure=1
18 ln -s $tmp_in $tmp_sym || test_failure=1
19 if test $test_failure = 1; then
20 echo 'failure in testing framework'
24 dd if=$tmp_in of=$tmp_out 2> /dev/null || fail=1
25 cmp $tmp_in $tmp_out || fail=1
28 dd -- if=$tmp_in of=$tmp_out 2> /dev/null || fail=1
29 cmp $tmp_in $tmp_out || fail=1
31 if dd oflag=append if=$tmp_in of=$tmp_out 2> /dev/null; then
32 cmp $tmp_in $tmp_out || fail=1
35 if dd iflag=nofollow if=$tmp_in count=0 2> /dev/null; then
36 dd iflag=nofollow if=$tmp_sym count=0 2> /dev/null && fail=1
39 if dd iflag=directory if=. count=0 2> /dev/null; then
40 dd iflag=directory count=0 <. 2> /dev/null || fail=1
41 dd iflag=directory count=0 <$tmp_in 2> /dev/null && fail=1
44 old_ls=`ls -u --full-time $tmp_in`
46 if dd iflag=noatime if=$tmp_in of=$tmp_out 2> /dev/null; then
47 new_ls=`ls -u --full-time $tmp_in`
48 if test "x$old_ls" != "x$new_ls"; then
49 echo "dd iflag=noatime updated atime; O_NOATIME bug in your kernel?" >&2
54 if dd oflag=nolinks if=$tmp_in of=$tmp_out 2> /dev/null; then
55 dd iflag=nolinks if=$tmp_in > /dev/null 2>&1 && fail=1
56 dd iflag=nolinks < $tmp_in > /dev/null 2>&1 && fail=1
57 dd oflag=nolinks < $tmp_in > $tmp_out 2>&1 || fail=1
60 rm -f $tmp_in $tmp_in2 $tmp_sym $tmp_out