How can I run Apple Hardware Test with a firmware password set?
Your firmware password must be disabled to start Apple Hardware Test.  To do this:


Either boot into OS X Recovery (hold ⌘+R while powering on) and select Firmware Password Utility from the menu, or follow these instructions.
Select "Turn Off Firmware Password...": 
Enter your firmware password to disable it: 
Select "Quit Firmware Password Utility": 
Restart your Mac and attempt to launch Apple Hardware Test again with D.