Test-smartcard ported from repos/libports.
