Whamcloud - gitweb
LU-2274 tests: use ext3 as baseline for POSIX test on SLES
authorYu Jian <yujian@whamcloud.com>
Tue, 13 Nov 2012 14:16:07 +0000 (22:16 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Nov 2012 21:40:47 +0000 (16:40 -0500)
Since SLES distro does not support read-write access to an ext4
file system by default, this patch changes the baseline filesystem
to ext3 for POSIX testing on SLES distro.

The patch also removes the package installation codes from the
test script, which can detect and prompt which mandatory package
is not installed.

Test-Parameters: envdefinitions=SLOW=yes clientdistro=sl11 testlist=posix
Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: Iac901bb62afe0a944e8211e73bacb061e9a3aac1
Reviewed-on: http://review.whamcloud.com/4524
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
lustre/tests/posix.sh
lustre/tests/posix/posix.cfg

index 8615a37..396e930 100755 (executable)
@@ -13,6 +13,10 @@ check_and_setup_lustre
 
 POSIX_DIR=${POSIX_DIR:-"$LUSTRE/tests/posix"}
 POSIX_SRC=${POSIX_SRC:-"/usr/src/posix"}
 
 POSIX_DIR=${POSIX_DIR:-"$LUSTRE/tests/posix"}
 POSIX_SRC=${POSIX_SRC:-"/usr/src/posix"}
+BASELINE_FS=${BASELINE_FS:-"ext4"}
+
+# SLES does not support read-write access to an ext4 file system by default
+[[ -e /etc/SuSE-release ]] && BASELINE_FS=ext3
 
 cleanup_loop_dev() {
     local mnt=$1
 
 cleanup_loop_dev() {
     local mnt=$1
@@ -33,40 +37,40 @@ cleanup_loop_dev() {
 }
 
 setup_loop_dev() {
 }
 
 setup_loop_dev() {
-    local mnt=$1
-    local dev=$2
-    local file=$3
-    local rc=0
-
-    echo "Make a loop file system with $file on $dev"
-    dd if=/dev/zero of=$file bs=1024k count=500 > /dev/null
-    if ! losetup $dev $file; then
-        rc=$?
-        echo "can't set up $dev for $file"
-        return $rc
-    fi
-    if ! mkfs.ext4 $dev; then
-        rc=$?
-        echo "mkfs.ext4 on $dev failed"
-        return $rc
-    fi
-    mkdir -p ${mnt}
-    if ! mount -t ext4 $dev $mnt; then
-        rc=$?
-        echo "mount ext4 failed"
-        return $rc
-    fi
-    echo
-    return $rc
+       local mnt=$1
+       local dev=$2
+       local file=$3
+       local rc=0
+
+       echo "Make a loop file system with $file on $dev"
+       dd if=/dev/zero of=$file bs=1024k count=500 > /dev/null
+       if ! losetup $dev $file; then
+               rc=$?
+               echo "can't set up $dev for $file"
+               return $rc
+       fi
+       if ! eval mkfs.$BASELINE_FS $dev; then
+               rc=$?
+               echo "mkfs.$BASELINE_FS on $dev failed"
+               return $rc
+       fi
+       mkdir -p $mnt
+       if ! mount -t $BASELINE_FS $dev $mnt; then
+               rc=$?
+               echo "mount $BASELINE_FS failed"
+               return $rc
+       fi
+       echo
+       return $rc
 }
 
 test_1() {
 }
 
 test_1() {
-    local allnodes="$(comma_list $(nodes_list))"
-    local tfile="$TMP/ext4-file"
-    local mntpnt=$POSIX_SRC/ext4
-    local loopbase
-    local loopdev
-    local rc=0
+       local allnodes="$(comma_list $(nodes_list))"
+       local tfile="$TMP/$BASELINE_FS-file"
+       local mntpnt=$POSIX_SRC/$BASELINE_FS
+       local loopbase
+       local loopdev
+       local rc=0
 
     # We start at loop1 because posix build uses loop0
     [ -b /dev/loop/1 ] && loopbase=/dev/loop/
 
     # We start at loop1 because posix build uses loop0
     [ -b /dev/loop/1 ] && loopbase=/dev/loop/
@@ -111,7 +115,7 @@ test_1() {
     cleanup_loop_dev "$POSIX_SRC"
     cleanup_loop_dev "$mntpnt" "$loopdev" "$tfile"
 }
     cleanup_loop_dev "$POSIX_SRC"
     cleanup_loop_dev "$mntpnt" "$loopdev" "$tfile"
 }
-run_test 1 "build, install, run posix on ext4 and lustre, then compare"
+run_test 1 "install, build, run posix on $BASELINE_FS and lustre, then compare"
 
 complete $SECONDS
 check_and_cleanup_lustre
 
 complete $SECONDS
 check_and_cleanup_lustre
index 86980b6..1f1408c 100644 (file)
@@ -51,7 +51,8 @@ delete_posix_users() {
 # Setup users and groups for running the POSIX test suite.
 setup_posix_users() {
        local node=${1:-$HOSTNAME}
 # Setup users and groups for running the POSIX test suite.
 setup_posix_users() {
        local node=${1:-$HOSTNAME}
-       local gid=$GROUP_ID
+       # consistent with install.sh in LSB Test Suite
+       local gid=$((GROUP_ID + 1))
        local uid=$USER_ID
        local user group
        local home
        local uid=$USER_ID
        local user group
        local home
@@ -97,11 +98,7 @@ prep() {
     [[ -f $TEST_BIN ]] && rm -f $TEST_BIN
     [[ -d $INSTALL_DIR ]] && rm -rf $INSTALL_DIR
 
     [[ -f $TEST_BIN ]] && rm -f $TEST_BIN
     [[ -d $INSTALL_DIR ]] && rm -rf $INSTALL_DIR
 
-    rpm -q byacc > /dev/null || yum -y install byacc
     if grep -q " 6." /etc/issue; then
     if grep -q " 6." /etc/issue; then
-        rpm -q compat-glibc-headers > /dev/null || \
-            yum install -y compat-glibc-headers
-
         [[ -d /usr/include/bits ]] || mkdir -p /usr/include/bits
         [[ -d /usr/include/sys ]] || mkdir -p /usr/include/sys
         [[ -s /usr/include/stropts.h ]] || \
         [[ -d /usr/include/bits ]] || mkdir -p /usr/include/bits
         [[ -d /usr/include/sys ]] || mkdir -p /usr/include/sys
         [[ -s /usr/include/stropts.h ]] || \