u-boot/test/dfu/dfu_gadget_test_init.sh
Lukasz Majewski a4c86bbb5a 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>
2014-08-09 11:16:59 -04:00

34 lines
650 B
Bash
Executable file

#! /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