Serial Driver Testing

Hi All,
I need to test serial driver before final client delivery. So i have generated test cases for data send / receive and configuration change testing but still there are more scenarios to test serial driver.
Please help me out for driver testing under following condition.

  1. How to generate and simluate hardware errors for my driver.

  2. What should be done in application to make driver crash. Also if driver is crashed then how to reload same serial driver ??

  3. How to test parity error, frame error, overflow error and break interrupt using application. Might be termios structure helpful here.

  4. Testing for maximum thorugh put possible on driver.

  5. How to test graceful and ungraceful shutdown of serial driver.

  6. How to perform memory allocation checking for driver. I have used malloc function to allocate memory. During shutdown all allocated memory should be freed.

Any other negative testing for driver are welcome.

  1. How to generate and simluate hardware errors for my driver.

On a serial line you can:

a) inject noise by coiling an unshielded cable around a hand-held electric drill (this is incredibly effective at injecting noise).

b) disconnect the cable.

c) deliberately mis-configure the opposite end of the link.

  1. What should be done in application to make driver crash. Also if driver is crashed then how to reload same serial driver ??

On QNX only a bug in the driver, that is tickled by the application can make it crash. The only thing you can do from the application is to misuse the ioctl/read/write apis in an attempt to tickle a bug in the driver.

  1. How to test parity error, frame error, overflow error and break interrupt using application. Might be termios structure helpful here.

The electric drill test above, will catch most of these (except for the overflow).

  1. Testing for maximum thorugh put possible on driver.

In order to test maximum throughput by the driver, it is necessary to makes sure that all the buffers are set optimally (including the on-chip FIFO) and that the protocol being used has a large window size.

  1. How to test graceful and ungraceful shutdown of serial driver.

"slay -sSIGSEGV " will handle ungraceful shutdown, a simple "slay " should give you a graceful shutdown.

  1. How to perform memory allocation checking for driver. I have used malloc function to allocate memory. During shutdown all allocated memory should be freed.

On QNX you don’t need to test this. The operating system guarantees that when any process is shutdown all memory allocated to the process is freed.