From 134f3eced1535bb6e867d552075d507eadb7cc48 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Wed, 6 Nov 2019 14:01:34 -0700 Subject: [PATCH] LU-11490 tests: use variable for file system name There are several tests that have the file system name hard coded to "lustre". These tests will fail or some calls will fail when these tests are run on systems where the file system name is not "lustre". These tests should be changed to use $FSNAME. Test-Parameters: trivial testlist=sanity,conf-sanity Signed-off-by: James Nunez Change-Id: I22263d2ae5ad29806cb709f462ef21837916c939 Reviewed-on: https://review.whamcloud.com/36694 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Wei Liu --- lustre/tests/conf-sanity.sh | 22 +++++++++++----------- lustre/tests/obdfilter-survey.sh | 2 +- lustre/tests/sanity.sh | 17 +++++++++-------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 2c393d5..e877c4e 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -7305,9 +7305,9 @@ test_100() { # Desired output # MGS: # 0@lo - # lustre-MDT0000: + # $FSNAME-MDT0000: # 0@lo - # lustre-OST0000: + # $FSNAME-OST0000: # 0@lo do_facet mgs 'lshowmount -v' | awk 'BEGIN {NR == 0; rc=1} /MGS:/ {rc=0} END {exit rc}' || error "lshowmount have no output MGS" @@ -7801,10 +7801,10 @@ test_108a() { echo "changing server nid..." $rcmd mount -t lustre -o nosvc lustre-mdt1/mdt1 $tmp/mnt/mdt1 - $rcmd lctl replace_nids lustre-MDT0000 $nid - $rcmd lctl replace_nids lustre-MDT0001 $nid - $rcmd lctl replace_nids lustre-OST0000 $nid - $rcmd lctl replace_nids lustre-OST0001 $nid + $rcmd lctl replace_nids $FSNAME-MDT0000 $nid + $rcmd lctl replace_nids $FSNAME-MDT0001 $nid + $rcmd lctl replace_nids $FSNAME-OST0000 $nid + $rcmd lctl replace_nids $FSNAME-OST0001 $nid $rcmd umount $tmp/mnt/mdt1 for facet in $facets; do @@ -7863,10 +7863,10 @@ test_108b() { echo "changing server nid..." $rcmd mount -t lustre -o nosvc,loop $tmp/images/mdt1 $tmp/mnt/mdt1 - $rcmd lctl replace_nids lustre-MDT0000 $nid - $rcmd lctl replace_nids lustre-MDT0001 $nid - $rcmd lctl replace_nids lustre-OST0000 $nid - $rcmd lctl replace_nids lustre-OST0001 $nid + $rcmd lctl replace_nids $FSNAME-MDT0000 $nid + $rcmd lctl replace_nids $FSNAME-MDT0001 $nid + $rcmd lctl replace_nids $FSNAME-OST0000 $nid + $rcmd lctl replace_nids $FSNAME-OST0001 $nid $rcmd umount $tmp/mnt/mdt1 for facet in $facets; do @@ -7876,7 +7876,7 @@ test_108b() { done for facet in $scrub_list; do - $rcmd $LCTL lfsck_start -M lustre-$facet -t scrub || + $rcmd $LCTL lfsck_start -M $FSNAME-$facet -t scrub || error "failed to start OI scrub on $facet" done diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index bf5189a..f2ec471 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -50,7 +50,7 @@ get_targets () { # obdfilter-survey : # case 1 (local disk): # $ nobjhi=2 thrhi=2 size=1024 - # targets="lustre-OST0000 lustre-OST0001 ..." + # targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..." # sh obdfilter-survey local_node && [ "$1" == "disk" ] || target=$nid:$target targets="$targets $target" diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index b62e7fd..3ef952f 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -4981,7 +4981,7 @@ test_49() { # LU-1030 [ $PARALLEL == "yes" ] && skip "skip parallel run" remote_ost_nodsh && skip "remote OST with nodsh" - # get ost1 size - lustre-OST0000 + # get ost1 size - $FSNAME-OST0000 ost1_size=$(do_facet ost1 $LFS df | grep ${ost1_svc} | awk '{ print $4 }') # write 800M at maximum @@ -19757,8 +19757,9 @@ test_300k() { # this test needs a huge transaction local kb - kb=$(do_facet $SINGLEMDS lctl get_param -n osd*.lustre-MDT0000.kbytestotal) - [ $kb -lt $((1024*1024)) ] && skip "too small mds: $kb" + kb=$(do_facet $SINGLEMDS "$LCTL get_param -n \ + osd*.$FSNAME-MDT0000.kbytestotal") + [ $kb -lt $((1024*1024)) ] && skip "MDT0 too small: $kb" local stripe_count local file @@ -20440,7 +20441,7 @@ test_fake_rw() { $LFS setstripe -c 1 -i 0 $DIR/$tfile - # get ost1 size - lustre-OST0000 + # get ost1 size - $FSNAME-OST0000 local ost1_avail_size=$($LFS df | awk /${ost1_svc}/'{ print $4 }') local blocks=$((ost1_avail_size/2/1024)) # half avail space by megabytes [ $blocks -gt 1000 ] && blocks=1000 # 1G in maximum @@ -20982,13 +20983,13 @@ test_qos_mkdir() { lmv.*.qos_maxage=$lmv_qos_maxage > /dev/null" EXIT lod_qos_prio_free=$(do_facet mds1 $LCTL get_param -n \ - lod.lustre-MDT0000-mdtlov.mdt_qos_prio_free | head -n1) + lod.$FSNAME-MDT0000-mdtlov.mdt_qos_prio_free | head -n1) lod_qos_prio_free=${lod_qos_prio_free%%%} lod_qos_threshold_rr=$(do_facet mds1 $LCTL get_param -n \ - lod.lustre-MDT0000-mdtlov.mdt_qos_threshold_rr | head -n1) + lod.$FSNAME-MDT0000-mdtlov.mdt_qos_threshold_rr | head -n1) lod_qos_threshold_rr=${lod_qos_threshold_rr%%%} lod_qos_maxage=$(do_facet mds1 $LCTL get_param -n \ - lod.lustre-MDT0000-mdtlov.qos_maxage | awk '{ print $1 }') + lod.$FSNAME-MDT0000-mdtlov.qos_maxage | awk '{ print $1 }') stack_trap "do_nodes $mdts $LCTL set_param \ lod.*.mdt_qos_prio_free=$lod_qos_prio_free > /dev/null" EXIT stack_trap "do_nodes $mdts $LCTL set_param \ @@ -22160,7 +22161,7 @@ test_805() { local usedkb local old local quota - local pref="osd-zfs.lustre-MDT0000." + local pref="osd-zfs.$FSNAME-MDT0000." # limit available space on MDS dataset to meet nospace issue # quickly. then ZFS 0.7.2 can use reserved space if asked -- 1.8.3.1