]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: run_seed_to_range.sh: check existance of a directory using [ -d "$dir" ] 10306/head
authorKefu Chai <kchai@redhat.com>
Fri, 15 Jul 2016 08:38:23 +0000 (16:38 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Jul 2016 08:48:22 +0000 (16:48 +0800)
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 <kchai@redhat.com>
src/test/objectstore/run_seed_to_range.sh

index 365b34918d2759b2dbce9ca4a6d8339fa9c0c414..bc4e3464c4b62aaa3a895be98436de81f063d73e 100755 (executable)
@@ -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