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 <james.a.nunez@intel.com>
Change-Id: I8c51ab04d906d74d6eac5a65420203936184ffe4
Reviewed-on: http://review.whamcloud.com/14766
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Cliff White <cliff.white@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
large_xattr_enabled &&
orig="$(generate_string $(max_xattr_size))" || orig="bar"
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 || 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
mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
touch $DIR/$tdir/$tfile || error "touch $DIR/$tdir/$tfile failed"
replay_barrier $SINGLEMDS
fail $SINGLEMDS
new=$(get_xattr_value trusted.foo $MOUNT2/$tdir/$tfile)
[[ "$new" = "$orig" ]] ||
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
rm -f $DIR/$tdir/$tfile
rmdir $DIR/$tdir
cleanup_58
# PING_INTERVAL max(obd_timeout / 4, 1U)
sleep $((TIMEOUT / 4))
# PING_INTERVAL max(obd_timeout / 4, 1U)
sleep $((TIMEOUT / 4))
+ # 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" ]] ||
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" ||
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" ]] ||
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
rm -f $DIR/$tdir/$tfile
rmdir $DIR/$tdir
cleanup_58