MCPcopy
hub / github.com/containerd/containerd / TestContainerLargeExecArgs

Function TestContainerLargeExecArgs

integration/client/container_test.go:513–587  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

511 <-finishedC
512}
513func TestContainerLargeExecArgs(t *testing.T) {
514 t.Parallel()
515
516 client, err := newClient(t, address)
517 if err != nil {
518 t.Fatal(err)
519 }
520 defer client.Close()
521
522 var (
523 image Image
524 ctx, cancel = testContext(t)
525 id = t.Name()
526 )
527 defer cancel()
528
529 image, err = client.GetImage(ctx, testImage)
530 if err != nil {
531 t.Fatal(err)
532 }
533
534 container, err := client.NewContainer(ctx, id, WithNewSnapshot(id, image), WithNewSpec(oci.WithImageConfig(image), longCommand))
535 if err != nil {
536 t.Fatal(err)
537 }
538 defer container.Delete(ctx, WithSnapshotCleanup)
539
540 task, err := container.NewTask(ctx, empty())
541 if err != nil {
542 t.Fatal(err)
543 }
544 defer task.Delete(ctx)
545
546 finishedC, err := task.Wait(ctx)
547 if err != nil {
548 t.Fatal(err)
549 }
550
551 if err := task.Start(ctx); err != nil {
552 t.Fatal(err)
553 }
554 spec, err := container.Spec(ctx)
555 if err != nil {
556 t.Fatal(err)
557 }
558
559 processSpec := spec.Process
560 withExecArgs(processSpec, "echo", strings.Repeat("a", 20000))
561 execID := t.Name() + "_exec"
562 process, err := task.Exec(ctx, execID, processSpec, empty())
563 if err != nil {
564 t.Fatal(err)
565 }
566 processStatusC, err := process.Wait(ctx)
567 if err != nil {
568 t.Fatal(err)
569 }
570

Callers

nothing calls this directly

Calls 15

DeleteMethod · 0.95
NewTaskMethod · 0.95
SpecMethod · 0.95
ExecMethod · 0.95
WithImageConfigFunction · 0.92
newClientFunction · 0.85
testContextFunction · 0.85
WithNewSpecFunction · 0.85
emptyFunction · 0.85
FatalMethod · 0.80
ResultMethod · 0.80
withExecArgsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…