File: test-dummy-programmer

package info (click to toggle)
flashprog 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,112 kB
  • sloc: ansic: 61,779; makefile: 919; sh: 323
file content (23 lines) | stat: -rwxr-xr-x 1,016 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# This is the core functionality of test_build.sh from flashprog, adapted to
# not output non-error messages to stderr

set -e

TEMP_DIR=$(mktemp -d)
trap "rm -rf ${TEMP_DIR}" EXIT

dd status=none bs=$((128*1024)) count=1 </dev/urandom >"${TEMP_DIR}/rand"
dd status=none bs=$((128*1024)) count=1 </dev/urandom >"${TEMP_DIR}/rand2"
dd status=none bs=$((128*1024)) count=1 </dev/zero | tr '\000' '\377' >"${TEMP_DIR}/empty"

flashprog -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -w "${TEMP_DIR}/rand"
flashprog -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -r "${TEMP_DIR}/bak"
cmp "${TEMP_DIR}/rand" "${TEMP_DIR}/bak"

flashprog -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -c M25P10 -w "${TEMP_DIR}/rand2"
flashprog -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -c M25P10 -v "${TEMP_DIR}/rand2"

flashprog -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -c M25P10 -E
flashprog -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -c M25P10 -v "${TEMP_DIR}/empty"