tpm-helpers/backend/socket.go
Ettore Di Giacinto e5997ada4c
Fixup tests, add testing pipelines and small refactors
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-02-17 12:33:01 +01:00

15 lines
256 B
Go

package backend
import "net"
// Socket returns a fake TPM interface from a unix socket
func Socket(f string) (*FakeTPM, error) {
conn, err := net.Dial("unix", f)
if err != nil {
return nil, err
}
return &FakeTPM{
ReadWriteCloser: conn,
}, nil
}