Method and system for testing a network device is provided. The system
includes, a test program running on a host system that communicates with
the network device through a bus functional module; and a test module
that includes a packet counter that counts test packets that are received
from a buffer and written in a memory of the test module; and an idle
timer that counts time that has expired after a last test packet has been
received by the memory module of the test module; wherein if the packet
counter value exceeds a threshold value then all test packets residing in
the memory of the test module are sent for testing network device logic
and if the idle timer expires at any given instance, then all the test
packets in the memory of the test module are sent for testing network
device logic.