]> git.ipfire.org Git - people/ms/u-boot.git/blame - test/dfu/dfu_gadget_test_init.sh
test:dfu: Add test scripts for testing DFU regression
[people/ms/u-boot.git] / test / dfu / dfu_gadget_test_init.sh
CommitLineData
a4c86bbb
ŁM
1#! /bin/bash
2set -e # any command return if not equal to zero
3clear
4
5COLOUR_RED="\33[31m"
6COLOUR_GREEN="\33[32m"
7COLOUR_DEFAULT="\33[0m"
8
9LOG_DIR="./log"
10BKP_DIR="./bkp"
11
12TEST_FILES_SIZES="127 128 129 8M 4095 4096 4097 63 64 65 960"
13
14printf "Init script for generating data necessary for DFU test script"
15
16if [ ! -d $LOG_DIR ]; then
17 `mkdir $LOG_DIR`
18fi
19
20if [ ! -d $BKP_DIR ]; then
21 `mkdir $BKP_DIR`
22fi
23
24for size in $TEST_FILES_SIZES
25do
26 FILE="./dat_$size.img"
27 if [ ! -f $FILE ]; then
28 dd if=/dev/urandom of="./dat_$size.img" bs=$size count=1 > /dev/null 2>&1 || exit $?
29 fi
30done
31
32printf "$COLOUR_GREEN OK $COLOUR_DEFAULT \n"
33
34exit 0