Insert the OS X CD/DVD into the optical drive of the other computer. The Apple Hardware Test is on the Mac OS X Setup Disc 1 (Mac OS X 10.5.4) or Install Disc 2 (Mac OS X 10.5.5)
1. If the other computer is a Mac then run Remote Install Mac OS X from the Utilities folder. If it is Windows, select “Remote Install Mac OS X” when the Install Assistant appears.
2. Read the onscreen introduction, press and hold down the Option button on your keyboard while you click on the Continue button.
3. When the Apple Hardware Test chooser screen shows, select your preferred language.
4. Hit the Return button on your keyboard or click the right arrow button.
5. When the main screen of the Apple Hardware Test appears, follow the instructions shown.
6. When the test runs and it detects a problem, it displays an error code. Note down the code before contacting Apple support. If the test does not detect an issue related to hardware, it may be a software related issue.
7. On the other computer, exit Remote Install Mac OS X by clicking on Quit.
Instructions for running the Apple Hardware Test on a Mac and PowerPC-based Mac can be found here. Instructions for running the test in Loop mode are also contained in the same page.