test: add a test of the valid_hds function

Also tweaked the function a bit so that the output from hdstrace
does not appear on the terminal.