MCPcopy
hub / github.com/google/gvisor / TestPipeWriteBlock

Function TestPipeWriteBlock

pkg/sentry/kernel/pipe/pipe_test.go:75–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestPipeWriteBlock(t *testing.T) {
76 const atomicIOBytes = 2
77 const capacity = MinimumPipeSize
78
79 runTest(t, capacity, func(ctx context.Context, r *vfs.FileDescription, w *vfs.FileDescription) {
80 msg := make([]byte, capacity+1)
81 n, err := w.Write(ctx, usermem.BytesIOSequence(msg), vfs.WriteOptions{})
82 if wantN, wantErr := int64(capacity), linuxerr.ErrWouldBlock; n != wantN || err != wantErr {
83 t.Fatalf("Writev: got (%d, %v), wanted (%d, %v)", n, err, wantN, wantErr)
84 }
85 })
86}
87
88func TestPipeWriteUntilEnd(t *testing.T) {
89 const atomicIOBytes = 2

Callers

nothing calls this directly

Calls 4

BytesIOSequenceFunction · 0.92
runTestFunction · 0.70
WriteMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…