changeset 410:0e17f61fb076

yaffs: Changes to test scripts Add mount_cycling script. Change /proc/yaffs_debug references to /proc/yaffs_stats. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
author Charles Manning <cdhmanning@gmail.com>
date Thu, 22 Apr 2010 13:27:28 +1200
parents b5309c9b6d7f
children 1a06ffe55df9
files linux-tests/mount_cycling.sh
diffstat 1 files changed, 89 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
new file mode 100755
--- /dev/null
+++ b/linux-tests/mount_cycling.sh
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+MNTPT=/mnt
+N=5000
+the_file=`pwd`\/data
+rm $the_file
+
+let i=0
+for j in $(seq 1 5000)
+do
+	echo "##"
+	echo "##"
+	echo "## Mount $j of $N"
+	echo "##"
+	echo "##"
+
+	df
+	echo ###"
+	mount -t yaffs2 /dev/mtdblock0 $MNTPT
+	df
+	echo ###"
+	cd $MNTPT
+
+	str=$(cat /proc/yaffs_stats)
+	echo "$i, $str" 
+	echo "$i, $str"  >> $the_file
+	let i=$i+1
+
+	sleep 1
+
+	str=$(cat /proc/yaffs_stats)
+	echo "$i, $str" 
+	echo "$i, $str"  >> $the_file
+	let i=$i+1
+	
+	sleep 1
+
+	~charles/fs-tests/fsx/fsx -N 10000 aa  &
+
+	rm zze
+
+	str=$(cat /proc/yaffs_stats)
+	echo "$i, $str" 
+	echo "$i, $str"  >> $the_file
+	let i=$i+1
+
+	dd if=/dev/urandom of=zza count=4000 &
+	dd if=/dev/urandom of=zzb count=4000 &
+	dd if=/dev/urandom of=zzc count=100000 &
+	dd if=/dev/urandom of=zzd count=4000 &
+	dd if=/dev/urandom of=zze count=4000 &
+	dd if=/dev/urandom of=zzf count=40000 &
+
+	for k in $(seq 1 10)
+	do
+		sleep 1
+
+		str=$(cat /proc/yaffs_stats)
+		echo "$i, $str" 
+		echo "$i, $str"  >> $the_file
+		let i=$i+1
+	done
+	
+	echo "waiting..."
+	wait
+	echo "wait completed"
+	
+	rm zza
+
+	str=$(cat /proc/yaffs_stats)
+	echo "$i, $str" 
+	echo "$i, $str"  >> $the_file
+	let i=$i+1
+
+	rm zzb
+	str=$(cat /proc/yaffs_stats)
+	echo "$i, $str" 
+	echo "$i, $str"  >> $the_file
+	let i=$i+1
+	rm zzc
+	str=$(cat /proc/yaffs_stats)
+	echo "$i, $str" 
+	echo "$i, $str"  >> $the_file
+	let i=$i+1
+
+	cd -
+	umount $MNTPT
+	
+done