| # Copyright (c) 2011 Bryan Schumaker <bjschuma@netapp.com> |
| # Script for easier NFSD fault injection |
| # Check that debugfs has been mounted |
| DEBUGFS=`cat /proc/mounts | grep debugfs` |
| if [ "$DEBUGFS" == "" ]; then |
| echo "debugfs does not appear to be mounted!" |
| echo "Please mount debugfs and try again" |
| # Check that the fault injection directory exists |
| DEBUGDIR=`echo $DEBUGFS | awk '{print $2}'`/nfsd |
| if [ ! -d "$DEBUGDIR" ]; then |
| echo "$DEBUGDIR does not exist" |
| echo "Check that your .config selects CONFIG_NFSD_FAULT_INJECTION" |
| echo "Usage $0 injection_type [count]" |
| echo "Injection types are:" |
| elif [ ! -f $DEBUGDIR/$1 ]; then |
| echo $COUNT > $DEBUGDIR/$1 |
| # Capture lines that only exist in the $AFTER file |
| diff $BEFORE $AFTER | grep ">" |