1#! /bin/sh 2 3# Run script for fdtput tests 4# We run fdtput to update the device tree, thn fdtget to check it 5 6# Usage 7# fdtput-runtest.sh name expected_output dtb_file node property flags value 8 9. ./tests.sh 10 11LOG=tmp.log.$$ 12EXPECT=tmp.expect.$$ 13rm -f $LOG $EXPECT 14trap "rm -f $LOG $EXPECT" 0 15 16expect="$1" 17echo $expect >$EXPECT 18dtb="$2" 19node="$3" 20property="$4" 21flags="$5" 22shift 5 23value="$@" 24 25# First run fdtput 26verbose_run_check $VALGRIND "$DTPUT" "$dtb" "$node" "$property" $value $flags 27 28# Now fdtget to read the value 29verbose_run_log_check "$LOG" $VALGRIND "$DTGET" "$dtb" "$node" "$property" $flags 30 31if cmp $EXPECT $LOG >/dev/null; then 32 PASS 33else 34 if [ -z "$QUIET_TEST" ]; then 35 echo "EXPECTED :-:" 36 cat $EXPECT 37 fi 38 FAIL "Results differ from expected" 39fi 40