tests: ceph-disk.sh: use "readlink -f" instead for fullpath

if $PATH has ".." in it, and the program happen to be located in
"..", `which program` will print `../program` instead of its fullpath,
so we should always use `readlink -f` for the fullpath.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2016-02-11 20:08:32 +08:00
parent 765c7592af
commit 8f42f89937

View File

@ -132,8 +132,8 @@ function kill_daemons() {
function command_fixture() {
local command=$1
[ $(which $command) = `readlink -f ../$command` ] || [ $(which $command) = `readlink -f $(pwd)/$command` ] || return 1
local fpath=`readlink -f $(which $command)`
[ "$fpath" = `readlink -f ../$command` ] || [ "$fpath" = `readlink -f $(pwd)/$command` ] || return 1
cat > $DIR/$command <<EOF
#!/bin/bash