Skip to content

Commit 059a519

Browse files
committed
Merge remote-tracking branch 'origin/pr/28'
2 parents 51e28b9 + cd7ac1d commit 059a519

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

machine_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ import (
2121
"flag"
2222
"os"
2323
"path/filepath"
24+
"strings"
2425
"testing"
2526
"time"
2627

28+
"github.com/firecracker-microvm/firecracker-go-sdk/client/operations"
2729
"github.com/firecracker-microvm/firecracker-go-sdk/fctesting"
2830
"github.com/golang/mock/gomock"
2931
)
@@ -252,7 +254,15 @@ func testAttachVsock(ctx context.Context, t *testing.T, m *Machine) {
252254
func testStartInstance(ctx context.Context, t *testing.T, m *Machine) {
253255
err := m.startInstance(ctx)
254256
if err != nil {
255-
t.Errorf("startInstance failed: %s", err)
257+
if syncErr, ok := err.(*operations.CreateSyncActionDefault); ok &&
258+
strings.HasPrefix(syncErr.Payload.FaultMessage, "Cannot create vsock device") {
259+
t.Errorf(`startInstance: %s
260+
Do you have permission to interact with /dev/vhost-vsock?
261+
Grant yourself permission with `+"`sudo setfacl -m u:${USER}:rw /dev/vhost-vsock`", syncErr.Payload.FaultMessage)
262+
}
263+
} else {
264+
t.Errorf("startInstance failed: %s", err)
265+
}
256266
}
257267
}
258268

0 commit comments

Comments
 (0)