5e9649933bbce09875a9ea493e872ff243f76c1b
[platform/upstream/coreutils.git] / tests / du / two-args
1 #!/bin/sh
2 # Make sure `du d/1 d/2' works.
3 # That command failed with du from fileutils-4.0q.
4
5 if test "$VERBOSE" = yes; then
6   set -x
7   du --version
8 fi
9
10 pwd=`pwd`
11 tmp=du2-$$
12 trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
13 trap '(exit $?); exit' 1 2 13 15
14
15 framework_failure=0
16 mkdir $tmp || framework_failure=1
17 cd $tmp || framework_failure=1
18
19 if test $framework_failure = 1; then
20   echo 'failure in testing framework'
21   (exit 1); exit 1
22 fi
23
24 mkdir -p $tmp/1 $tmp/2
25
26 test -d $tmp || fail=1
27 du $tmp/1 $tmp/2 > /dev/null || fail=1
28
29 # Make sure `du . $tmp' and `du .. $tmp' work.
30 # These would fail prior to fileutils-4.0y.
31 du . $tmp > /dev/null || fail=1
32 du .. $tmp > /dev/null || fail=1
33
34 (exit $fail); exit $fail