From 88e555dbabfc35521345851ff41516156217b1ec Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 11 May 2015 14:45:00 -0600 Subject: [PATCH] LU-5407 tests: Error message for replay-single 58b and 58c In the replay-single test suite, tests 58b and 58c set an attribute, retrieve the attribute and check that the original message matches what was set. If large extended attributes is enabled, the attribute written can be very long. In case of error, we only print the first few charaters of the message that was set. Also, call error if there is a problem when the client mounts the file system on $MOUNT2. Signed-off-by: James Nunez Change-Id: I8c51ab04d906d74d6eac5a65420203936184ffe4 Reviewed-on: http://review.whamcloud.com/14766 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Cliff White Reviewed-by: Andreas Dilger --- lustre/tests/replay-single.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index eb2e96c..9345ffc 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -1528,8 +1528,11 @@ test_58b() { large_xattr_enabled && orig="$(generate_string $(max_xattr_size))" || orig="bar" + # Original extended attribute can be long. Print a small version of + # attribute if an error occurs + local sm_msg=$(printf "%.9s" $orig) - mount_client $MOUNT2 + mount_client $MOUNT2 || error "mount_client on $MOUNT2 failed" mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed" touch $DIR/$tdir/$tfile || error "touch $DIR/$tdir/$tfile failed" replay_barrier $SINGLEMDS @@ -1537,7 +1540,7 @@ test_58b() { fail $SINGLEMDS new=$(get_xattr_value trusted.foo $MOUNT2/$tdir/$tfile) [[ "$new" = "$orig" ]] || - error "xattr set ($orig) is not what was returned ($new)" + error "xattr set ($sm_msg...) differs from xattr get ($new)" rm -f $DIR/$tdir/$tfile rmdir $DIR/$tdir cleanup_58 @@ -1564,20 +1567,25 @@ test_58c() { # bug 16570 # PING_INTERVAL max(obd_timeout / 4, 1U) sleep $((TIMEOUT / 4)) - mount_client $MOUNT2 + # Original extended attribute can be long. Print a small version of + # attribute if an error occurs + local sm_msg=$(printf "%.9s" $orig) + local sm_msg1=$(printf "%.9s" $orig1) + + mount_client $MOUNT2 || error "mount_client on $MOUNT2 failed" mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed" touch $DIR/$tdir/$tfile || error "touch $DIR/$tdir/$tfile failed" drop_request "setfattr -n trusted.foo -v $orig $DIR/$tdir/$tfile" || error "drop_request for setfattr failed" new=$(get_xattr_value trusted.foo $MOUNT2/$tdir/$tfile) [[ "$new" = "$orig" ]] || - error "xattr set ($orig) is not what was returned ($new)" + error "xattr set ($sm_msg...) differs from xattr get ($new)" drop_reint_reply "setfattr -n trusted.foo1 \ -v $orig1 $DIR/$tdir/$tfile" || - error "drop_request for setfattr failed" + error "drop_reint_reply for setfattr failed" new=$(get_xattr_value trusted.foo1 $MOUNT2/$tdir/$tfile) [[ "$new" = "$orig1" ]] || - error "second xattr set ($orig1) not what was returned ($new)" + error "second xattr set ($sm_msg1...) differs xattr get ($new)" rm -f $DIR/$tdir/$tfile rmdir $DIR/$tdir cleanup_58 -- 1.8.3.1