Skip to content

Commit c021f09

Browse files
committed
Merge remote-tracking branch 'origin/pr/30'
2 parents 059a519 + d64436f commit c021f09

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

machine_test.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,15 @@ func testAttachVsock(ctx context.Context, t *testing.T, m *Machine) {
247247
}
248248
err := m.addVsock(ctx, dev)
249249
if err != nil {
250-
t.Errorf("attaching vsock failed: %s", err)
250+
if badRequest, ok := err.(*operations.PutGuestVsockByIDBadRequest); ok &&
251+
strings.HasPrefix(badRequest.Payload.FaultMessage, "Invalid request method and/or path") {
252+
t.Errorf(`attaching vsock failed: %s
253+
Does your Firecracker binary have vsock support?
254+
Build one with vsock support by running `+"`cargo build --release --features vsock` from within the Firecracker repository.",
255+
badRequest.Payload.FaultMessage)
256+
} else {
257+
t.Errorf("attaching vsock failed: %s", err)
258+
}
251259
}
252260
}
253261

@@ -256,13 +264,12 @@ func testStartInstance(ctx context.Context, t *testing.T, m *Machine) {
256264
if err != nil {
257265
if syncErr, ok := err.(*operations.CreateSyncActionDefault); ok &&
258266
strings.HasPrefix(syncErr.Payload.FaultMessage, "Cannot create vsock device") {
259-
t.Errorf(`startInstance: %s
267+
t.Errorf(`startInstance: %s
260268
Do you have permission to interact with /dev/vhost-vsock?
261269
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)
265270
}
271+
} else {
272+
t.Errorf("startInstance failed: %s", err)
266273
}
267274
}
268275

0 commit comments

Comments
 (0)