mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-10-06 06:12:19 +00:00
a4c86bbb5a
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>
34 lines
650 B
Bash
Executable file
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
|