Msg10918.html

From Linix VServer
Jump to navigationJump to search

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Vserver] Updates to testfs.sh script[edit]


  • From: micah
  • Date: Tue, 4 Oct 2005 20:49:34 +0200 (CEST)



Please find attached a diff against testfs.sh-0.09. This diff adds the
-c option to disable color output and also adds the -q option to
mkfs.jfs because without this mkfs.jfs asks if you want to continue
causing the test to fail erroneously.

micah
--- testfs.sh-0.09      2005-09-19 04:27:43.000000000 -0400
+++ testfs.sh-0.10      2005-10-04 14:46:52.000000000 -0400
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-eR='\e[31m';eG='\e[32m';eY='\e[33m';eB='\e[34m';eN='\e[0m'
-
 function eecho () {
     C=$1; shift
     echo -e "$C$*$eN"
@@ -360,7 +358,7 @@
 nfsopt="vers=3,hard,intr,tcp,sync"
 
 
-while getopts ":hlotvxD:F:M:N:O:" option; do
+while getopts ":hlotvxcD:F:M:N:O:" option; do
   case $option in
     h)  # help
         cat << EOF
@@ -377,6 +375,7 @@
   -M <mnt>  mount point [$MNT]
   -N <src>  nfs source [$NFS]
   -O <opt>  nfs options [$nfsopt]
+  -c        disable color output
 
 examples:
   
@@ -402,6 +401,9 @@
     t)  # terse output
         terse=1
         ;;
+    c)  # disable color output
+        color="no"
+        ;;
     D)  # device 
         DEV="$OPTARG"
         ;;
@@ -421,6 +423,10 @@
 done
 shift $(($OPTIND - 1))
 
+if [ "$color" != "no" ]; then
+        eR='\e[31m';eG='\e[32m';eY='\e[33m';eB='\e[34m';eN='\e[0m'
+fi
+
 outdev="/dev/null"
 [ $verbose -gt 1 ] && outdev="/dev/stdout"
 errdev="/dev/null"
@@ -454,7 +460,7 @@
     echo "---"
     eecho $eY "testing $fs filesystem ..."
     case $fs in 
-    ext2|ext3|xfs|jfs)
+    ext2|ext3|xfs)
        mkfs.$fs $DEV 1>$outdev 2>$errdev
        rc=$?; ececho $rc "[000]"
        [ $rc -gt 0 ] && echo "($fs format failed)" && continue
@@ -466,6 +472,12 @@
        [ $rc -gt 0 ] && echo "(reiser format failed)" && continue
        do_test reiser "attrs,$mntopt"
        ;;
+    jfs*)
+        mkfs.jfs -q $DEV 1>$outdev 2>$errdev
+       rc=$?; ececho $rc "[000]"
+       [ $rc -gt 0 ] && echo "($fs format failed)" && continue
+       do_test "$fs" "$mntopt"
+       ;;
     nfs)
        do_test nfs "$nfsopt,$mntopt"
        ;;

Attachment: signature.asc
Description: OpenPGP digital signature