Whamcloud - gitweb
LU-3587 tests: add sanity test for crash in changelog 51/7751/8
authorBob Glossman <bob.glossman@intel.com>
Tue, 24 Sep 2013 22:31:54 +0000 (15:31 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 8 Oct 2013 16:43:37 +0000 (16:43 +0000)
This patch adds a sanity test to verify that the previous fixes committed
for this bug prevent a crash during a changelog fetch after renaming
one very long filename to another.

Test-Parameters: testlist=sanity envdefinitions=ONLY=160b

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I559bbd1ba9210f21ac58246366c61ee33f34ae1a
Reviewed-on: http://review.whamcloud.com/7751
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index 858573a..7d21b74 100644 (file)
@@ -9353,7 +9353,7 @@ changelog_extract_field() {
                tail -1
 }
 
                tail -1
 }
 
-test_160() {
+test_160a() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
        [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.0) ] ||
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
        [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.0) ] ||
@@ -9449,7 +9449,38 @@ test_160() {
                echo "$USERS other changelog users; can't verify off"
        fi
 }
                echo "$USERS other changelog users; can't verify off"
        fi
 }
-run_test 160 "changelog sanity"
+run_test 160a "changelog sanity"
+
+test_160b() { # LU-3587
+       [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+       remote_mds_nodsh && skip "remote MDS with nodsh" && return
+       [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.0) ] ||
+               { skip "Need MDS version at least 2.2.0"; return; }
+
+       local CL_USERS="mdd.$MDT0.changelog_users"
+       local GET_CL_USERS="do_facet $SINGLEMDS $LCTL get_param -n $CL_USERS"
+       USER=$(do_facet $SINGLEMDS $LCTL --device $MDT0 changelog_register -n)
+       echo "Registered as changelog user $USER"
+       $GET_CL_USERS | grep -q $USER ||
+               error "User $USER not found in changelog_users"
+
+       local LONGNAME1=$(str_repeat a 255)
+       local LONGNAME2=$(str_repeat b 255)
+
+       cd $DIR
+       echo "creating very long named file"
+       touch $LONGNAME1 || error "create of $LONGNAME1 failed"
+       echo "moving very long named file"
+       mv $LONGNAME1 $LONGNAME2
+
+       $LFS changelog $MDT0 | grep RENME
+
+       echo "deregistering $USER"
+       do_facet $SINGLEMDS $LCTL --device $MDT0 changelog_deregister $USER
+
+       rm -f $LONGNAME2
+}
+run_test 160b "Verify that very long rename doesn't crash in changelog"
 
 test_161a() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
 
 test_161a() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return