attestation: allow "go test" to work with CGO disabled

This commit is contained in:
Malte Poll 2023-08-18 16:16:46 +02:00 committed by Malte Poll
parent 1d5f244879
commit 75ed8c9f3e
7 changed files with 55 additions and 0 deletions

View file

@ -15,6 +15,7 @@ import (
"crypto/x509/pkix"
"io"
"net/http"
"os"
"testing"
"time"
@ -32,6 +33,10 @@ import (
)
func TestGetAttestationCert(t *testing.T) {
cgo := os.Getenv("CGO_ENABLED")
if cgo == "0" {
t.Skip("skipping test because CGO is disabled and tpm simulator requires it")
}
require := require.New(t)
tpm, err := simulator.OpenSimulatedTPM()
require.NoError(err)