The knock sensor is a single-wire sensor located in the engine block directly behind the oil filter. With the ignition key on and the engine not running, backprobe the connection checking for voltage. It should read between 1.5 and 5.0 volts. If the voltage is higher or lower, then the sensor is either open or shorted, and should be replaced.
You can test the operation of the sensor by hooking up a timing light and observing the timing marks on the crankshaft pulley. Have an assistant sharply tap the backside of the air intake plenum with a hammer. The ignition timing should momentarily retard a few degrees. If it does, the system is working properly. If the harness test was good but the marks don''t move, the sensor is probably faulty.