qed: add infrastructure for device self tests.