From: Elena Gryaznova Date: Wed, 27 Apr 2022 12:26:26 +0000 (+0300) Subject: LU-15789 tests: execute cleanup_115() 1 time X-Git-Tag: 2.15.51~133 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bd1c8aa7e39d418b1eaefa5dfb47a479e24b7c36 LU-15789 tests: execute cleanup_115() 1 time Patch fixes the following test_115() defects: cleanup_115 () is called 3 times: 1. at the end of test 2. on run_one() returns 3. on run_one() subshell exits No reason to use $SINGLEMDS since test operates with mds1 only. No reason to save FLAKEY since test is executed in subshell. Correctly call DEBUGFS -c -R 'stat ROOT/$tdir/$tfile', without correct quotation we have: debugfs 1.45.6.cr1 (14-Aug-2020) debugfs: No such file or directory while trying to open ROOT/d115.conf-sanity/f115.conf-sanity stat: Filesystem not open Fixes: ef13d5464e ("LU-11915 tests: fix conf-sanity 115 test") Fixes: d7449233c1 ("LU-8444 tests: test for unsigned xattr inode number") Test-Parameters: trivial testlist=conf-sanity env=ONLY="115 116" Signed-off-by: Elena Gryaznova HPE-bug-id: LUS-10901 Reviewed-by: Vladimir Saveliev Change-Id: I11c4889ebe309c48527235c59fce1381202401b4 Reviewed-on: https://review.whamcloud.com/47153 Tested-by: jenkins Reviewed-by: Andreas Dilger Reviewed-by: Artem Blagodarenko Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 7eae993..b7c8d30 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -8975,7 +8975,7 @@ cleanup_115() { trap 0 stopall - rm -f $TMP/$tdir/lustre-mdt + do_facet mds1 rm -f $1 } test_115() { @@ -8984,79 +8984,79 @@ test_115() { fi [ -n "$FILESET" ] && skip "Not functional for FILESET set" - local dbfs_ver=$(do_facet $SINGLEMDS $DEBUGFS -V 2>&1) + local dbfs_ver=$(do_facet mds1 $DEBUGFS -V 2>&1) echo "debugfs version: $dbfs_ver" echo "$dbfs_ver" | egrep -w "1.44.3.wc1|1.44.5.wc1|1.45.2.wc1" && skip_env "This version of debugfs doesn't show inode number" - IMAGESIZE=$((3072 << 30)) # 3072 GiB + local IMAGESIZE=$((3072 << 30)) # 3072 GiB stopall - local saved_flakey=${FLAKEY} - - stack_trap "FLAKEY=$saved_flakey" EXIT FLAKEY=false echo "client1: " - lctl dl + $LCTL dl mount | grep lustre echo "mds1: " - do_facet mds1 "hostname; lctl dl; mount" + do_facet mds1 "hostname; $LCTL dl; mount" echo "ost1: " - do_facet ost1 "hostname; lctl dl; mount" + do_facet ost1 "hostname; $LCTL dl; mount" # We need MDT size 3072GB, because it is smallest # partition that can store 2B inodes - do_facet $SINGLEMDS "mkdir -p $TMP/$tdir" + do_facet mds1 "mkdir -p $TMP/$tdir" local mdsimgname=$TMP/$tdir/lustre-mdt - do_facet $SINGLEMDS "rm -f $mdsimgname" - do_facet $SINGLEMDS "touch $mdsimgname" - trap cleanup_115 RETURN EXIT - do_facet $SINGLEMDS "$TRUNCATE $mdsimgname $IMAGESIZE" || + do_facet mds1 "rm -f $mdsimgname" + do_facet mds1 "touch $mdsimgname" + stack_trap "cleanup_115 $mdsimgname" EXIT + do_facet mds1 "$TRUNCATE $mdsimgname $IMAGESIZE" || skip "Backend FS doesn't support sparse files" - local mdsdev=$(do_facet $SINGLEMDS "losetup -f") + local mdsdev=$(do_facet mds1 "losetup -f") - do_facet $SINGLEMDS "losetup $mdsdev $mdsimgname" + do_facet mds1 "losetup $mdsdev $mdsimgname" local mds_opts="$(mkfs_opts mds1 $(mdsdevname 1)) \ --mkfsoptions='-O ea_inode,^resize_inode,meta_bg \ -N 2247484000 -E lazy_itable_init' --device-size=$IMAGESIZE" add mds1 $mds_opts --mgs --reformat $mdsdev || skip_env "format large MDT failed" - opts="$(mkfs_opts ost1 $(ostdevname 1)) \ - $replace --reformat $(ostdevname 1) $(ostvdevname 1)" + + local ostdev=$(ostdevname 1) + + local opts="$(mkfs_opts ost1 $ostdev) \ + --reformat $ostdev $ostdev" add ost1 $opts || error "add ost1 failed with new params" - start $SINGLEMDS $mdsdev $MDS_MOUNT_OPTS || error "start MDS failed" + start mds1 $mdsdev $MDS_MOUNT_OPTS || error "start MDS failed" start_ost || error "start OSS failed" mount_client $MOUNT || error "mount client failed" mkdir -p $DIR/$tdir || error "mkdir $DIR/$tdir fail" - goal="/sys/fs/ldiskfs/$(basename $mdsdev)/inode_goal" + local goal="/sys/fs/ldiskfs/$(basename $mdsdev)/inode_goal" echo goal: $goal # 2147483648 is 0x80000000 - do_facet $SINGLEMDS "echo 2147483648 >> $goal; grep . $goal" + do_facet mds1 "echo 2147483648 >> $goal; grep . $goal" touch $DIR/$tdir/$tfile # attrs from 1 to 16 go to block, 17th - to inode + local i + for i in {1..17}; do local nm="trusted.ea$i" - setfattr -n $nm -v $(printf "xattr%0250d" $i) $DIR/$tdir/$tfile done - do_facet $SINGLEMDS $DEBUGFS -c -R "stat ROOT/$tdir/$tfile" $mdsdev + do_facet mds1 "$DEBUGFS -c -R 'stat ROOT/$tdir/$tfile' $mdsdev" # inode <2147483649> trusted.ea16 (255) - local inode_num=$(do_facet $SINGLEMDS \ + local inode_num=$(do_facet mds1 \ "$DEBUGFS -c -R 'stat ROOT/$tdir/$tfile' $mdsdev" | awk '/ea17/ { print $2 }' | sed -e 's/>//' -e 's/