summaryrefslogtreecommitdiffstats
path: root/recipes-test/ddt-runner/files/scripts/t1042rdb/spi
diff options
context:
space:
mode:
authorBogdan Oprescu <bogdan.oprescu@enea.com>2023-11-15 11:09:08 +0200
committerBogdan Oprescu <bogdan.oprescu@enea.com>2023-11-16 14:26:36 +0200
commit6da9d81e77b2f56a91a697ac474473e787a58ccf (patch)
tree170e6a5acc14673fc466a7405d7cc35673bed507 /recipes-test/ddt-runner/files/scripts/t1042rdb/spi
parent2283105d0abe9efa216b018e0d34100e4544ce78 (diff)
downloadmeta-enea-daisy-enea-231026.tar.gz
T1042RDB: Adding ddt testsdaisy-enea-231026
Signed-off-by: Bogdan Oprescu <bogdan.oprescu@enea.com>
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/t1042rdb/spi')
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/t1042rdb/spi35
1 files changed, 35 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/t1042rdb/spi b/recipes-test/ddt-runner/files/scripts/t1042rdb/spi
new file mode 100755
index 0000000..06475a7
--- /dev/null
+++ b/recipes-test/ddt-runner/files/scripts/t1042rdb/spi
@@ -0,0 +1,35 @@
1#!/bin/bash
2
3SPIDEVS=`cat /proc/mtd | grep -e "^mtd" | grep -i spi | gawk -e '{print $1}' | sed 's/://'`
4if [ -z "$SPIDEVS" ]; then
5 echo "SKIP: no spi device found"
6 exit 1
7fi
8
9
10MTD_DEBUG=`which mtd_debug`
11if [ -z "$MTD_DEBUG" ] ; then
12 echo "FAIL: mtd_debug utility not found on the system"
13 exit 1
14fi
15
16ERRCODE=0
17
18for DV in $SPIDEVS ; do
19 FNAME=`cat /proc/mtd | grep $DV | gawk -F\" '{print $2}'`
20 FDEV=/dev/$DV
21 MTDSIZE=`$MTD_DEBUG info $FDEV | grep "mtd.size" | gawk -e '{print $3}'`
22 if [ $MTDSIZE -eq 0 ] ; then
23 echo "SKIP: $FNAME size is $MTDSIZE (skipped)"
24 else
25 $MTD_DEBUG read $FDEV 0 $MTDSIZE /dev/null > /dev/null 2>&1
26 if [ $? -eq 0 ] ; then
27 echo "PASS: \"$FNAME\" read $MTDSIZE bytes"
28 else
29 echo "FAIL: \"$FNAME\" trying to read $MTDSIZE bytes"
30 ERRCODE=2
31 fi
32 fi
33done
34
35exit $ERRCODE