From: Kefu Chai Date: Fri, 15 Jul 2016 08:38:23 +0000 (+0800) Subject: test: run_seed_to_range.sh: check existance of a directory using [ -d "$dir" ] X-Git-Tag: v11.0.1~729^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=83e64fad875980844515995acee6ef501c6c7cb5;p=ceph-ci.git test: run_seed_to_range.sh: check existance of a directory using [ -d "$dir" ] sadly, sh evalutes `[ -d ]` to true. as it takes "-d" as a non-empty string as true. this fixes following failure ``` 2016-07-12T23:22:02.839 INFO:teuthology.orchestra.run.mira084.stderr:cp: missing destination file operand after ‘.’ 2016-07-12T23:22:02.839 INFO:teuthology.orchestra.run.mira084.stderr:Try 'cp --help' for more information. ``` see http://pulpito.ceph.com/kchai-2016-07-12_23:09:35-rados-wip-kefu-testing2---basic-mira/311334/ Signed-off-by: Kefu Chai --- diff --git a/src/test/objectstore/run_seed_to_range.sh b/src/test/objectstore/run_seed_to_range.sh index 365b34918d2..bc4e3464c4b 100755 --- a/src/test/objectstore/run_seed_to_range.sh +++ b/src/test/objectstore/run_seed_to_range.sh @@ -12,7 +12,7 @@ mydir=`dirname $0` for f in `seq $from $to` do if ! $mydir/run_seed_to.sh $seed $f; then - if [ -d $dir ]; then + if [ -d "$dir" ]; then echo copying evidence to $dir cp -a . $dir else