How can I run a hardware test in lion?
If your mac shipped with Lion, you should be able to run the hardware test by simply holding D when your computer boots.

If your mac did not ship with lion, you will need the original install disks to boot into the hardware test mode.



Reference