Whamcloud - gitweb
LU-6055 hsm: improve error handling in sanity-hsm 54/13154/2
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 19 Dec 2014 16:44:05 +0000 (10:44 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 26 Dec 2014 01:57:46 +0000 (01:57 +0000)
In path2fid() propagate errors from 'lfs path2fid'.  In
file_creation_failure() redirect the output of df to stderr so that it
is not captured by command substitution.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I7fabf46af4aa36c6affef45cf8c9b044a7aa29dd
Reviewed-on: http://review.whamcloud.com/13154
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/tests/sanity-hsm.sh

index f87ef93..64f5376 100755 (executable)
@@ -511,6 +511,7 @@ needclients() {
 
 path2fid() {
        $LFS path2fid $1 | tr -d '[]'
 
 path2fid() {
        $LFS path2fid $1 | tr -d '[]'
+       return ${PIPESTATUS[0]}
 }
 
 get_hsm_flags() {
 }
 
 get_hsm_flags() {
@@ -561,7 +562,7 @@ file_creation_failure() {
        local f=$2
        local err=$3
 
        local f=$2
        local err=$3
 
-       df $MOUNT $MOUNT2
+       df $MOUNT $MOUNT2 >&2
        error "cannot create $f with $cmd, status=$err"
 }
 
        error "cannot create $f with $cmd, status=$err"
 }