diff options
author | Stephen Warren <swarren@nvidia.com> | 2014-06-10 16:28:10 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-08-09 11:16:59 -0400 |
commit | 7ad67e5554730fb814c083d481b931d87f29dcbc (patch) | |
tree | 27f61c27cf759ee946ae78855bd721485fb229c0 /test/dfu/dfu_gadget_test_init.sh | |
parent | a4c86bbb5ae89606d5318be4e2a6ae23110bb220 (diff) |
test: dfu: script enhancements
Various misc enhancements to dfu_gadget_test.sh:
* After every write (download), perform a write to a different file
with different data. This ensures that the DFU buffer's content is
replaced, so that if the read (upload) succeeds, we know that the
correct data was actually read from the storage device, rather than
simply being left over in the DFU buffer. This requires two alt
setting names to be passed to the script, and a dummy data file to
be generated by dfu_gadget_test_init.sh.
* Fix the assumption that dfu_gadget_test.sh is run from the directory
that contains it, by cd'ing to that directory before invoking
./dfu_gadget_test_init.sh.
* Use $DIR$RCV_DIR consistently, rather than using plain $RCV_DIR in
some places.
* Add 959, 961 test file sizes, to be consistent with having one
more than and one less than all the other "round" sizes 64, 128, and
4096.
* Remove references to $BKP_DIR from dfu_gadget_test_init.sh, since it
isn't used.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'test/dfu/dfu_gadget_test_init.sh')
-rwxr-xr-x | test/dfu/dfu_gadget_test_init.sh | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/dfu/dfu_gadget_test_init.sh b/test/dfu/dfu_gadget_test_init.sh index b319ed0c89..fb54ad8c55 100755 --- a/test/dfu/dfu_gadget_test_init.sh +++ b/test/dfu/dfu_gadget_test_init.sh @@ -1,4 +1,5 @@ #! /bin/bash + set -e # any command return if not equal to zero clear @@ -7,9 +8,8 @@ COLOUR_GREEN="\33[32m" COLOUR_DEFAULT="\33[0m" LOG_DIR="./log" -BKP_DIR="./bkp" -TEST_FILES_SIZES="127 128 129 8M 4095 4096 4097 63 64 65 960" +TEST_FILES_SIZES="63 64 65 127 128 129 4095 4096 4097 959 960 961 8M" printf "Init script for generating data necessary for DFU test script" @@ -17,10 +17,6 @@ if [ ! -d $LOG_DIR ]; then `mkdir $LOG_DIR` fi -if [ ! -d $BKP_DIR ]; then - `mkdir $BKP_DIR` -fi - for size in $TEST_FILES_SIZES do FILE="./dat_$size.img" @@ -28,6 +24,7 @@ do dd if=/dev/urandom of="./dat_$size.img" bs=$size count=1 > /dev/null 2>&1 || exit $? fi done +dd if=/dev/urandom of="./dfudummy.bin" bs=1024 count=1 > /dev/null 2>&1 || exit $? printf "$COLOUR_GREEN OK $COLOUR_DEFAULT \n" |