Whamcloud - gitweb
LU-2471 tests: Fix facet_type() to recognise names like mds1_2
authorLi Wei <wei.g.li@intel.com>
Tue, 18 Dec 2012 14:40:49 +0000 (22:40 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 20 Dec 2012 16:18:36 +0000 (11:18 -0500)
In conf-sanity 24a, mdsdevname() and mdsvdevname() are given facet
numbers like "1_2".  This causes facet_type() to be given facet names
like "mds1_2", which it can not return the facet type "MDS".  This
patch fixes facet_type() to handle names like "mds1_2" properly.

Signed-off-by: Li Wei <wei.g.li@intel.com>
Change-Id: I0203add5f6fdf089d5061ee48c6efca449db1a96
Reviewed-on: http://review.whamcloud.com/4849
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/test-framework.sh

index 1531c5d..7384e12 100644 (file)
@@ -697,7 +697,7 @@ cleanup_gss() {
 facet_type() {
        local facet=$1
 
-       echo -n $facet | sed -e 's/^fs[0-9]\+//' -e 's/[0-9]\+//' |
+       echo -n $facet | sed -e 's/^fs[0-9]\+//' -e 's/[0-9_]\+//' |
                tr '[:lower:]' '[:upper:]'
 }