From: Charles Manning Date: Thu, 25 Mar 2010 00:48:41 +0000 (+1300) Subject: Add more test scripts to automate running tests. X-Git-Tag: pre-name-change~92^2 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=99c62e39578113a798483b5dc6c13a80737163f1;hp=-c Add more test scripts to automate running tests. --- 99c62e39578113a798483b5dc6c13a80737163f1 diff --git a/direct/tests/README b/direct/tests/README index 72a349c..c4976c2 100644 --- a/direct/tests/README +++ b/direct/tests/README @@ -10,3 +10,48 @@ If anyone knows otherwise, please contact me: manningc2@actrix.gen.nz I find it best to run these tests in a ramfs to make them run faster (and not pound the disk). + +A quick word about running some of these tests... + + +There are two tests, one simulating nor and the other nand, labelled + +*nor*.sh and *nand*.sh + +These can be run in the local directory as follows: +$ ./init_fw_update_test_nand.sh +$ ./run_fw_update_test_nand.sh + +NB These create simulation files in the current directory, so only one +instance can be run in a directory. + +The number of iterations can be set by adding a numerical parameter + +$ ./init_fw_update_test_nand.sh +$ ./run_fw_update_test_nand.sh 5000 + +Since the test creates snapshot files between each iteration the test is +relatively slow if run against a hard disk. Far better to run against a ram +disk + +$ mkdir xxx +$ mount -t tmpfs none xxx +$ cd xxx +$ cp ../*sh . +$ ln -s ../yaffs_test yaffs_test +$ ./init_fw_update_test_nand.sh +$ ./run_fw_update_test_nand.sh + +The above is also wrapped in a script called manage_nor_test.sh which +creates all the above. The managed_nor_test.sh script accepts an optional +parameter to specify an instance name. Named instances will create named +directories. + +If you want to run multuiple instances then it is easy to do so with +xterm as follows: + +$ xterm -e "`pwd`/manage_nor_test.sh 1"& +$ xterm -e "`pwd`/manage_nor_test.sh 2"& +$ xterm -e "`pwd`/manage_nor_test.sh 3"& +... + diff --git a/direct/tests/manage_nand_test.sh b/direct/tests/manage_nand_test.sh new file mode 100755 index 0000000..0d02f13 --- /dev/null +++ b/direct/tests/manage_nand_test.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +dir_id=-none +[ -z $1 ] || dir_id=$1 + +RUNDIR=`pwd`/tmpnand$dir_id +mkdir $RUNDIR +sudo mount -t tmpfs none $RUNDIR +sudo chmod a+wr $RUNDIR +cd $RUNDIR +cp ../*sh . +ln -s ../yaffs_test yaffs_test + +./init_fw_update_test_nand.sh +./run_fw_update_test_nand.sh + diff --git a/direct/tests/manage_nor_test.sh b/direct/tests/manage_nor_test.sh new file mode 100755 index 0000000..e1c94d5 --- /dev/null +++ b/direct/tests/manage_nor_test.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +dir_id=-none +[ -z $1 ] || dir_id=$1 + +RUNDIR=`pwd`/tmpnor$dir_id +mkdir $RUNDIR +sudo mount -t tmpfs none $RUNDIR +sudo chmod a+wr $RUNDIR +cd $RUNDIR +cp ../*sh . +ln -s ../yaffs_test yaffs_test + +./init_fw_update_test_nor.sh +./run_fw_update_test_nor.sh +