Hello,
I have written a driver and have used down( ) for my mutexes instead of down_interruptible( ). After talking with a customer I learned that down_interruptible( ) is preferred and allows an application to recover from errors such as segmentation faults.
Now that I have refactored my program to use down_interruptible( ), how should I generate signals to exercise the failure paths of my code.
For instance in my code I have lines such as:
Code:
if (down_interruptible(&dev->sem)) {
... do some cleanup //want to test these lines
return -ERESTARTSYS;
}
One thought I have had is to spin a seperate thread that sends signals to another thread that uses my driver and see if all is handled well. Does anyone else have any good ideas for testing driver resilience?
Thanks in advance.