Whamcloud - gitweb
LU-5407 tests: Error message for replay-single 58b and 58c 66/14766/4
authorJames Nunez <james.a.nunez@intel.com>
Mon, 11 May 2015 20:45:00 +0000 (14:45 -0600)
committerAndreas Dilger <andreas.dilger@intel.com>
Tue, 9 Jun 2015 21:04:54 +0000 (21:04 +0000)
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>
lustre/tests/replay-single.sh

index eb2e96c..9345ffc 100755 (executable)
@@ -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