Changeset 1020 for branches/reconfiguration/modules/dspin_router/caba/test
- Timestamp:
- Oct 13, 2015, 4:21:08 PM (9 years ago)
- Location:
- branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/broadcast_check.sh
r998 r1020 4 4 # @brief This script validates that a broadcast transaction reaches once 5 5 # and only once every non-faulty router in the platform. 6 file=$1 6 fname=$1 7 npkts=$2 8 7 9 awk ' 8 10 BEGIN { 9 sent=0 10 last=0 11 failure=0 12 min=99999999 13 max=0 11 npkts=50 12 13 rcvpkts=0 14 nrecvrs=0 15 16 sndpkts=0 17 nsendrs=0 14 18 } 15 # Parse coordinates of routers16 # /DSPIN_GENERATOR/ {17 # regex="\\[[0-9]+\\]\\[";18 # if (match($2,regex)) {19 # x=substr($2,RSTART+1,RLENGTH-3);20 # }21 # regex="\\]\\[[0-9]+\\]";22 # if (match($2,regex)) {23 # y=substr($2,RSTART+2,RLENGTH-3);24 # }25 # }26 19 27 20 # Parse the number of sent broadcast packets 28 21 /broadcast sent packets += +/ { 29 if ($6 != 0) { 30 sent=$6; 22 sent=$6 23 if (sent > 0) { 24 if (nsendrs > 1) { 25 print "error: more than one initiator sent broadcast packets\n" 26 exit 1 27 } 28 if (sent != npkts) { 29 print "error: the number of sent broadcast packets does not " 30 print "correspond to the one specified\n" 31 exit 1 32 } 33 nsendrs++; 34 sndpkts=sent; 31 35 } 32 36 } … … 34 38 # Parse the number of received broadcast packets 35 39 /broadcast received packets +=/ { 36 if ($6 == 0) { 40 received=$6 41 if (received == 0) { 37 42 zero++; 38 43 } 39 44 else { 40 # store the min and max number of received packets 41 if ($6 < min) { 42 min=$6; 45 if (received != npkts) { 46 print "error: at least a router received a number of broadcast "; 47 if (received > npkts) { 48 print "greater than the number of broadcast sent\n"; 49 } 50 else { 51 print "less than the number of broadcast sent\n"; 52 } 53 exit 1 43 54 } 44 if ($6 > max) { 45 max=$6; 46 } 55 nrecvrs++; 56 rcvpkts=received 47 57 } 48 58 } … … 56 66 exit 1; 57 67 } 58 59 if (max > sent) {60 print "error: at least a router received a number of broadcast greater"61 print "than the number of broadcast sent\n";62 exit 1;63 }64 65 68 if (zero == 1) { 66 69 print "error: the broadcast source received broadcasts\n"; … … 68 71 } 69 72 70 error=sent - min 71 if (error > 0) { 72 print "error: the number of broadcast received by a router is inferior " 73 print "to the error threshold: error = " error "\n"; 74 exit 1; 75 } 76 73 print "sent: " sndpkts " / # senders: " nsendrs; 74 print "received: " rcvpkts " / # receivers " nrecvrs "\n"; 77 75 exit 0; 78 }' $f ile76 }' $fname 79 77 if [[ $? == 1 ]]; then exit 1; fi 80 78 -
branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/run_broadcast_check.sh
r998 r1020 1 1 #!/usr/bin/env sh 2 XSIZE=10 3 YSIZE=10 4 NPKTS=50 5 2 6 LOGDIR=logs 3 COMMON="-X 5 -Y 5 -P 1500"7 COMMON="-X $XSIZE -Y $YSIZE -P $NPKTS" 4 8 SCRIPTPATH=$(dirname $0) 5 9 … … 9 13 10 14 mkdir -p $LOGDIR 11 for (( x = 0; x < 5; x++ )); do12 for (( y = 0; y < 5; y++ )); do13 for (( fx = 0; fx < 5; fx++ )); do14 for (( fy = 0; fy < 5; fy++ )); do15 for (( x = 0; x < $XSIZE; x++ )); do 16 for (( y = 0; y < $YSIZE; y++ )); do 17 for (( fx = 0; fx < $XSIZE; fx++ )); do 18 for (( fy = 0; fy < $YSIZE; fy++ )); do 15 19 if [[ ( $x == $fx ) && ( $y == $fy ) ]]; then continue; fi 16 20 LOGFILE=$LOGDIR/$(echo log'_'$x'_'$y'_'$fx'_'$fy); … … 18 22 echo "./simul.x $ARGS ($LOGFILE)" 19 23 ./simul.x $ARGS > $LOGFILE 2>/dev/null; 20 $SCRIPTPATH/broadcast_check.sh $LOGFILE 24 $SCRIPTPATH/broadcast_check.sh $LOGFILE $NPKTS 21 25 if [[ $? == 1 ]]; then 22 26 echo "FAILURE";
Note: See TracChangeset
for help on using the changeset viewer.