From: Barry Naujok Date: Fri, 14 Mar 2008 03:18:10 +0000 (+0000) Subject: Add xfsprogs version number as environment variable for QA X-Git-Tag: v1.1.0~411 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1d368392c19ac6f8c0c507e4e660f4053430c54a;p=xfstests-dev.git Add xfsprogs version number as environment variable for QA Merge of master-melb:xfs-cmds:30672a by kenmcd. Add xfsprogs version number as environment variable for QA --- diff --git a/common.config b/common.config index e1429668..3179ee1c 100644 --- a/common.config +++ b/common.config @@ -22,8 +22,8 @@ # RMT_IRIXTAPE_DEV- the IRIX remote tape device for the xfsdump tests # RMT_TAPE_USER - remote user for tape device # -# - These can be added to $HOST_CONFIG_DIR (witch default to ./config) -# below or a separate local configuration file can be used (using +# - These can be added to $HOST_CONFIG_DIR (witch default to ./config) +# below or a separate local configuration file can be used (using # the HOST_OPTIONS variable). # - This script is shared by the stress test system and the auto-qa # system (includes both regression test and benchmark components). @@ -70,7 +70,7 @@ set_prog_path() return 0 fi p=$1 - + shift for f; do if [ -x $f ]; then @@ -78,7 +78,7 @@ set_prog_path() return 0 fi done - + echo "" return 1 } @@ -129,6 +129,21 @@ export XFS_IO_PROG="`set_prog_path xfs_io`" export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`" export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`" +# Generate a comparable xfsprogs version number in the form of +# major * 10000 + minor * 100 + release +# +# $ xfs_db -V +# xfs_db version 2.9.7 +# +# so, 2.9.7 = 20907 +_version=`$XFS_DB_PROG -V | $AWK_PROG ' + /version/ { + if (split($3,ver,".") == 3) + print (ver[1] * 10000) + (ver[2] * 100) + ver[3]; + }'` +[ -z "$_version" ] && _fatal "xfsprogs version cannot be found" +export XFSPROGS_VERSION="$_version" + case "$HOSTOS" in IRIX*) export MKFS_XFS_PROG="`set_prog_path mkfs_xfs`" @@ -171,7 +186,7 @@ known_hosts() echo " $MC") # if [ -e configs/$HOST.config ] # then echo "Not carring, we have a configfile ($HOST_CONFIG_DIR/$HOST)" -# else +# else [ "$MC" ] && exit 1 # fi } @@ -210,7 +225,7 @@ _readlink() echo "Usage: _readlink filename" 1>&2 exit 1 fi - + perl -e "\$in=\"$1\";" -e ' $lnk = readlink($in); if ($lnk =~ m!^/.*!) {