[Ocfs2-test-devel] [PATCH 1/3] ocfs2-test: mkfs-test.sh - Made script compatible with new debugfs.ocfs2 output.

Marcos Matsunaga Marcos.Matsunaga at oracle.com
Fri May 29 13:10:58 PDT 2009


Debugfs.ocfs2 had some changes on the way it displays the output.
This change makes it compatible with the new output. Also, due to the
change on the way it reports some information (it now reports the size
and not the bits), the calculation of blocksize and clustersize is not
necessary anymore.  The calculation was removed and the comparison is
now made directly to the results obtained from debugfs.ocfs2.

Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga at oracle.com>
---
 programs/mkfs-tests/mkfs-test.sh |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh
index 51d61be..4db63d6 100755
--- a/programs/mkfs-tests/mkfs-test.sh
+++ b/programs/mkfs-tests/mkfs-test.sh
@@ -24,9 +24,9 @@ verify_sizes() {
 
     ${DEBUGFS} -R "stats" ${device} >> ${O} 2>/dev/null
 
-    num1=`${AWK} '/Block Size Bits/ {print $4;}' ${O}`
-    num2=`${AWK} '/Cluster Size Bits/ {print $8;}' ${O}`
-    num3=`${AWK} '/Clusters:/ {print $4;}' ${O}`
+    num1=`${AWK} '/Block size=/ {print $2;}' ${O}|cut -f2 -d"="`
+    num2=`${AWK} '/Cluster size=/ {print $2;}' ${O}|cut -f2 -d"="`
+    num3=`${AWK} '/Volume size=/ {print $3;}' ${O}|cut -f2 -d"("`
 
     if [ ${num1} -eq 0 ] || [ ${num2} -eq 0 ] || [ ${num3} -eq 0 ]
     then
@@ -34,17 +34,15 @@ verify_sizes() {
         exit 1
     fi
 
-    b=$[$[2**$[${num1} - 9]]*512]
-    c=$[$[2**$[${num2} - 9]]*512]
-    v=$[${num3} * ${c}/${b}]
+    v=$[${num3} * ${num2}/${num1}]
 
      echo -n "verify ..... "  |tee -a ${LOGFILE}
 
-    if [ ${B} -ne ${b} ]; then
+    if [ ${B} -ne ${num1} ]; then
         echo "ERROR: Blocksize mismatch - found ${b}, expected ${B}" >> ${O}
         RET=1
     fi
-    if [ ${C} -ne ${c} ]; then
+    if [ ${C} -ne ${num2} ]; then
         echo "ERROR: Clustersize mismatch - found ${c}, expected ${C}" >> ${O}
         RET=1
     fi
-- 
1.5.6.5




More information about the Ocfs2-test-devel mailing list