From 3f2ad881802092ef359aa3cf2040978829d444c4 Mon Sep 17 00:00:00 2001 From: Bob Glossman Date: Tue, 24 Sep 2013 15:31:54 -0700 Subject: [PATCH] LU-3587 tests: add sanity test for crash in changelog 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 Change-Id: I559bbd1ba9210f21ac58246366c61ee33f34ae1a Reviewed-on: http://review.whamcloud.com/7751 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 858573a..7d21b74 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -9353,7 +9353,7 @@ changelog_extract_field() { 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) ] || @@ -9449,7 +9449,38 @@ test_160() { 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 -- 1.8.3.1