View topic - Serial Driver Testing

Serial Driver Testing

General Help about QNX

Serial Driver Testing

Postby garyritu » Wed Jan 13, 2010 9:46 am

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.
garyritu
Active Member
 
Posts: 58
Joined: Fri May 22, 2009 7:09 am

Re: Serial Driver Testing

Postby rgallen » Wed Jan 13, 2010 4:12 pm

> 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.

> 2. 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.

> 3. 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).

> 4. 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.

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

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

> 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.

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.
rgallen
QNX Master
 
Posts: 671
Joined: Thu Jul 11, 2002 6:48 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron