No, I am not suggesting to hammer the knock sensor ;).
Recently I was diagnosing a very intermittent error code 52 (knock sensor open/closed circuit) on a 4AFE powered Toyota Corolla.
I needed a way to test the actual functionality of the knock sensor in a garage.
From my understanding a typical knock sensor is pretty much a condenser microphone. So measuring resistance of it pretty much meaningless beyond finding a completely stuffed one. The repair manual suggest that the resistance of one should be above 1 MOhm, as it should be, as it is a capacitor.
One requirement for this kind of crude testing is having a multimeter that does capacitance testing in the nF range.
The particular knock sensor I was testing measured at about 6-7nF (temperature dependant) sensor alone, or ~7.5nF with the wiring.
The test is very simple, I have unplugged the sensor from the ECU, plugged one probe form the multimeter (set to Capacitance range) to the pin for the knock sensor on the ECU plug, and another on chassis/earth/ground. Then I knocked on a random bolt on the engine block and watch the measurment:
This resulted an increase of the capacitance for each knock (to over 8nF).
Another test that is not on the video, is basically using rattle gun on a bolt. This produced over 1.5nF increase.
I have also tested the sensor outside in a vice while heating it up with heat gun to 120 degrees C. The capacitance increased by ~2nF during heating. The sensor responding in similar way as above to light knocks on the vice anvil.
Alternative and more sophisticated way of testing is hooking up sensor to the microphone input on a cellphone/Laptop/PC but that would involve butchering a 3.5mm jack.