summaryrefslogtreecommitdiffstats
path: root/test/dfu/dfu_gadget_test_init.sh
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2014-06-18 11:38:56 +0200
committerTom Rini <trini@ti.com>2014-08-09 11:16:59 -0400
commita4c86bbb5ae89606d5318be4e2a6ae23110bb220 (patch)
treedba76eaaa824ec23bf28000eef7e0213fb880ea8 /test/dfu/dfu_gadget_test_init.sh
parent6f12ebf6ea7bcae1b6d9ff090b5c1e7452be90e9 (diff)
downloadblackbird-obmc-uboot-a4c86bbb5ae89606d5318be4e2a6ae23110bb220.tar.gz
blackbird-obmc-uboot-a4c86bbb5ae89606d5318be4e2a6ae23110bb220.zip
test:dfu: Add test scripts for testing DFU regression
This commit adds test scripts for testing if any commit has introduced regression to the DFU subsystem. It uses md5 to test if sent and received file is correct. The test detailed description is available at README file. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'test/dfu/dfu_gadget_test_init.sh')
-rwxr-xr-xtest/dfu/dfu_gadget_test_init.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/dfu/dfu_gadget_test_init.sh b/test/dfu/dfu_gadget_test_init.sh
new file mode 100755
index 0000000000..b319ed0c89
--- /dev/null
+++ b/test/dfu/dfu_gadget_test_init.sh
@@ -0,0 +1,34 @@
+#! /bin/bash
+set -e # any command return if not equal to zero
+clear
+
+COLOUR_RED="\33[31m"
+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"
+
+printf "Init script for generating data necessary for DFU test script"
+
+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"
+ if [ ! -f $FILE ]; then
+ dd if=/dev/urandom of="./dat_$size.img" bs=$size count=1 > /dev/null 2>&1 || exit $?
+ fi
+done
+
+printf "$COLOUR_GREEN OK $COLOUR_DEFAULT \n"
+
+exit 0
OpenPOWER on IntegriCloud